Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Wed, 13 Jun 2018 15:03:10
Message-Id: 1528902166.2e916889b538b51d72a16eb1b7a17fe2cc9078ea.mpagano@gentoo
1 commit: 2e916889b538b51d72a16eb1b7a17fe2cc9078ea
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 13 15:02:46 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 13 15:02:46 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=2e916889
7
8 Linux patch 4.9.108
9
10 0000_README | 4 +
11 1107_linux-4.9.108.patch | 775 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 779 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 5798d3a..b2d28d0 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -471,6 +471,10 @@ Patch: 1106_linux-4.9.107.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.9.107
21
22 +Patch: 1107_linux-4.9.108.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.9.108
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/1107_linux-4.9.108.patch b/1107_linux-4.9.108.patch
31 new file mode 100644
32 index 0000000..f710a0f
33 --- /dev/null
34 +++ b/1107_linux-4.9.108.patch
35 @@ -0,0 +1,775 @@
36 +diff --git a/Documentation/networking/netdev-FAQ.txt b/Documentation/networking/netdev-FAQ.txt
37 +index a20b2fae942b..56af008e9258 100644
38 +--- a/Documentation/networking/netdev-FAQ.txt
39 ++++ b/Documentation/networking/netdev-FAQ.txt
40 +@@ -168,6 +168,15 @@ A: No. See above answer. In short, if you think it really belongs in
41 + dash marker line as described in Documentation/SubmittingPatches to
42 + temporarily embed that information into the patch that you send.
43 +
44 ++Q: Are all networking bug fixes backported to all stable releases?
45 ++
46 ++A: Due to capacity, Dave could only take care of the backports for the last
47 ++ 2 stable releases. For earlier stable releases, each stable branch maintainer
48 ++ is supposed to take care of them. If you find any patch is missing from an
49 ++ earlier stable branch, please notify stable@×××××××××××.org with either a
50 ++ commit ID or a formal patch backported, and CC Dave and other relevant
51 ++ networking developers.
52 ++
53 + Q: Someone said that the comment style and coding convention is different
54 + for the networking content. Is this true?
55 +
56 +diff --git a/Makefile b/Makefile
57 +index ac30e448e0a5..1fa9daf219c4 100644
58 +--- a/Makefile
59 ++++ b/Makefile
60 +@@ -1,6 +1,6 @@
61 + VERSION = 4
62 + PATCHLEVEL = 9
63 +-SUBLEVEL = 107
64 ++SUBLEVEL = 108
65 + EXTRAVERSION =
66 + NAME = Roaring Lionus
67 +
68 +diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
69 +index 4ef267fb635a..e783a5daaab2 100644
70 +--- a/arch/x86/kernel/vmlinux.lds.S
71 ++++ b/arch/x86/kernel/vmlinux.lds.S
72 +@@ -352,8 +352,6 @@ SECTIONS
73 + DISCARDS
74 + /DISCARD/ : {
75 + *(.eh_frame)
76 +- *(__func_stack_frame_non_standard)
77 +- *(__unreachable)
78 + }
79 + }
80 +
81 +diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
82 +index c38369781239..8a841b9d8f84 100644
83 +--- a/arch/x86/kvm/cpuid.h
84 ++++ b/arch/x86/kvm/cpuid.h
85 +@@ -179,7 +179,7 @@ static inline bool guest_cpuid_has_spec_ctrl(struct kvm_vcpu *vcpu)
86 + if (best && (best->ebx & bit(X86_FEATURE_AMD_IBRS)))
87 + return true;
88 + best = kvm_find_cpuid_entry(vcpu, 7, 0);
89 +- return best && (best->edx & (bit(X86_FEATURE_SPEC_CTRL) | bit(X86_FEATURE_SSBD)));
90 ++ return best && (best->edx & (bit(X86_FEATURE_SPEC_CTRL) | bit(X86_FEATURE_SPEC_CTRL_SSBD)));
91 + }
92 +
93 + static inline bool guest_cpuid_has_arch_capabilities(struct kvm_vcpu *vcpu)
94 +diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
95 +index 9ff853229957..8d097d10fd13 100644
96 +--- a/drivers/char/tpm/tpm-chip.c
97 ++++ b/drivers/char/tpm/tpm-chip.c
98 +@@ -26,6 +26,7 @@
99 + #include <linux/spinlock.h>
100 + #include <linux/freezer.h>
101 + #include <linux/major.h>
102 ++#include <linux/of.h>
103 + #include "tpm.h"
104 + #include "tpm_eventlog.h"
105 +
106 +@@ -388,8 +389,20 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip)
107 + */
108 + int tpm_chip_register(struct tpm_chip *chip)
109 + {
110 ++#ifdef CONFIG_OF
111 ++ struct device_node *np;
112 ++#endif
113 + int rc;
114 +
115 ++#ifdef CONFIG_OF
116 ++ np = of_find_node_by_name(NULL, "vtpm");
117 ++ if (np) {
118 ++ if (of_property_read_bool(np, "powered-while-suspended"))
119 ++ chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED;
120 ++ }
121 ++ of_node_put(np);
122 ++#endif
123 ++
124 + if (chip->ops->flags & TPM_OPS_AUTO_STARTUP) {
125 + if (chip->flags & TPM_CHIP_FLAG_TPM2)
126 + rc = tpm2_auto_startup(chip);
127 +diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
128 +index 830d7e30e508..faf2db122ab9 100644
129 +--- a/drivers/char/tpm/tpm-interface.c
130 ++++ b/drivers/char/tpm/tpm-interface.c
131 +@@ -803,6 +803,10 @@ int tpm_do_selftest(struct tpm_chip *chip)
132 + loops = jiffies_to_msecs(duration) / delay_msec;
133 +
134 + rc = tpm_continue_selftest(chip);
135 ++ if (rc == TPM_ERR_INVALID_POSTINIT) {
136 ++ chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED;
137 ++ dev_info(&chip->dev, "TPM not ready (%d)\n", rc);
138 ++ }
139 + /* This may fail if there was no TPM driver during a suspend/resume
140 + * cycle; some may return 10 (BAD_ORDINAL), others 28 (FAILEDSELFTEST)
141 + */
142 +@@ -969,6 +973,9 @@ int tpm_pm_suspend(struct device *dev)
143 + if (chip == NULL)
144 + return -ENODEV;
145 +
146 ++ if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED)
147 ++ return 0;
148 ++
149 + if (chip->flags & TPM_CHIP_FLAG_TPM2) {
150 + tpm2_shutdown(chip, TPM2_SU_STATE);
151 + return 0;
152 +diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
153 +index aa4299cf7e5a..a4fc2badf633 100644
154 +--- a/drivers/char/tpm/tpm.h
155 ++++ b/drivers/char/tpm/tpm.h
156 +@@ -143,6 +143,7 @@ enum tpm_chip_flags {
157 + TPM_CHIP_FLAG_TPM2 = BIT(1),
158 + TPM_CHIP_FLAG_IRQ = BIT(2),
159 + TPM_CHIP_FLAG_VIRTUAL = BIT(3),
160 ++ TPM_CHIP_FLAG_ALWAYS_POWERED = BIT(5),
161 + };
162 +
163 + struct tpm_chip {
164 +diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
165 +index f5815e1a4390..c37b7b5f1dd3 100644
166 +--- a/drivers/gpu/drm/drm_fops.c
167 ++++ b/drivers/gpu/drm/drm_fops.c
168 +@@ -198,6 +198,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
169 + return -ENOMEM;
170 +
171 + filp->private_data = priv;
172 ++ filp->f_mode |= FMODE_UNSIGNED_OFFSET;
173 + priv->filp = filp;
174 + priv->pid = get_pid(task_pid(current));
175 + priv->minor = minor;
176 +diff --git a/drivers/isdn/hardware/eicon/diva.c b/drivers/isdn/hardware/eicon/diva.c
177 +index d91dd580e978..37aaea88a6ad 100644
178 +--- a/drivers/isdn/hardware/eicon/diva.c
179 ++++ b/drivers/isdn/hardware/eicon/diva.c
180 +@@ -387,10 +387,10 @@ void divasa_xdi_driver_unload(void)
181 + ** Receive and process command from user mode utility
182 + */
183 + void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
184 +- int length,
185 ++ int length, void *mptr,
186 + divas_xdi_copy_from_user_fn_t cp_fn)
187 + {
188 +- diva_xdi_um_cfg_cmd_t msg;
189 ++ diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
190 + diva_os_xdi_adapter_t *a = NULL;
191 + diva_os_spin_lock_magic_t old_irql;
192 + struct list_head *tmp;
193 +@@ -400,21 +400,21 @@ void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
194 + length, sizeof(diva_xdi_um_cfg_cmd_t)))
195 + return NULL;
196 + }
197 +- if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
198 ++ if ((*cp_fn) (os_handle, msg, src, sizeof(*msg)) <= 0) {
199 + DBG_ERR(("A: A(?) open, write error"))
200 + return NULL;
201 + }
202 + diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
203 + list_for_each(tmp, &adapter_queue) {
204 + a = list_entry(tmp, diva_os_xdi_adapter_t, link);
205 +- if (a->controller == (int)msg.adapter)
206 ++ if (a->controller == (int)msg->adapter)
207 + break;
208 + a = NULL;
209 + }
210 + diva_os_leave_spin_lock(&adapter_lock, &old_irql, "open_adapter");
211 +
212 + if (!a) {
213 +- DBG_ERR(("A: A(%d) open, adapter not found", msg.adapter))
214 ++ DBG_ERR(("A: A(%d) open, adapter not found", msg->adapter))
215 + }
216 +
217 + return (a);
218 +@@ -436,8 +436,10 @@ void diva_xdi_close_adapter(void *adapter, void *os_handle)
219 +
220 + int
221 + diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
222 +- int length, divas_xdi_copy_from_user_fn_t cp_fn)
223 ++ int length, void *mptr,
224 ++ divas_xdi_copy_from_user_fn_t cp_fn)
225 + {
226 ++ diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
227 + diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
228 + void *data;
229 +
230 +@@ -458,7 +460,13 @@ diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
231 + return (-2);
232 + }
233 +
234 +- length = (*cp_fn) (os_handle, data, src, length);
235 ++ if (msg) {
236 ++ *(diva_xdi_um_cfg_cmd_t *)data = *msg;
237 ++ length = (*cp_fn) (os_handle, (char *)data + sizeof(*msg),
238 ++ src + sizeof(*msg), length - sizeof(*msg));
239 ++ } else {
240 ++ length = (*cp_fn) (os_handle, data, src, length);
241 ++ }
242 + if (length > 0) {
243 + if ((*(a->interface.cmd_proc))
244 + (a, (diva_xdi_um_cfg_cmd_t *) data, length)) {
245 +diff --git a/drivers/isdn/hardware/eicon/diva.h b/drivers/isdn/hardware/eicon/diva.h
246 +index e979085d1b89..a0a607c0c32e 100644
247 +--- a/drivers/isdn/hardware/eicon/diva.h
248 ++++ b/drivers/isdn/hardware/eicon/diva.h
249 +@@ -19,10 +19,11 @@ int diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
250 + int max_length, divas_xdi_copy_to_user_fn_t cp_fn);
251 +
252 + int diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
253 +- int length, divas_xdi_copy_from_user_fn_t cp_fn);
254 ++ int length, void *msg,
255 ++ divas_xdi_copy_from_user_fn_t cp_fn);
256 +
257 + void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
258 +- int length,
259 ++ int length, void *msg,
260 + divas_xdi_copy_from_user_fn_t cp_fn);
261 +
262 + void diva_xdi_close_adapter(void *adapter, void *os_handle);
263 +diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
264 +index 32f34511c416..1e8b9918bfce 100644
265 +--- a/drivers/isdn/hardware/eicon/divasmain.c
266 ++++ b/drivers/isdn/hardware/eicon/divasmain.c
267 +@@ -591,19 +591,22 @@ static int divas_release(struct inode *inode, struct file *file)
268 + static ssize_t divas_write(struct file *file, const char __user *buf,
269 + size_t count, loff_t *ppos)
270 + {
271 ++ diva_xdi_um_cfg_cmd_t msg;
272 + int ret = -EINVAL;
273 +
274 + if (!file->private_data) {
275 + file->private_data = diva_xdi_open_adapter(file, buf,
276 +- count,
277 ++ count, &msg,
278 + xdi_copy_from_user);
279 +- }
280 +- if (!file->private_data) {
281 +- return (-ENODEV);
282 ++ if (!file->private_data)
283 ++ return (-ENODEV);
284 ++ ret = diva_xdi_write(file->private_data, file,
285 ++ buf, count, &msg, xdi_copy_from_user);
286 ++ } else {
287 ++ ret = diva_xdi_write(file->private_data, file,
288 ++ buf, count, NULL, xdi_copy_from_user);
289 + }
290 +
291 +- ret = diva_xdi_write(file->private_data, file,
292 +- buf, count, xdi_copy_from_user);
293 + switch (ret) {
294 + case -1: /* Message should be removed from rx mailbox first */
295 + ret = -EBUSY;
296 +@@ -622,11 +625,12 @@ static ssize_t divas_write(struct file *file, const char __user *buf,
297 + static ssize_t divas_read(struct file *file, char __user *buf,
298 + size_t count, loff_t *ppos)
299 + {
300 ++ diva_xdi_um_cfg_cmd_t msg;
301 + int ret = -EINVAL;
302 +
303 + if (!file->private_data) {
304 + file->private_data = diva_xdi_open_adapter(file, buf,
305 +- count,
306 ++ count, &msg,
307 + xdi_copy_from_user);
308 + }
309 + if (!file->private_data) {
310 +diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
311 +index 3ec647e8b9c6..35fd57fdeba9 100644
312 +--- a/drivers/md/dm-bufio.c
313 ++++ b/drivers/md/dm-bufio.c
314 +@@ -373,9 +373,6 @@ static void __cache_size_refresh(void)
315 + static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
316 + enum data_mode *data_mode)
317 + {
318 +- unsigned noio_flag;
319 +- void *ptr;
320 +-
321 + if (c->block_size <= DM_BUFIO_BLOCK_SIZE_SLAB_LIMIT) {
322 + *data_mode = DATA_MODE_SLAB;
323 + return kmem_cache_alloc(DM_BUFIO_CACHE(c), gfp_mask);
324 +@@ -399,16 +396,16 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
325 + * all allocations done by this process (including pagetables) are done
326 + * as if GFP_NOIO was specified.
327 + */
328 ++ if (gfp_mask & __GFP_NORETRY) {
329 ++ unsigned noio_flag = memalloc_noio_save();
330 ++ void *ptr = __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM,
331 ++ PAGE_KERNEL);
332 +
333 +- if (gfp_mask & __GFP_NORETRY)
334 +- noio_flag = memalloc_noio_save();
335 +-
336 +- ptr = __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM, PAGE_KERNEL);
337 +-
338 +- if (gfp_mask & __GFP_NORETRY)
339 + memalloc_noio_restore(noio_flag);
340 ++ return ptr;
341 ++ }
342 +
343 +- return ptr;
344 ++ return __vmalloc(c->block_size, gfp_mask | __GFP_HIGHMEM, PAGE_KERNEL);
345 + }
346 +
347 + /*
348 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
349 +index 1fb80100e5e7..912900db935f 100644
350 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
351 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
352 +@@ -594,7 +594,7 @@ static void bnx2x_ets_e3b0_nig_disabled(const struct link_params *params,
353 + * slots for the highest priority.
354 + */
355 + REG_WR(bp, (port) ? NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS :
356 +- NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
357 ++ NIG_REG_P0_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
358 + /* Mapping between the CREDIT_WEIGHT registers and actual client
359 + * numbers
360 + */
361 +diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
362 +index dda63b26e370..99f593be26e2 100644
363 +--- a/drivers/net/ethernet/cisco/enic/enic_main.c
364 ++++ b/drivers/net/ethernet/cisco/enic/enic_main.c
365 +@@ -2541,11 +2541,11 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
366 + pci_set_master(pdev);
367 +
368 + /* Query PCI controller on system for DMA addressing
369 +- * limitation for the device. Try 64-bit first, and
370 ++ * limitation for the device. Try 47-bit first, and
371 + * fail to 32-bit.
372 + */
373 +
374 +- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
375 ++ err = pci_set_dma_mask(pdev, DMA_BIT_MASK(47));
376 + if (err) {
377 + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
378 + if (err) {
379 +@@ -2559,10 +2559,10 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
380 + goto err_out_release_regions;
381 + }
382 + } else {
383 +- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
384 ++ err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(47));
385 + if (err) {
386 + dev_err(dev, "Unable to obtain %u-bit DMA "
387 +- "for consistent allocations, aborting\n", 64);
388 ++ "for consistent allocations, aborting\n", 47);
389 + goto err_out_release_regions;
390 + }
391 + using_dac = 1;
392 +diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c
393 +index 474ff36b9755..71578d48efbc 100644
394 +--- a/drivers/net/ethernet/mellanox/mlx4/qp.c
395 ++++ b/drivers/net/ethernet/mellanox/mlx4/qp.c
396 +@@ -392,11 +392,11 @@ struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
397 + struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table;
398 + struct mlx4_qp *qp;
399 +
400 +- spin_lock(&qp_table->lock);
401 ++ spin_lock_irq(&qp_table->lock);
402 +
403 + qp = __mlx4_qp_lookup(dev, qpn);
404 +
405 +- spin_unlock(&qp_table->lock);
406 ++ spin_unlock_irq(&qp_table->lock);
407 + return qp;
408 + }
409 +
410 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
411 +index 457e30427535..f1956c4d02a0 100644
412 +--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
413 ++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
414 +@@ -54,7 +54,7 @@
415 + #define ILT_CFG_REG(cli, reg) PSWRQ2_REG_ ## cli ## _ ## reg ## _RT_OFFSET
416 +
417 + /* ILT entry structure */
418 +-#define ILT_ENTRY_PHY_ADDR_MASK 0x000FFFFFFFFFFFULL
419 ++#define ILT_ENTRY_PHY_ADDR_MASK (~0ULL >> 12)
420 + #define ILT_ENTRY_PHY_ADDR_SHIFT 0
421 + #define ILT_ENTRY_VALID_MASK 0x1ULL
422 + #define ILT_ENTRY_VALID_SHIFT 52
423 +diff --git a/drivers/net/phy/bcm-cygnus.c b/drivers/net/phy/bcm-cygnus.c
424 +index 49bbc6826883..9a7dca2bb618 100644
425 +--- a/drivers/net/phy/bcm-cygnus.c
426 ++++ b/drivers/net/phy/bcm-cygnus.c
427 +@@ -61,17 +61,17 @@ static int bcm_cygnus_afe_config(struct phy_device *phydev)
428 + return rc;
429 +
430 + /* make rcal=100, since rdb default is 000 */
431 +- rc = bcm_phy_write_exp(phydev, MII_BRCM_CORE_EXPB1, 0x10);
432 ++ rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB1, 0x10);
433 + if (rc < 0)
434 + return rc;
435 +
436 + /* CORE_EXPB0, Reset R_CAL/RC_CAL Engine */
437 +- rc = bcm_phy_write_exp(phydev, MII_BRCM_CORE_EXPB0, 0x10);
438 ++ rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x10);
439 + if (rc < 0)
440 + return rc;
441 +
442 + /* CORE_EXPB0, Disable Reset R_CAL/RC_CAL Engine */
443 +- rc = bcm_phy_write_exp(phydev, MII_BRCM_CORE_EXPB0, 0x00);
444 ++ rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x00);
445 +
446 + return 0;
447 + }
448 +diff --git a/drivers/net/phy/bcm-phy-lib.h b/drivers/net/phy/bcm-phy-lib.h
449 +index b2091c88b44d..ce16b26d49ff 100644
450 +--- a/drivers/net/phy/bcm-phy-lib.h
451 ++++ b/drivers/net/phy/bcm-phy-lib.h
452 +@@ -14,11 +14,18 @@
453 + #ifndef _LINUX_BCM_PHY_LIB_H
454 + #define _LINUX_BCM_PHY_LIB_H
455 +
456 ++#include <linux/brcmphy.h>
457 + #include <linux/phy.h>
458 +
459 + int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val);
460 + int bcm_phy_read_exp(struct phy_device *phydev, u16 reg);
461 +
462 ++static inline int bcm_phy_write_exp_sel(struct phy_device *phydev,
463 ++ u16 reg, u16 val)
464 ++{
465 ++ return bcm_phy_write_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER, val);
466 ++}
467 ++
468 + int bcm_phy_write_misc(struct phy_device *phydev,
469 + u16 reg, u16 chl, u16 value);
470 + int bcm_phy_read_misc(struct phy_device *phydev,
471 +diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
472 +index 9636da0b6efc..caff474d2ee2 100644
473 +--- a/drivers/net/phy/bcm7xxx.c
474 ++++ b/drivers/net/phy/bcm7xxx.c
475 +@@ -48,10 +48,10 @@
476 + static void r_rc_cal_reset(struct phy_device *phydev)
477 + {
478 + /* Reset R_CAL/RC_CAL Engine */
479 +- bcm_phy_write_exp(phydev, 0x00b0, 0x0010);
480 ++ bcm_phy_write_exp_sel(phydev, 0x00b0, 0x0010);
481 +
482 + /* Disable Reset R_AL/RC_CAL Engine */
483 +- bcm_phy_write_exp(phydev, 0x00b0, 0x0000);
484 ++ bcm_phy_write_exp_sel(phydev, 0x00b0, 0x0000);
485 + }
486 +
487 + static int bcm7xxx_28nm_b0_afe_config_init(struct phy_device *phydev)
488 +diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
489 +index 36963685d42a..f9ec00981b1e 100644
490 +--- a/drivers/net/team/team.c
491 ++++ b/drivers/net/team/team.c
492 +@@ -1004,7 +1004,8 @@ static void team_port_disable(struct team *team,
493 + static void ___team_compute_features(struct team *team)
494 + {
495 + struct team_port *port;
496 +- u32 vlan_features = TEAM_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL;
497 ++ netdev_features_t vlan_features = TEAM_VLAN_FEATURES &
498 ++ NETIF_F_ALL_FOR_ALL;
499 + netdev_features_t enc_features = TEAM_ENC_FEATURES;
500 + unsigned short max_hard_header_len = ETH_HLEN;
501 + unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
502 +diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
503 +index 3a98f3762a4c..4c8baba72933 100644
504 +--- a/drivers/net/usb/cdc_mbim.c
505 ++++ b/drivers/net/usb/cdc_mbim.c
506 +@@ -608,7 +608,7 @@ static const struct driver_info cdc_mbim_info_ndp_to_end = {
507 + */
508 + static const struct driver_info cdc_mbim_info_avoid_altsetting_toggle = {
509 + .description = "CDC MBIM",
510 +- .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN,
511 ++ .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN | FLAG_SEND_ZLP,
512 + .bind = cdc_mbim_bind,
513 + .unbind = cdc_mbim_unbind,
514 + .manage_power = cdc_mbim_manage_power,
515 +diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
516 +index fce49ebc575d..c81bc4efe1a6 100644
517 +--- a/drivers/vhost/vhost.c
518 ++++ b/drivers/vhost/vhost.c
519 +@@ -938,6 +938,7 @@ int vhost_process_iotlb_msg(struct vhost_dev *dev,
520 + {
521 + int ret = 0;
522 +
523 ++ mutex_lock(&dev->mutex);
524 + vhost_dev_lock_vqs(dev);
525 + switch (msg->type) {
526 + case VHOST_IOTLB_UPDATE:
527 +@@ -967,6 +968,8 @@ int vhost_process_iotlb_msg(struct vhost_dev *dev,
528 + }
529 +
530 + vhost_dev_unlock_vqs(dev);
531 ++ mutex_unlock(&dev->mutex);
532 ++
533 + return ret;
534 + }
535 + ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
536 +diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
537 +index c5eafcdb3664..92f3b231d5a2 100644
538 +--- a/fs/btrfs/disk-io.c
539 ++++ b/fs/btrfs/disk-io.c
540 +@@ -59,7 +59,8 @@
541 + BTRFS_HEADER_FLAG_RELOC |\
542 + BTRFS_SUPER_FLAG_ERROR |\
543 + BTRFS_SUPER_FLAG_SEEDING |\
544 +- BTRFS_SUPER_FLAG_METADUMP)
545 ++ BTRFS_SUPER_FLAG_METADUMP |\
546 ++ BTRFS_SUPER_FLAG_METADUMP_V2)
547 +
548 + static const struct extent_io_ops btree_extent_io_ops;
549 + static void end_workqueue_fn(struct btrfs_work *work);
550 +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
551 +index 2214b2f9c73c..ad793c69cc46 100644
552 +--- a/include/linux/compiler-gcc.h
553 ++++ b/include/linux/compiler-gcc.h
554 +@@ -206,7 +206,7 @@
555 + #ifdef CONFIG_STACK_VALIDATION
556 + #define annotate_unreachable() ({ \
557 + asm("1:\t\n" \
558 +- ".pushsection __unreachable, \"a\"\t\n" \
559 ++ ".pushsection .discard.unreachable\t\n" \
560 + ".long 1b\t\n" \
561 + ".popsection\t\n"); \
562 + })
563 +diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
564 +index d5ad15a106a7..c794c9af6c0f 100644
565 +--- a/include/uapi/linux/btrfs_tree.h
566 ++++ b/include/uapi/linux/btrfs_tree.h
567 +@@ -452,6 +452,7 @@ struct btrfs_free_space_header {
568 +
569 + #define BTRFS_SUPER_FLAG_SEEDING (1ULL << 32)
570 + #define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
571 ++#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
572 +
573 +
574 + /*
575 +diff --git a/mm/mmap.c b/mm/mmap.c
576 +index 45ac5b973459..aa97074a4a99 100644
577 +--- a/mm/mmap.c
578 ++++ b/mm/mmap.c
579 +@@ -1312,6 +1312,35 @@ static inline int mlock_future_check(struct mm_struct *mm,
580 + return 0;
581 + }
582 +
583 ++static inline u64 file_mmap_size_max(struct file *file, struct inode *inode)
584 ++{
585 ++ if (S_ISREG(inode->i_mode))
586 ++ return MAX_LFS_FILESIZE;
587 ++
588 ++ if (S_ISBLK(inode->i_mode))
589 ++ return MAX_LFS_FILESIZE;
590 ++
591 ++ /* Special "we do even unsigned file positions" case */
592 ++ if (file->f_mode & FMODE_UNSIGNED_OFFSET)
593 ++ return 0;
594 ++
595 ++ /* Yes, random drivers might want more. But I'm tired of buggy drivers */
596 ++ return ULONG_MAX;
597 ++}
598 ++
599 ++static inline bool file_mmap_ok(struct file *file, struct inode *inode,
600 ++ unsigned long pgoff, unsigned long len)
601 ++{
602 ++ u64 maxsize = file_mmap_size_max(file, inode);
603 ++
604 ++ if (maxsize && len > maxsize)
605 ++ return false;
606 ++ maxsize -= len;
607 ++ if (pgoff > maxsize >> PAGE_SHIFT)
608 ++ return false;
609 ++ return true;
610 ++}
611 ++
612 + /*
613 + * The caller must hold down_write(&current->mm->mmap_sem).
614 + */
615 +@@ -1384,6 +1413,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
616 + if (file) {
617 + struct inode *inode = file_inode(file);
618 +
619 ++ if (!file_mmap_ok(file, inode, pgoff, len))
620 ++ return -EOVERFLOW;
621 ++
622 + switch (flags & MAP_TYPE) {
623 + case MAP_SHARED:
624 + if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE))
625 +diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
626 +index c2339b865164..f3a0ad14b454 100644
627 +--- a/net/core/rtnetlink.c
628 ++++ b/net/core/rtnetlink.c
629 +@@ -1914,6 +1914,10 @@ static int do_setlink(const struct sk_buff *skb,
630 + const struct net_device_ops *ops = dev->netdev_ops;
631 + int err;
632 +
633 ++ err = validate_linkmsg(dev, tb);
634 ++ if (err < 0)
635 ++ return err;
636 ++
637 + if (tb[IFLA_NET_NS_PID] || tb[IFLA_NET_NS_FD]) {
638 + struct net *net = rtnl_link_get_net(dev_net(dev), tb);
639 + if (IS_ERR(net)) {
640 +@@ -2234,10 +2238,6 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
641 + goto errout;
642 + }
643 +
644 +- err = validate_linkmsg(dev, tb);
645 +- if (err < 0)
646 +- goto errout;
647 +-
648 + err = do_setlink(skb, dev, ifm, tb, ifname, 0);
649 + errout:
650 + return err;
651 +diff --git a/net/dccp/proto.c b/net/dccp/proto.c
652 +index ff3b058cf58c..936dab12f99f 100644
653 +--- a/net/dccp/proto.c
654 ++++ b/net/dccp/proto.c
655 +@@ -280,9 +280,7 @@ int dccp_disconnect(struct sock *sk, int flags)
656 +
657 + dccp_clear_xmit_timers(sk);
658 + ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
659 +- ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
660 + dp->dccps_hc_rx_ccid = NULL;
661 +- dp->dccps_hc_tx_ccid = NULL;
662 +
663 + __skb_queue_purge(&sk->sk_receive_queue);
664 + __skb_queue_purge(&sk->sk_write_queue);
665 +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
666 +index e1be24416c0e..d476b7950adf 100644
667 +--- a/net/ipv4/fib_semantics.c
668 ++++ b/net/ipv4/fib_semantics.c
669 +@@ -979,6 +979,8 @@ fib_convert_metrics(struct fib_info *fi, const struct fib_config *cfg)
670 + if (val == TCP_CA_UNSPEC)
671 + return -EINVAL;
672 + } else {
673 ++ if (nla_len(nla) != sizeof(u32))
674 ++ return false;
675 + val = nla_get_u32(nla);
676 + }
677 + if (type == RTAX_ADVMSS && val > 65535 - 40)
678 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
679 +index 5ddd64995e73..dd80276a8205 100644
680 +--- a/net/ipv4/ip_sockglue.c
681 ++++ b/net/ipv4/ip_sockglue.c
682 +@@ -503,8 +503,6 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
683 + int err;
684 + int copied;
685 +
686 +- WARN_ON_ONCE(sk->sk_family == AF_INET6);
687 +-
688 + err = -EAGAIN;
689 + skb = sock_dequeue_err_skb(sk);
690 + if (!skb)
691 +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
692 +index e8560031a0be..eb9046eae581 100644
693 +--- a/net/ipv6/ip6_output.c
694 ++++ b/net/ipv6/ip6_output.c
695 +@@ -487,7 +487,8 @@ int ip6_forward(struct sk_buff *skb)
696 + send redirects to source routed frames.
697 + We don't send redirects to frames decapsulated from IPsec.
698 + */
699 +- if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) {
700 ++ if (IP6CB(skb)->iif == dst->dev->ifindex &&
701 ++ opt->srcrt == 0 && !skb_sec_path(skb)) {
702 + struct in6_addr *target = NULL;
703 + struct inet_peer *peer;
704 + struct rt6_info *rt;
705 +diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
706 +index a30e7e925c9b..4b93ad4fe6d8 100644
707 +--- a/net/ipv6/ip6mr.c
708 ++++ b/net/ipv6/ip6mr.c
709 +@@ -1789,7 +1789,8 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
710 + ret = 0;
711 + if (!ip6mr_new_table(net, v))
712 + ret = -ENOMEM;
713 +- raw6_sk(sk)->ip6mr_table = v;
714 ++ else
715 ++ raw6_sk(sk)->ip6mr_table = v;
716 + rtnl_unlock();
717 + return ret;
718 + }
719 +diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
720 +index 3fe80e104b58..21f3bf2125f4 100644
721 +--- a/net/ipv6/ndisc.c
722 ++++ b/net/ipv6/ndisc.c
723 +@@ -1538,6 +1538,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
724 + ops_data_buf[NDISC_OPS_REDIRECT_DATA_SPACE], *ops_data = NULL;
725 + bool ret;
726 +
727 ++ if (netif_is_l3_master(skb->dev)) {
728 ++ dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif);
729 ++ if (!dev)
730 ++ return;
731 ++ }
732 ++
733 + if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) {
734 + ND_PRINTK(2, warn, "Redirect: no link-local address on %s\n",
735 + dev->name);
736 +diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
737 +index cc306defcc19..553d0ad4a2fa 100644
738 +--- a/net/kcm/kcmsock.c
739 ++++ b/net/kcm/kcmsock.c
740 +@@ -1671,7 +1671,7 @@ static struct file *kcm_clone(struct socket *osock)
741 + __module_get(newsock->ops->owner);
742 +
743 + newsk = sk_alloc(sock_net(osock->sk), PF_KCM, GFP_KERNEL,
744 +- &kcm_proto, true);
745 ++ &kcm_proto, false);
746 + if (!newsk) {
747 + sock_release(newsock);
748 + return ERR_PTR(-ENOMEM);
749 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
750 +index b2b50756263b..2c4a47f29f36 100644
751 +--- a/net/packet/af_packet.c
752 ++++ b/net/packet/af_packet.c
753 +@@ -2918,7 +2918,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
754 + if (unlikely(offset < 0))
755 + goto out_free;
756 + } else if (reserve) {
757 +- skb_push(skb, reserve);
758 ++ skb_reserve(skb, -reserve);
759 + }
760 +
761 + /* Returns -EFAULT on error */
762 +@@ -4299,7 +4299,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
763 + goto out;
764 + if (po->tp_version >= TPACKET_V3 &&
765 + req->tp_block_size <=
766 +- BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv))
767 ++ BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv) + sizeof(struct tpacket3_hdr))
768 + goto out;
769 + if (unlikely(req->tp_frame_size < po->tp_hdrlen +
770 + po->tp_reserve))
771 +diff --git a/net/sctp/transport.c b/net/sctp/transport.c
772 +index ce54dce13ddb..03d71cd97ec0 100644
773 +--- a/net/sctp/transport.c
774 ++++ b/net/sctp/transport.c
775 +@@ -608,7 +608,7 @@ unsigned long sctp_transport_timeout(struct sctp_transport *trans)
776 + trans->state != SCTP_PF)
777 + timeout += trans->hbinterval;
778 +
779 +- return timeout;
780 ++ return max_t(unsigned long, timeout, HZ / 5);
781 + }
782 +
783 + /* Reset transport variables to their initial values */
784 +diff --git a/scripts/Makefile.build b/scripts/Makefile.build
785 +index 7675d11ee65e..abfd4f4b66dd 100644
786 +--- a/scripts/Makefile.build
787 ++++ b/scripts/Makefile.build
788 +@@ -253,6 +253,9 @@ objtool_args = check
789 + ifndef CONFIG_FRAME_POINTER
790 + objtool_args += --no-fp
791 + endif
792 ++ifdef CONFIG_GCOV_KERNEL
793 ++objtool_args += --no-unreachable
794 ++endif
795 +
796 + # 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
797 + # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
798 +diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
799 +index 297b079ae4d9..27aac273205b 100644
800 +--- a/scripts/kconfig/confdata.c
801 ++++ b/scripts/kconfig/confdata.c
802 +@@ -745,7 +745,7 @@ int conf_write(const char *name)
803 + struct menu *menu;
804 + const char *basename;
805 + const char *str;
806 +- char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
807 ++ char dirname[PATH_MAX+1], tmpname[PATH_MAX+22], newname[PATH_MAX+8];
808 + char *env;
809 +
810 + dirname[0] = 0;