Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Fri, 24 Nov 2017 09:44:19
Message-Id: 1511516594.277f3ac893451a040aec17314c7400592a8b0c30.alicef@gentoo
1 commit: 277f3ac893451a040aec17314c7400592a8b0c30
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 24 09:43:14 2017 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 24 09:43:14 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=277f3ac8
7
8 linux kernel 4.9.65
9
10 0000_README | 4 +
11 1064_linux-4.9.65.patch | 613 ++++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 617 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index c8f1c9c..98ea34c 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -299,6 +299,10 @@ Patch: 1063_linux-4.9.64.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.9.64
21
22 +Patch: 1064_linux-4.9.65.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.9.65
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1064_linux-4.9.65.patch b/1064_linux-4.9.65.patch
31 new file mode 100644
32 index 0000000..4f5b36f
33 --- /dev/null
34 +++ b/1064_linux-4.9.65.patch
35 @@ -0,0 +1,613 @@
36 +diff --git a/Makefile b/Makefile
37 +index d29cace0da6d..87a641515e9c 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 9
43 +-SUBLEVEL = 64
44 ++SUBLEVEL = 65
45 + EXTRAVERSION =
46 + NAME = Roaring Lionus
47 +
48 +diff --git a/crypto/dh.c b/crypto/dh.c
49 +index 9d19360e7189..99e20fc63cc9 100644
50 +--- a/crypto/dh.c
51 ++++ b/crypto/dh.c
52 +@@ -21,19 +21,12 @@ struct dh_ctx {
53 + MPI xa;
54 + };
55 +
56 +-static inline void dh_clear_params(struct dh_ctx *ctx)
57 ++static void dh_clear_ctx(struct dh_ctx *ctx)
58 + {
59 + mpi_free(ctx->p);
60 + mpi_free(ctx->g);
61 +- ctx->p = NULL;
62 +- ctx->g = NULL;
63 +-}
64 +-
65 +-static void dh_free_ctx(struct dh_ctx *ctx)
66 +-{
67 +- dh_clear_params(ctx);
68 + mpi_free(ctx->xa);
69 +- ctx->xa = NULL;
70 ++ memset(ctx, 0, sizeof(*ctx));
71 + }
72 +
73 + /*
74 +@@ -71,10 +64,8 @@ static int dh_set_params(struct dh_ctx *ctx, struct dh *params)
75 + return -EINVAL;
76 +
77 + ctx->g = mpi_read_raw_data(params->g, params->g_size);
78 +- if (!ctx->g) {
79 +- mpi_free(ctx->p);
80 ++ if (!ctx->g)
81 + return -EINVAL;
82 +- }
83 +
84 + return 0;
85 + }
86 +@@ -84,19 +75,24 @@ static int dh_set_secret(struct crypto_kpp *tfm, void *buf, unsigned int len)
87 + struct dh_ctx *ctx = dh_get_ctx(tfm);
88 + struct dh params;
89 +
90 ++ /* Free the old MPI key if any */
91 ++ dh_clear_ctx(ctx);
92 ++
93 + if (crypto_dh_decode_key(buf, len, &params) < 0)
94 +- return -EINVAL;
95 ++ goto err_clear_ctx;
96 +
97 + if (dh_set_params(ctx, &params) < 0)
98 +- return -EINVAL;
99 ++ goto err_clear_ctx;
100 +
101 + ctx->xa = mpi_read_raw_data(params.key, params.key_size);
102 +- if (!ctx->xa) {
103 +- dh_clear_params(ctx);
104 +- return -EINVAL;
105 +- }
106 ++ if (!ctx->xa)
107 ++ goto err_clear_ctx;
108 +
109 + return 0;
110 ++
111 ++err_clear_ctx:
112 ++ dh_clear_ctx(ctx);
113 ++ return -EINVAL;
114 + }
115 +
116 + static int dh_compute_value(struct kpp_request *req)
117 +@@ -154,7 +150,7 @@ static void dh_exit_tfm(struct crypto_kpp *tfm)
118 + {
119 + struct dh_ctx *ctx = dh_get_ctx(tfm);
120 +
121 +- dh_free_ctx(ctx);
122 ++ dh_clear_ctx(ctx);
123 + }
124 +
125 + static struct kpp_alg dh = {
126 +diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
127 +index 172a9dc06ec9..5d509ccf1299 100644
128 +--- a/drivers/char/ipmi/ipmi_msghandler.c
129 ++++ b/drivers/char/ipmi/ipmi_msghandler.c
130 +@@ -4029,7 +4029,8 @@ smi_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
131 + }
132 +
133 + static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent,
134 +- struct list_head *timeouts, long timeout_period,
135 ++ struct list_head *timeouts,
136 ++ unsigned long timeout_period,
137 + int slot, unsigned long *flags,
138 + unsigned int *waiting_msgs)
139 + {
140 +@@ -4042,8 +4043,8 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent,
141 + if (!ent->inuse)
142 + return;
143 +
144 +- ent->timeout -= timeout_period;
145 +- if (ent->timeout > 0) {
146 ++ if (timeout_period < ent->timeout) {
147 ++ ent->timeout -= timeout_period;
148 + (*waiting_msgs)++;
149 + return;
150 + }
151 +@@ -4109,7 +4110,8 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent,
152 + }
153 + }
154 +
155 +-static unsigned int ipmi_timeout_handler(ipmi_smi_t intf, long timeout_period)
156 ++static unsigned int ipmi_timeout_handler(ipmi_smi_t intf,
157 ++ unsigned long timeout_period)
158 + {
159 + struct list_head timeouts;
160 + struct ipmi_recv_msg *msg, *msg2;
161 +diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
162 +index cf76fc6149e5..fbb75514dfb4 100644
163 +--- a/drivers/dma/dmatest.c
164 ++++ b/drivers/dma/dmatest.c
165 +@@ -666,6 +666,7 @@ static int dmatest_func(void *data)
166 + * free it this time?" dancing. For now, just
167 + * leave it dangling.
168 + */
169 ++ WARN(1, "dmatest: Kernel stack may be corrupted!!\n");
170 + dmaengine_unmap_put(um);
171 + result("test timed out", total_tests, src_off, dst_off,
172 + len, 0);
173 +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
174 +index 5fa36ebc0640..63d61c084815 100644
175 +--- a/drivers/net/bonding/bond_main.c
176 ++++ b/drivers/net/bonding/bond_main.c
177 +@@ -3217,7 +3217,7 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
178 + hash ^= (hash >> 16);
179 + hash ^= (hash >> 8);
180 +
181 +- return hash;
182 ++ return hash >> 1;
183 + }
184 +
185 + /*-------------------------- Device entry points ----------------------------*/
186 +diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
187 +index c08bd763172a..a300ed48a7d8 100644
188 +--- a/drivers/net/ethernet/fealnx.c
189 ++++ b/drivers/net/ethernet/fealnx.c
190 +@@ -257,8 +257,8 @@ enum rx_desc_status_bits {
191 + RXFSD = 0x00000800, /* first descriptor */
192 + RXLSD = 0x00000400, /* last descriptor */
193 + ErrorSummary = 0x80, /* error summary */
194 +- RUNT = 0x40, /* runt packet received */
195 +- LONG = 0x20, /* long packet received */
196 ++ RUNTPKT = 0x40, /* runt packet received */
197 ++ LONGPKT = 0x20, /* long packet received */
198 + FAE = 0x10, /* frame align error */
199 + CRC = 0x08, /* crc error */
200 + RXER = 0x04, /* receive error */
201 +@@ -1633,7 +1633,7 @@ static int netdev_rx(struct net_device *dev)
202 + dev->name, rx_status);
203 +
204 + dev->stats.rx_errors++; /* end of a packet. */
205 +- if (rx_status & (LONG | RUNT))
206 ++ if (rx_status & (LONGPKT | RUNTPKT))
207 + dev->stats.rx_length_errors++;
208 + if (rx_status & RXER)
209 + dev->stats.rx_frame_errors++;
210 +diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
211 +index 50737def774c..32e9ec8f1521 100644
212 +--- a/drivers/net/usb/asix_devices.c
213 ++++ b/drivers/net/usb/asix_devices.c
214 +@@ -624,7 +624,7 @@ static int asix_suspend(struct usb_interface *intf, pm_message_t message)
215 + struct usbnet *dev = usb_get_intfdata(intf);
216 + struct asix_common_private *priv = dev->driver_priv;
217 +
218 +- if (priv->suspend)
219 ++ if (priv && priv->suspend)
220 + priv->suspend(dev);
221 +
222 + return usbnet_suspend(intf, message);
223 +@@ -676,7 +676,7 @@ static int asix_resume(struct usb_interface *intf)
224 + struct usbnet *dev = usb_get_intfdata(intf);
225 + struct asix_common_private *priv = dev->driver_priv;
226 +
227 +- if (priv->resume)
228 ++ if (priv && priv->resume)
229 + priv->resume(dev);
230 +
231 + return usbnet_resume(intf);
232 +diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
233 +index b82be816256c..1fca0024f294 100644
234 +--- a/drivers/net/usb/cdc_ether.c
235 ++++ b/drivers/net/usb/cdc_ether.c
236 +@@ -221,7 +221,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
237 + goto bad_desc;
238 + }
239 +
240 +- if (header.usb_cdc_ether_desc) {
241 ++ if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
242 + dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize);
243 + /* because of Zaurus, we may be ignoring the host
244 + * side link address we were given.
245 +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
246 +index 49a27dc46e5e..9cf11c83993a 100644
247 +--- a/drivers/net/usb/qmi_wwan.c
248 ++++ b/drivers/net/usb/qmi_wwan.c
249 +@@ -205,6 +205,7 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
250 + return 1;
251 + }
252 + if (rawip) {
253 ++ skb_reset_mac_header(skb);
254 + skb->dev = dev->net; /* normally set by eth_type_trans */
255 + skb->protocol = proto;
256 + return 1;
257 +@@ -386,7 +387,7 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
258 + }
259 +
260 + /* errors aren't fatal - we can live with the dynamic address */
261 +- if (cdc_ether) {
262 ++ if (cdc_ether && cdc_ether->wMaxSegmentSize) {
263 + dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
264 + usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
265 + }
266 +diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
267 +index 578bd5001d93..346e48698555 100644
268 +--- a/drivers/net/vrf.c
269 ++++ b/drivers/net/vrf.c
270 +@@ -1129,7 +1129,7 @@ static int vrf_fib_rule(const struct net_device *dev, __u8 family, bool add_it)
271 + frh->family = family;
272 + frh->action = FR_ACT_TO_TBL;
273 +
274 +- if (nla_put_u32(skb, FRA_L3MDEV, 1))
275 ++ if (nla_put_u8(skb, FRA_L3MDEV, 1))
276 + goto nla_put_failure;
277 +
278 + if (nla_put_u32(skb, FRA_PRIORITY, FIB_RULE_PREF))
279 +diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
280 +index 0facc789fe7d..f8c31070a337 100644
281 +--- a/drivers/tty/serial/8250/8250_fintek.c
282 ++++ b/drivers/tty/serial/8250/8250_fintek.c
283 +@@ -54,6 +54,9 @@ static int fintek_8250_enter_key(u16 base_port, u8 key)
284 + if (!request_muxed_region(base_port, 2, "8250_fintek"))
285 + return -EBUSY;
286 +
287 ++ /* Force to deactive all SuperIO in this base_port */
288 ++ outb(EXIT_KEY, base_port + ADDR_PORT);
289 ++
290 + outb(key, base_port + ADDR_PORT);
291 + outb(key, base_port + ADDR_PORT);
292 + return 0;
293 +diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
294 +index 44e5b5bf713b..472ba3c813c1 100644
295 +--- a/drivers/tty/serial/omap-serial.c
296 ++++ b/drivers/tty/serial/omap-serial.c
297 +@@ -693,7 +693,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl)
298 + if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS))
299 + up->efr |= UART_EFR_RTS;
300 + else
301 +- up->efr &= UART_EFR_RTS;
302 ++ up->efr &= ~UART_EFR_RTS;
303 + serial_out(up, UART_EFR, up->efr);
304 + serial_out(up, UART_LCR, lcr);
305 +
306 +diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
307 +index f6c6c8adbc01..7289f0a7670b 100644
308 +--- a/fs/coda/upcall.c
309 ++++ b/fs/coda/upcall.c
310 +@@ -446,8 +446,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
311 + UPARG(CODA_FSYNC);
312 +
313 + inp->coda_fsync.VFid = *fid;
314 +- error = coda_upcall(coda_vcp(sb), sizeof(union inputArgs),
315 +- &outsize, inp);
316 ++ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
317 +
318 + CODA_FREE(inp, insize);
319 + return error;
320 +diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
321 +index dd5cb8bcefd1..eef324823311 100644
322 +--- a/fs/ocfs2/dlm/dlmrecovery.c
323 ++++ b/fs/ocfs2/dlm/dlmrecovery.c
324 +@@ -2419,6 +2419,7 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)
325 + dlm_lockres_put(res);
326 + continue;
327 + }
328 ++ dlm_move_lockres_to_recovery_list(dlm, res);
329 + } else if (res->owner == dlm->node_num) {
330 + dlm_free_dead_locks(dlm, res, dead_node);
331 + __dlm_lockres_calc_usage(dlm, res);
332 +diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
333 +index 0db6f83fdea1..05a0fb9854f9 100644
334 +--- a/fs/ocfs2/file.c
335 ++++ b/fs/ocfs2/file.c
336 +@@ -1166,6 +1166,13 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
337 + }
338 + size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE;
339 + if (size_change) {
340 ++ /*
341 ++ * Here we should wait dio to finish before inode lock
342 ++ * to avoid a deadlock between ocfs2_setattr() and
343 ++ * ocfs2_dio_end_io_write()
344 ++ */
345 ++ inode_dio_wait(inode);
346 ++
347 + status = ocfs2_rw_lock(inode, 1);
348 + if (status < 0) {
349 + mlog_errno(status);
350 +@@ -1186,8 +1193,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
351 + if (status)
352 + goto bail_unlock;
353 +
354 +- inode_dio_wait(inode);
355 +-
356 + if (i_size_read(inode) >= attr->ia_size) {
357 + if (ocfs2_should_order_data(inode)) {
358 + status = ocfs2_begin_ordered_truncate(inode,
359 +diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
360 +index 6744eb40c4ea..fff21a82780c 100644
361 +--- a/include/linux/mmzone.h
362 ++++ b/include/linux/mmzone.h
363 +@@ -672,7 +672,8 @@ typedef struct pglist_data {
364 + * is the first PFN that needs to be initialised.
365 + */
366 + unsigned long first_deferred_pfn;
367 +- unsigned long static_init_size;
368 ++ /* Number of non-deferred pages */
369 ++ unsigned long static_init_pgcnt;
370 + #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
371 +
372 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE
373 +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
374 +index 32810f279f8e..601dfa849d30 100644
375 +--- a/include/linux/skbuff.h
376 ++++ b/include/linux/skbuff.h
377 +@@ -3584,6 +3584,13 @@ static inline void nf_reset_trace(struct sk_buff *skb)
378 + #endif
379 + }
380 +
381 ++static inline void ipvs_reset(struct sk_buff *skb)
382 ++{
383 ++#if IS_ENABLED(CONFIG_IP_VS)
384 ++ skb->ipvs_property = 0;
385 ++#endif
386 ++}
387 ++
388 + /* Note: This doesn't put any conntrack and bridge info in dst. */
389 + static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
390 + bool copy)
391 +diff --git a/mm/page_alloc.c b/mm/page_alloc.c
392 +index 7064aae8ded7..4a044134ce84 100644
393 +--- a/mm/page_alloc.c
394 ++++ b/mm/page_alloc.c
395 +@@ -284,28 +284,37 @@ EXPORT_SYMBOL(nr_online_nodes);
396 + int page_group_by_mobility_disabled __read_mostly;
397 +
398 + #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
399 ++
400 ++/*
401 ++ * Determine how many pages need to be initialized durig early boot
402 ++ * (non-deferred initialization).
403 ++ * The value of first_deferred_pfn will be set later, once non-deferred pages
404 ++ * are initialized, but for now set it ULONG_MAX.
405 ++ */
406 + static inline void reset_deferred_meminit(pg_data_t *pgdat)
407 + {
408 +- unsigned long max_initialise;
409 +- unsigned long reserved_lowmem;
410 ++ phys_addr_t start_addr, end_addr;
411 ++ unsigned long max_pgcnt;
412 ++ unsigned long reserved;
413 +
414 + /*
415 + * Initialise at least 2G of a node but also take into account that
416 + * two large system hashes that can take up 1GB for 0.25TB/node.
417 + */
418 +- max_initialise = max(2UL << (30 - PAGE_SHIFT),
419 +- (pgdat->node_spanned_pages >> 8));
420 ++ max_pgcnt = max(2UL << (30 - PAGE_SHIFT),
421 ++ (pgdat->node_spanned_pages >> 8));
422 +
423 + /*
424 + * Compensate the all the memblock reservations (e.g. crash kernel)
425 + * from the initial estimation to make sure we will initialize enough
426 + * memory to boot.
427 + */
428 +- reserved_lowmem = memblock_reserved_memory_within(pgdat->node_start_pfn,
429 +- pgdat->node_start_pfn + max_initialise);
430 +- max_initialise += reserved_lowmem;
431 ++ start_addr = PFN_PHYS(pgdat->node_start_pfn);
432 ++ end_addr = PFN_PHYS(pgdat->node_start_pfn + max_pgcnt);
433 ++ reserved = memblock_reserved_memory_within(start_addr, end_addr);
434 ++ max_pgcnt += PHYS_PFN(reserved);
435 +
436 +- pgdat->static_init_size = min(max_initialise, pgdat->node_spanned_pages);
437 ++ pgdat->static_init_pgcnt = min(max_pgcnt, pgdat->node_spanned_pages);
438 + pgdat->first_deferred_pfn = ULONG_MAX;
439 + }
440 +
441 +@@ -332,7 +341,7 @@ static inline bool update_defer_init(pg_data_t *pgdat,
442 + if (zone_end < pgdat_end_pfn(pgdat))
443 + return true;
444 + (*nr_initialised)++;
445 +- if ((*nr_initialised > pgdat->static_init_size) &&
446 ++ if ((*nr_initialised > pgdat->static_init_pgcnt) &&
447 + (pfn & (PAGES_PER_SECTION - 1)) == 0) {
448 + pgdat->first_deferred_pfn = pfn;
449 + return false;
450 +diff --git a/mm/pagewalk.c b/mm/pagewalk.c
451 +index 207244489a68..d95341cffc2f 100644
452 +--- a/mm/pagewalk.c
453 ++++ b/mm/pagewalk.c
454 +@@ -142,8 +142,12 @@ static int walk_hugetlb_range(unsigned long addr, unsigned long end,
455 + do {
456 + next = hugetlb_entry_end(h, addr, end);
457 + pte = huge_pte_offset(walk->mm, addr & hmask);
458 +- if (pte && walk->hugetlb_entry)
459 ++
460 ++ if (pte)
461 + err = walk->hugetlb_entry(pte, hmask, addr, next, walk);
462 ++ else if (walk->pte_hole)
463 ++ err = walk->pte_hole(addr, next, walk);
464 ++
465 + if (err)
466 + break;
467 + } while (addr = next, addr != end);
468 +diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
469 +index 8d213f974448..4a47074d1d7f 100644
470 +--- a/net/8021q/vlan.c
471 ++++ b/net/8021q/vlan.c
472 +@@ -376,6 +376,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
473 + dev->name);
474 + vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
475 + }
476 ++ if (event == NETDEV_DOWN &&
477 ++ (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
478 ++ vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
479 +
480 + vlan_info = rtnl_dereference(dev->vlan_info);
481 + if (!vlan_info)
482 +@@ -423,9 +426,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
483 + struct net_device *tmp;
484 + LIST_HEAD(close_list);
485 +
486 +- if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)
487 +- vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
488 +-
489 + /* Put all VLANs for this dev in the down state too. */
490 + vlan_group_for_each_dev(grp, i, vlandev) {
491 + flgs = vlandev->flags;
492 +diff --git a/net/core/skbuff.c b/net/core/skbuff.c
493 +index fe008f1bd930..aec5605944d3 100644
494 +--- a/net/core/skbuff.c
495 ++++ b/net/core/skbuff.c
496 +@@ -4375,6 +4375,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
497 + if (!xnet)
498 + return;
499 +
500 ++ ipvs_reset(skb);
501 + skb_orphan(skb);
502 + skb->mark = 0;
503 + }
504 +diff --git a/net/ipv4/tcp_nv.c b/net/ipv4/tcp_nv.c
505 +index 5de82a8d4d87..e45e2c41c7bd 100644
506 +--- a/net/ipv4/tcp_nv.c
507 ++++ b/net/ipv4/tcp_nv.c
508 +@@ -263,7 +263,7 @@ static void tcpnv_acked(struct sock *sk, const struct ack_sample *sample)
509 +
510 + /* rate in 100's bits per second */
511 + rate64 = ((u64)sample->in_flight) * 8000000;
512 +- rate = (u32)div64_u64(rate64, (u64)(avg_rtt * 100));
513 ++ rate = (u32)div64_u64(rate64, (u64)(avg_rtt ?: 1) * 100);
514 +
515 + /* Remember the maximum rate seen during this RTT
516 + * Note: It may be more than one RTT. This function should be
517 +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
518 +index 566b43afe378..3d7b59ecc76c 100644
519 +--- a/net/ipv4/tcp_output.c
520 ++++ b/net/ipv4/tcp_output.c
521 +@@ -3110,13 +3110,8 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
522 + tcp_ecn_make_synack(req, th);
523 + th->source = htons(ireq->ir_num);
524 + th->dest = ireq->ir_rmt_port;
525 +- /* Setting of flags are superfluous here for callers (and ECE is
526 +- * not even correctly set)
527 +- */
528 +- tcp_init_nondata_skb(skb, tcp_rsk(req)->snt_isn,
529 +- TCPHDR_SYN | TCPHDR_ACK);
530 +-
531 +- th->seq = htonl(TCP_SKB_CB(skb)->seq);
532 ++ skb->ip_summed = CHECKSUM_PARTIAL;
533 ++ th->seq = htonl(tcp_rsk(req)->snt_isn);
534 + /* XXX data is queued and acked as is. No buffer/window check */
535 + th->ack_seq = htonl(tcp_rsk(req)->rcv_nxt);
536 +
537 +diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
538 +index a1dca3b169a1..c9fac08a53b1 100644
539 +--- a/net/netlink/af_netlink.c
540 ++++ b/net/netlink/af_netlink.c
541 +@@ -2077,7 +2077,7 @@ static int netlink_dump(struct sock *sk)
542 + struct sk_buff *skb = NULL;
543 + struct nlmsghdr *nlh;
544 + struct module *module;
545 +- int len, err = -ENOBUFS;
546 ++ int err = -ENOBUFS;
547 + int alloc_min_size;
548 + int alloc_size;
549 +
550 +@@ -2124,9 +2124,11 @@ static int netlink_dump(struct sock *sk)
551 + skb_reserve(skb, skb_tailroom(skb) - alloc_size);
552 + netlink_skb_set_owner_r(skb, sk);
553 +
554 +- len = cb->dump(skb, cb);
555 ++ if (nlk->dump_done_errno > 0)
556 ++ nlk->dump_done_errno = cb->dump(skb, cb);
557 +
558 +- if (len > 0) {
559 ++ if (nlk->dump_done_errno > 0 ||
560 ++ skb_tailroom(skb) < nlmsg_total_size(sizeof(nlk->dump_done_errno))) {
561 + mutex_unlock(nlk->cb_mutex);
562 +
563 + if (sk_filter(sk, skb))
564 +@@ -2136,13 +2138,15 @@ static int netlink_dump(struct sock *sk)
565 + return 0;
566 + }
567 +
568 +- nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE, sizeof(len), NLM_F_MULTI);
569 +- if (!nlh)
570 ++ nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE,
571 ++ sizeof(nlk->dump_done_errno), NLM_F_MULTI);
572 ++ if (WARN_ON(!nlh))
573 + goto errout_skb;
574 +
575 + nl_dump_check_consistent(cb, nlh);
576 +
577 +- memcpy(nlmsg_data(nlh), &len, sizeof(len));
578 ++ memcpy(nlmsg_data(nlh), &nlk->dump_done_errno,
579 ++ sizeof(nlk->dump_done_errno));
580 +
581 + if (sk_filter(sk, skb))
582 + kfree_skb(skb);
583 +@@ -2214,6 +2218,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
584 + }
585 +
586 + nlk->cb_running = true;
587 ++ nlk->dump_done_errno = INT_MAX;
588 +
589 + mutex_unlock(nlk->cb_mutex);
590 +
591 +diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
592 +index 4fdb38318977..bae961cfa3ad 100644
593 +--- a/net/netlink/af_netlink.h
594 ++++ b/net/netlink/af_netlink.h
595 +@@ -24,6 +24,7 @@ struct netlink_sock {
596 + wait_queue_head_t wait;
597 + bool bound;
598 + bool cb_running;
599 ++ int dump_done_errno;
600 + struct netlink_callback cb;
601 + struct mutex *cb_mutex;
602 + struct mutex cb_def_mutex;
603 +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
604 +index f7f00d012888..5d015270e454 100644
605 +--- a/net/sctp/ipv6.c
606 ++++ b/net/sctp/ipv6.c
607 +@@ -806,9 +806,10 @@ static void sctp_inet6_skb_msgname(struct sk_buff *skb, char *msgname,
608 + addr->v6.sin6_flowinfo = 0;
609 + addr->v6.sin6_port = sh->source;
610 + addr->v6.sin6_addr = ipv6_hdr(skb)->saddr;
611 +- if (ipv6_addr_type(&addr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) {
612 ++ if (ipv6_addr_type(&addr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
613 + addr->v6.sin6_scope_id = sctp_v6_skb_iif(skb);
614 +- }
615 ++ else
616 ++ addr->v6.sin6_scope_id = 0;
617 + }
618 +
619 + *addr_len = sctp_v6_addr_to_user(sctp_sk(skb->sk), addr);
620 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
621 +index ffcc8aa78db7..c062ceae19e6 100644
622 +--- a/net/sctp/socket.c
623 ++++ b/net/sctp/socket.c
624 +@@ -4764,6 +4764,10 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
625 + struct socket *sock;
626 + int err = 0;
627 +
628 ++ /* Do not peel off from one netns to another one. */
629 ++ if (!net_eq(current->nsproxy->net_ns, sock_net(sk)))
630 ++ return -EINVAL;
631 ++
632 + if (!asoc)
633 + return -EINVAL;
634 +
635 +diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
636 +index 097459830454..6830d2427e47 100644
637 +--- a/security/integrity/ima/ima_appraise.c
638 ++++ b/security/integrity/ima/ima_appraise.c
639 +@@ -303,6 +303,9 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file)
640 + if (iint->flags & IMA_DIGSIG)
641 + return;
642 +
643 ++ if (iint->ima_file_status != INTEGRITY_PASS)
644 ++ return;
645 ++
646 + rc = ima_collect_measurement(iint, file, NULL, 0, ima_hash_algo);
647 + if (rc < 0)
648 + return;