Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Tue, 30 Mar 2021 14:17:43
Message-Id: 1617113849.b8333a8735d3dfe948c35ef9664ea592d0a3d659.mpagano@gentoo
1 commit: b8333a8735d3dfe948c35ef9664ea592d0a3d659
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 30 14:17:29 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 30 14:17:29 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b8333a87
7
8 Linux patch 4.19.184
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1183_linux-4.19.184.patch | 2060 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2064 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index d06c180..51936a2 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -771,6 +771,10 @@ Patch: 1182_linux-4.19.183.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.183
23
24 +Patch: 1183_linux-4.19.184.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.184
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1183_linux-4.19.184.patch b/1183_linux-4.19.184.patch
33 new file mode 100644
34 index 0000000..ad28fd3
35 --- /dev/null
36 +++ b/1183_linux-4.19.184.patch
37 @@ -0,0 +1,2060 @@
38 +diff --git a/Makefile b/Makefile
39 +index 9347445b2027b..8a3821f74b54e 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 183
47 ++SUBLEVEL = 184
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
52 +index cf0087b4c9e18..ea02a51c71e23 100644
53 +--- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
54 ++++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
55 +@@ -67,8 +67,8 @@
56 + pinctrl-0 = <&pinctrl_macb0_default>;
57 + phy-mode = "rmii";
58 +
59 +- ethernet-phy@0 {
60 +- reg = <0x0>;
61 ++ ethernet-phy@7 {
62 ++ reg = <0x7>;
63 + interrupt-parent = <&pioA>;
64 + interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
65 + pinctrl-names = "default";
66 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
67 +index 5da732f82fa0c..712264e4e26ec 100644
68 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
69 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
70 +@@ -177,6 +177,7 @@
71 + ranges = <0x0 0x00 0x1700000 0x100000>;
72 + reg = <0x00 0x1700000 0x0 0x100000>;
73 + interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
74 ++ dma-coherent;
75 +
76 + sec_jr0: jr@10000 {
77 + compatible = "fsl,sec-v5.4-job-ring",
78 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
79 +index b9c0f2de8f12c..3ec60e33f2997 100644
80 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
81 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
82 +@@ -237,6 +237,7 @@
83 + ranges = <0x0 0x00 0x1700000 0x100000>;
84 + reg = <0x00 0x1700000 0x0 0x100000>;
85 + interrupts = <0 75 0x4>;
86 ++ dma-coherent;
87 +
88 + sec_jr0: jr@10000 {
89 + compatible = "fsl,sec-v5.4-job-ring",
90 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
91 +index f4eb4d3b6cabf..3452971a8e1c2 100644
92 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
93 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
94 +@@ -243,6 +243,7 @@
95 + ranges = <0x0 0x00 0x1700000 0x100000>;
96 + reg = <0x00 0x1700000 0x0 0x100000>;
97 + interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
98 ++ dma-coherent;
99 +
100 + sec_jr0: jr@10000 {
101 + compatible = "fsl,sec-v5.4-job-ring",
102 +diff --git a/arch/arm64/kernel/crash_dump.c b/arch/arm64/kernel/crash_dump.c
103 +index f46d57c314430..76905a2585505 100644
104 +--- a/arch/arm64/kernel/crash_dump.c
105 ++++ b/arch/arm64/kernel/crash_dump.c
106 +@@ -67,5 +67,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
107 + ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos)
108 + {
109 + memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count);
110 ++ *ppos += count;
111 ++
112 + return count;
113 + }
114 +diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h
115 +index 1d0b875fec44f..ec909eec0b4c6 100644
116 +--- a/arch/ia64/include/asm/syscall.h
117 ++++ b/arch/ia64/include/asm/syscall.h
118 +@@ -35,7 +35,7 @@ static inline void syscall_rollback(struct task_struct *task,
119 + static inline long syscall_get_error(struct task_struct *task,
120 + struct pt_regs *regs)
121 + {
122 +- return regs->r10 == -1 ? regs->r8:0;
123 ++ return regs->r10 == -1 ? -regs->r8:0;
124 + }
125 +
126 + static inline long syscall_get_return_value(struct task_struct *task,
127 +diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
128 +index 427cd565fd61d..799400287cdac 100644
129 +--- a/arch/ia64/kernel/ptrace.c
130 ++++ b/arch/ia64/kernel/ptrace.c
131 +@@ -2147,27 +2147,39 @@ static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data)
132 + {
133 + struct syscall_get_set_args *args = data;
134 + struct pt_regs *pt = args->regs;
135 +- unsigned long *krbs, cfm, ndirty;
136 ++ unsigned long *krbs, cfm, ndirty, nlocals, nouts;
137 + int i, count;
138 +
139 + if (unw_unwind_to_user(info) < 0)
140 + return;
141 +
142 ++ /*
143 ++ * We get here via a few paths:
144 ++ * - break instruction: cfm is shared with caller.
145 ++ * syscall args are in out= regs, locals are non-empty.
146 ++ * - epsinstruction: cfm is set by br.call
147 ++ * locals don't exist.
148 ++ *
149 ++ * For both cases argguments are reachable in cfm.sof - cfm.sol.
150 ++ * CFM: [ ... | sor: 17..14 | sol : 13..7 | sof : 6..0 ]
151 ++ */
152 + cfm = pt->cr_ifs;
153 ++ nlocals = (cfm >> 7) & 0x7f; /* aka sol */
154 ++ nouts = (cfm & 0x7f) - nlocals; /* aka sof - sol */
155 + krbs = (unsigned long *)info->task + IA64_RBS_OFFSET/8;
156 + ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19));
157 +
158 + count = 0;
159 + if (in_syscall(pt))
160 +- count = min_t(int, args->n, cfm & 0x7f);
161 ++ count = min_t(int, args->n, nouts);
162 +
163 ++ /* Iterate over outs. */
164 + for (i = 0; i < count; i++) {
165 ++ int j = ndirty + nlocals + i + args->i;
166 + if (args->rw)
167 +- *ia64_rse_skip_regs(krbs, ndirty + i + args->i) =
168 +- args->args[i];
169 ++ *ia64_rse_skip_regs(krbs, j) = args->args[i];
170 + else
171 +- args->args[i] = *ia64_rse_skip_regs(krbs,
172 +- ndirty + i + args->i);
173 ++ args->args[i] = *ia64_rse_skip_regs(krbs, j);
174 + }
175 +
176 + if (!args->rw) {
177 +diff --git a/arch/powerpc/include/asm/dcr-native.h b/arch/powerpc/include/asm/dcr-native.h
178 +index 151dff555f503..9d9e323f5e9b5 100644
179 +--- a/arch/powerpc/include/asm/dcr-native.h
180 ++++ b/arch/powerpc/include/asm/dcr-native.h
181 +@@ -66,8 +66,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val)
182 + #define mfdcr(rn) \
183 + ({unsigned int rval; \
184 + if (__builtin_constant_p(rn) && rn < 1024) \
185 +- asm volatile("mfdcr %0," __stringify(rn) \
186 +- : "=r" (rval)); \
187 ++ asm volatile("mfdcr %0, %1" : "=r" (rval) \
188 ++ : "n" (rn)); \
189 + else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \
190 + rval = mfdcrx(rn); \
191 + else \
192 +@@ -77,8 +77,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val)
193 + #define mtdcr(rn, v) \
194 + do { \
195 + if (__builtin_constant_p(rn) && rn < 1024) \
196 +- asm volatile("mtdcr " __stringify(rn) ",%0" \
197 +- : : "r" (v)); \
198 ++ asm volatile("mtdcr %0, %1" \
199 ++ : : "n" (rn), "r" (v)); \
200 + else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \
201 + mtdcrx(rn, v); \
202 + else \
203 +diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
204 +index aa624ed79db1a..86879c28910b7 100644
205 +--- a/arch/sparc/kernel/traps_64.c
206 ++++ b/arch/sparc/kernel/traps_64.c
207 +@@ -274,14 +274,13 @@ bool is_no_fault_exception(struct pt_regs *regs)
208 + asi = (regs->tstate >> 24); /* saved %asi */
209 + else
210 + asi = (insn >> 5); /* immediate asi */
211 +- if ((asi & 0xf2) == ASI_PNF) {
212 +- if (insn & 0x1000000) { /* op3[5:4]=3 */
213 +- handle_ldf_stq(insn, regs);
214 +- return true;
215 +- } else if (insn & 0x200000) { /* op3[2], stores */
216 ++ if ((asi & 0xf6) == ASI_PNF) {
217 ++ if (insn & 0x200000) /* op3[2], stores */
218 + return false;
219 +- }
220 +- handle_ld_nf(insn, regs);
221 ++ if (insn & 0x1000000) /* op3[5:4]=3 (fp) */
222 ++ handle_ldf_stq(insn, regs);
223 ++ else
224 ++ handle_ld_nf(insn, regs);
225 + return true;
226 + }
227 + }
228 +diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
229 +index 006f373f54aba..c0499c38962ba 100644
230 +--- a/arch/x86/mm/mem_encrypt.c
231 ++++ b/arch/x86/mm/mem_encrypt.c
232 +@@ -228,7 +228,7 @@ static void __init __set_clr_pte_enc(pte_t *kpte, int level, bool enc)
233 + if (pgprot_val(old_prot) == pgprot_val(new_prot))
234 + return;
235 +
236 +- pa = pfn << page_level_shift(level);
237 ++ pa = pfn << PAGE_SHIFT;
238 + size = page_level_size(level);
239 +
240 + /*
241 +diff --git a/block/genhd.c b/block/genhd.c
242 +index aee2fa9de1a7d..27a410d310870 100644
243 +--- a/block/genhd.c
244 ++++ b/block/genhd.c
245 +@@ -623,10 +623,8 @@ static void register_disk(struct device *parent, struct gendisk *disk,
246 + disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
247 + disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
248 +
249 +- if (disk->flags & GENHD_FL_HIDDEN) {
250 +- dev_set_uevent_suppress(ddev, 0);
251 ++ if (disk->flags & GENHD_FL_HIDDEN)
252 + return;
253 +- }
254 +
255 + /* No minors to use for partitions */
256 + if (!disk_part_scan_enabled(disk))
257 +diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
258 +index 6def196cc23cf..913613cf5c53f 100644
259 +--- a/drivers/acpi/internal.h
260 ++++ b/drivers/acpi/internal.h
261 +@@ -18,6 +18,8 @@
262 + #ifndef _ACPI_INTERNAL_H_
263 + #define _ACPI_INTERNAL_H_
264 +
265 ++#include <linux/idr.h>
266 ++
267 + #define PREFIX "ACPI: "
268 +
269 + int early_acpi_osi_init(void);
270 +@@ -97,9 +99,11 @@ void acpi_scan_table_handler(u32 event, void *table, void *context);
271 +
272 + extern struct list_head acpi_bus_id_list;
273 +
274 ++#define ACPI_MAX_DEVICE_INSTANCES 4096
275 ++
276 + struct acpi_device_bus_id {
277 + const char *bus_id;
278 +- unsigned int instance_no;
279 ++ struct ida instance_ida;
280 + struct list_head node;
281 + };
282 +
283 +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
284 +index d614cb72041e1..d3c551bdc2dac 100644
285 +--- a/drivers/acpi/scan.c
286 ++++ b/drivers/acpi/scan.c
287 +@@ -482,9 +482,8 @@ static void acpi_device_del(struct acpi_device *device)
288 + list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node)
289 + if (!strcmp(acpi_device_bus_id->bus_id,
290 + acpi_device_hid(device))) {
291 +- if (acpi_device_bus_id->instance_no > 0)
292 +- acpi_device_bus_id->instance_no--;
293 +- else {
294 ++ ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no);
295 ++ if (ida_is_empty(&acpi_device_bus_id->instance_ida)) {
296 + list_del(&acpi_device_bus_id->node);
297 + kfree_const(acpi_device_bus_id->bus_id);
298 + kfree(acpi_device_bus_id);
299 +@@ -623,12 +622,38 @@ void acpi_bus_put_acpi_device(struct acpi_device *adev)
300 + put_device(&adev->dev);
301 + }
302 +
303 ++static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id)
304 ++{
305 ++ struct acpi_device_bus_id *acpi_device_bus_id;
306 ++
307 ++ /* Find suitable bus_id and instance number in acpi_bus_id_list. */
308 ++ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) {
309 ++ if (!strcmp(acpi_device_bus_id->bus_id, dev_id))
310 ++ return acpi_device_bus_id;
311 ++ }
312 ++ return NULL;
313 ++}
314 ++
315 ++static int acpi_device_set_name(struct acpi_device *device,
316 ++ struct acpi_device_bus_id *acpi_device_bus_id)
317 ++{
318 ++ struct ida *instance_ida = &acpi_device_bus_id->instance_ida;
319 ++ int result;
320 ++
321 ++ result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL);
322 ++ if (result < 0)
323 ++ return result;
324 ++
325 ++ device->pnp.instance_no = result;
326 ++ dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, result);
327 ++ return 0;
328 ++}
329 ++
330 + int acpi_device_add(struct acpi_device *device,
331 + void (*release)(struct device *))
332 + {
333 ++ struct acpi_device_bus_id *acpi_device_bus_id;
334 + int result;
335 +- struct acpi_device_bus_id *acpi_device_bus_id, *new_bus_id;
336 +- int found = 0;
337 +
338 + if (device->handle) {
339 + acpi_status status;
340 +@@ -654,41 +679,38 @@ int acpi_device_add(struct acpi_device *device,
341 + INIT_LIST_HEAD(&device->del_list);
342 + mutex_init(&device->physical_node_lock);
343 +
344 +- new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
345 +- if (!new_bus_id) {
346 +- pr_err(PREFIX "Memory allocation error\n");
347 +- result = -ENOMEM;
348 +- goto err_detach;
349 +- }
350 +-
351 + mutex_lock(&acpi_device_lock);
352 +- /*
353 +- * Find suitable bus_id and instance number in acpi_bus_id_list
354 +- * If failed, create one and link it into acpi_bus_id_list
355 +- */
356 +- list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) {
357 +- if (!strcmp(acpi_device_bus_id->bus_id,
358 +- acpi_device_hid(device))) {
359 +- acpi_device_bus_id->instance_no++;
360 +- found = 1;
361 +- kfree(new_bus_id);
362 +- break;
363 ++
364 ++ acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device));
365 ++ if (acpi_device_bus_id) {
366 ++ result = acpi_device_set_name(device, acpi_device_bus_id);
367 ++ if (result)
368 ++ goto err_unlock;
369 ++ } else {
370 ++ acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id),
371 ++ GFP_KERNEL);
372 ++ if (!acpi_device_bus_id) {
373 ++ result = -ENOMEM;
374 ++ goto err_unlock;
375 + }
376 +- }
377 +- if (!found) {
378 +- acpi_device_bus_id = new_bus_id;
379 + acpi_device_bus_id->bus_id =
380 + kstrdup_const(acpi_device_hid(device), GFP_KERNEL);
381 + if (!acpi_device_bus_id->bus_id) {
382 +- pr_err(PREFIX "Memory allocation error for bus id\n");
383 ++ kfree(acpi_device_bus_id);
384 + result = -ENOMEM;
385 +- goto err_free_new_bus_id;
386 ++ goto err_unlock;
387 ++ }
388 ++
389 ++ ida_init(&acpi_device_bus_id->instance_ida);
390 ++
391 ++ result = acpi_device_set_name(device, acpi_device_bus_id);
392 ++ if (result) {
393 ++ kfree(acpi_device_bus_id);
394 ++ goto err_unlock;
395 + }
396 +
397 +- acpi_device_bus_id->instance_no = 0;
398 + list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
399 + }
400 +- dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no);
401 +
402 + if (device->parent)
403 + list_add_tail(&device->node, &device->parent->children);
404 +@@ -720,13 +742,9 @@ int acpi_device_add(struct acpi_device *device,
405 + list_del(&device->node);
406 + list_del(&device->wakeup_list);
407 +
408 +- err_free_new_bus_id:
409 +- if (!found)
410 +- kfree(new_bus_id);
411 +-
412 ++ err_unlock:
413 + mutex_unlock(&acpi_device_lock);
414 +
415 +- err_detach:
416 + acpi_detach_data(device->handle, acpi_scan_drop_device);
417 + return result;
418 + }
419 +diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
420 +index 38fec976e62d4..1409d48affb70 100644
421 +--- a/drivers/atm/eni.c
422 ++++ b/drivers/atm/eni.c
423 +@@ -2279,7 +2279,8 @@ out:
424 + return rc;
425 +
426 + err_eni_release:
427 +- eni_do_release(dev);
428 ++ dev->phy = NULL;
429 ++ iounmap(ENI_DEV(dev)->ioaddr);
430 + err_unregister:
431 + atm_dev_deregister(dev);
432 + err_free_consistent:
433 +diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
434 +index 0a67487c0b1d3..a2ecb4190f789 100644
435 +--- a/drivers/atm/idt77105.c
436 ++++ b/drivers/atm/idt77105.c
437 +@@ -261,7 +261,7 @@ static int idt77105_start(struct atm_dev *dev)
438 + {
439 + unsigned long flags;
440 +
441 +- if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
442 ++ if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
443 + return -ENOMEM;
444 + PRIV(dev)->dev = dev;
445 + spin_lock_irqsave(&idt77105_priv_lock, flags);
446 +@@ -336,7 +336,7 @@ static int idt77105_stop(struct atm_dev *dev)
447 + else
448 + idt77105_all = walk->next;
449 + dev->phy = NULL;
450 +- dev->dev_data = NULL;
451 ++ dev->phy_data = NULL;
452 + kfree(walk);
453 + break;
454 + }
455 +diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
456 +index 5f8e009b2da1c..34e6e4b90f741 100644
457 +--- a/drivers/atm/lanai.c
458 ++++ b/drivers/atm/lanai.c
459 +@@ -2238,6 +2238,7 @@ static int lanai_dev_open(struct atm_dev *atmdev)
460 + conf1_write(lanai);
461 + #endif
462 + iounmap(lanai->base);
463 ++ lanai->base = NULL;
464 + error_pci:
465 + pci_disable_device(lanai->pci);
466 + error:
467 +@@ -2250,6 +2251,8 @@ static int lanai_dev_open(struct atm_dev *atmdev)
468 + static void lanai_dev_close(struct atm_dev *atmdev)
469 + {
470 + struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
471 ++ if (lanai->base==NULL)
472 ++ return;
473 + printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n",
474 + lanai->number);
475 + lanai_timed_poll_stop(lanai);
476 +@@ -2559,7 +2562,7 @@ static int lanai_init_one(struct pci_dev *pci,
477 + struct atm_dev *atmdev;
478 + int result;
479 +
480 +- lanai = kmalloc(sizeof(*lanai), GFP_KERNEL);
481 ++ lanai = kzalloc(sizeof(*lanai), GFP_KERNEL);
482 + if (lanai == NULL) {
483 + printk(KERN_ERR DEV_LABEL
484 + ": couldn't allocate dev_data structure!\n");
485 +diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
486 +index 4fa13a8078739..cf517fd148ea1 100644
487 +--- a/drivers/atm/uPD98402.c
488 ++++ b/drivers/atm/uPD98402.c
489 +@@ -210,7 +210,7 @@ static void uPD98402_int(struct atm_dev *dev)
490 + static int uPD98402_start(struct atm_dev *dev)
491 + {
492 + DPRINTK("phy_start\n");
493 +- if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
494 ++ if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
495 + return -ENOMEM;
496 + spin_lock_init(&PRIV(dev)->lock);
497 + memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));
498 +diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
499 +index 208f3eea3641f..d98cfd3b64ff0 100644
500 +--- a/drivers/block/xen-blkback/blkback.c
501 ++++ b/drivers/block/xen-blkback/blkback.c
502 +@@ -944,7 +944,7 @@ next:
503 + out:
504 + for (i = last_map; i < num; i++) {
505 + /* Don't zap current batch's valid persistent grants. */
506 +- if(i >= last_map + segs_to_map)
507 ++ if(i >= map_until)
508 + pages[i]->persistent_gnt = NULL;
509 + pages[i]->handle = BLKBACK_INVALID_HANDLE;
510 + }
511 +diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
512 +index b040447575adc..dcfb32ee5cb60 100644
513 +--- a/drivers/bus/omap_l3_noc.c
514 ++++ b/drivers/bus/omap_l3_noc.c
515 +@@ -285,7 +285,7 @@ static int omap_l3_probe(struct platform_device *pdev)
516 + */
517 + l3->debug_irq = platform_get_irq(pdev, 0);
518 + ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler,
519 +- 0x0, "l3-dbg-irq", l3);
520 ++ IRQF_NO_THREAD, "l3-dbg-irq", l3);
521 + if (ret) {
522 + dev_err(l3->dev, "request_irq failed for %d\n",
523 + l3->debug_irq);
524 +@@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev)
525 +
526 + l3->app_irq = platform_get_irq(pdev, 1);
527 + ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler,
528 +- 0x0, "l3-app-irq", l3);
529 ++ IRQF_NO_THREAD, "l3-app-irq", l3);
530 + if (ret)
531 + dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq);
532 +
533 +diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
534 +index 18f5973b9697f..4ad34c6803ade 100644
535 +--- a/drivers/gpio/gpiolib-acpi.c
536 ++++ b/drivers/gpio/gpiolib-acpi.c
537 +@@ -177,7 +177,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio,
538 + int ret, value;
539 +
540 + ret = request_threaded_irq(event->irq, NULL, event->handler,
541 +- event->irqflags, "ACPI:Event", event);
542 ++ event->irqflags | IRQF_ONESHOT, "ACPI:Event", event);
543 + if (ret) {
544 + dev_err(acpi_gpio->chip->parent,
545 + "Failed to setup interrupt handler for %d\n",
546 +diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
547 +index e44e567bd7892..a050a9aa9a5e5 100644
548 +--- a/drivers/gpu/drm/Kconfig
549 ++++ b/drivers/gpu/drm/Kconfig
550 +@@ -192,6 +192,7 @@ source "drivers/gpu/drm/arm/Kconfig"
551 + config DRM_RADEON
552 + tristate "ATI Radeon"
553 + depends on DRM && PCI && MMU
554 ++ depends on AGP || !AGP
555 + select FW_LOADER
556 + select DRM_KMS_HELPER
557 + select DRM_TTM
558 +diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
559 +index 81de5e1659551..08ff9d7645d74 100644
560 +--- a/drivers/gpu/drm/msm/msm_drv.c
561 ++++ b/drivers/gpu/drm/msm/msm_drv.c
562 +@@ -1363,6 +1363,10 @@ static int msm_pdev_remove(struct platform_device *pdev)
563 + static void msm_pdev_shutdown(struct platform_device *pdev)
564 + {
565 + struct drm_device *drm = platform_get_drvdata(pdev);
566 ++ struct msm_drm_private *priv = drm ? drm->dev_private : NULL;
567 ++
568 ++ if (!priv || !priv->kms)
569 ++ return;
570 +
571 + drm_atomic_helper_shutdown(drm);
572 + }
573 +diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
574 +index 3fd3dfa3478b7..b728a1bf916f4 100644
575 +--- a/drivers/infiniband/hw/cxgb4/cm.c
576 ++++ b/drivers/infiniband/hw/cxgb4/cm.c
577 +@@ -3517,13 +3517,13 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)
578 + ep->com.local_addr.ss_family == AF_INET) {
579 + err = cxgb4_remove_server_filter(
580 + ep->com.dev->rdev.lldi.ports[0], ep->stid,
581 +- ep->com.dev->rdev.lldi.rxq_ids[0], 0);
582 ++ ep->com.dev->rdev.lldi.rxq_ids[0], false);
583 + } else {
584 + struct sockaddr_in6 *sin6;
585 + c4iw_init_wr_wait(ep->com.wr_waitp);
586 + err = cxgb4_remove_server(
587 + ep->com.dev->rdev.lldi.ports[0], ep->stid,
588 +- ep->com.dev->rdev.lldi.rxq_ids[0], 0);
589 ++ ep->com.dev->rdev.lldi.rxq_ids[0], true);
590 + if (err)
591 + goto done;
592 + err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp,
593 +diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
594 +index 439277f48ff8b..17cbad58834fc 100644
595 +--- a/drivers/md/dm-ioctl.c
596 ++++ b/drivers/md/dm-ioctl.c
597 +@@ -529,7 +529,7 @@ static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_
598 + * Grab our output buffer.
599 + */
600 + nl = orig_nl = get_result_buffer(param, param_size, &len);
601 +- if (len < needed) {
602 ++ if (len < needed || len < sizeof(nl->dev)) {
603 + param->flags |= DM_BUFFER_FULL_FLAG;
604 + goto out;
605 + }
606 +diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
607 +index 599be2d2b0ae9..fa8c201fca778 100644
608 +--- a/drivers/md/dm-verity-target.c
609 ++++ b/drivers/md/dm-verity-target.c
610 +@@ -34,7 +34,7 @@
611 + #define DM_VERITY_OPT_IGN_ZEROES "ignore_zero_blocks"
612 + #define DM_VERITY_OPT_AT_MOST_ONCE "check_at_most_once"
613 +
614 +-#define DM_VERITY_OPTS_MAX (2 + DM_VERITY_OPTS_FEC)
615 ++#define DM_VERITY_OPTS_MAX (3 + DM_VERITY_OPTS_FEC)
616 +
617 + static unsigned dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE;
618 +
619 +diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
620 +index 24c6015f6c92b..2278c5fff5c69 100644
621 +--- a/drivers/net/can/c_can/c_can.c
622 ++++ b/drivers/net/can/c_can/c_can.c
623 +@@ -212,18 +212,6 @@ static const struct can_bittiming_const c_can_bittiming_const = {
624 + .brp_inc = 1,
625 + };
626 +
627 +-static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv)
628 +-{
629 +- if (priv->device)
630 +- pm_runtime_enable(priv->device);
631 +-}
632 +-
633 +-static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv)
634 +-{
635 +- if (priv->device)
636 +- pm_runtime_disable(priv->device);
637 +-}
638 +-
639 + static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv)
640 + {
641 + if (priv->device)
642 +@@ -1318,7 +1306,6 @@ static const struct net_device_ops c_can_netdev_ops = {
643 +
644 + int register_c_can_dev(struct net_device *dev)
645 + {
646 +- struct c_can_priv *priv = netdev_priv(dev);
647 + int err;
648 +
649 + /* Deactivate pins to prevent DRA7 DCAN IP from being
650 +@@ -1328,28 +1315,19 @@ int register_c_can_dev(struct net_device *dev)
651 + */
652 + pinctrl_pm_select_sleep_state(dev->dev.parent);
653 +
654 +- c_can_pm_runtime_enable(priv);
655 +-
656 + dev->flags |= IFF_ECHO; /* we support local echo */
657 + dev->netdev_ops = &c_can_netdev_ops;
658 +
659 + err = register_candev(dev);
660 +- if (err)
661 +- c_can_pm_runtime_disable(priv);
662 +- else
663 ++ if (!err)
664 + devm_can_led_init(dev);
665 +-
666 + return err;
667 + }
668 + EXPORT_SYMBOL_GPL(register_c_can_dev);
669 +
670 + void unregister_c_can_dev(struct net_device *dev)
671 + {
672 +- struct c_can_priv *priv = netdev_priv(dev);
673 +-
674 + unregister_candev(dev);
675 +-
676 +- c_can_pm_runtime_disable(priv);
677 + }
678 + EXPORT_SYMBOL_GPL(unregister_c_can_dev);
679 +
680 +diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
681 +index 406b4847e5dc3..7efb60b508762 100644
682 +--- a/drivers/net/can/c_can/c_can_pci.c
683 ++++ b/drivers/net/can/c_can/c_can_pci.c
684 +@@ -239,12 +239,13 @@ static void c_can_pci_remove(struct pci_dev *pdev)
685 + {
686 + struct net_device *dev = pci_get_drvdata(pdev);
687 + struct c_can_priv *priv = netdev_priv(dev);
688 ++ void __iomem *addr = priv->base;
689 +
690 + unregister_c_can_dev(dev);
691 +
692 + free_c_can_dev(dev);
693 +
694 +- pci_iounmap(pdev, priv->base);
695 ++ pci_iounmap(pdev, addr);
696 + pci_disable_msi(pdev);
697 + pci_clear_master(pdev);
698 + pci_release_regions(pdev);
699 +diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
700 +index b5145a7f874c2..f2b0408ce87d1 100644
701 +--- a/drivers/net/can/c_can/c_can_platform.c
702 ++++ b/drivers/net/can/c_can/c_can_platform.c
703 +@@ -29,6 +29,7 @@
704 + #include <linux/list.h>
705 + #include <linux/io.h>
706 + #include <linux/platform_device.h>
707 ++#include <linux/pm_runtime.h>
708 + #include <linux/clk.h>
709 + #include <linux/of.h>
710 + #include <linux/of_device.h>
711 +@@ -385,6 +386,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
712 + platform_set_drvdata(pdev, dev);
713 + SET_NETDEV_DEV(dev, &pdev->dev);
714 +
715 ++ pm_runtime_enable(priv->device);
716 + ret = register_c_can_dev(dev);
717 + if (ret) {
718 + dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
719 +@@ -397,6 +399,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
720 + return 0;
721 +
722 + exit_free_device:
723 ++ pm_runtime_disable(priv->device);
724 + free_c_can_dev(dev);
725 + exit:
726 + dev_err(&pdev->dev, "probe failed\n");
727 +@@ -407,9 +410,10 @@ exit:
728 + static int c_can_plat_remove(struct platform_device *pdev)
729 + {
730 + struct net_device *dev = platform_get_drvdata(pdev);
731 ++ struct c_can_priv *priv = netdev_priv(dev);
732 +
733 + unregister_c_can_dev(dev);
734 +-
735 ++ pm_runtime_disable(priv->device);
736 + free_c_can_dev(dev);
737 +
738 + return 0;
739 +diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
740 +index 1bd181b33c24f..8738d37f72737 100644
741 +--- a/drivers/net/can/dev.c
742 ++++ b/drivers/net/can/dev.c
743 +@@ -1235,6 +1235,7 @@ static void can_dellink(struct net_device *dev, struct list_head *head)
744 +
745 + static struct rtnl_link_ops can_link_ops __read_mostly = {
746 + .kind = "can",
747 ++ .netns_refund = true,
748 + .maxtype = IFLA_CAN_MAX,
749 + .policy = can_policy,
750 + .setup = can_setup,
751 +diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
752 +index cb6bc20585428..d4dfa0247ebbc 100644
753 +--- a/drivers/net/can/flexcan.c
754 ++++ b/drivers/net/can/flexcan.c
755 +@@ -422,9 +422,15 @@ static int flexcan_chip_disable(struct flexcan_priv *priv)
756 + static int flexcan_chip_freeze(struct flexcan_priv *priv)
757 + {
758 + struct flexcan_regs __iomem *regs = priv->regs;
759 +- unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate;
760 ++ unsigned int timeout;
761 ++ u32 bitrate = priv->can.bittiming.bitrate;
762 + u32 reg;
763 +
764 ++ if (bitrate)
765 ++ timeout = 1000 * 1000 * 10 / bitrate;
766 ++ else
767 ++ timeout = FLEXCAN_TIMEOUT_US / 10;
768 ++
769 + reg = priv->read(&regs->mcr);
770 + reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT;
771 + priv->write(reg, &regs->mcr);
772 +diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
773 +index fbb970220c2d7..e87c3bb820817 100644
774 +--- a/drivers/net/can/m_can/m_can.c
775 ++++ b/drivers/net/can/m_can/m_can.c
776 +@@ -520,9 +520,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota)
777 + }
778 +
779 + while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
780 +- if (rxfs & RXFS_RFL)
781 +- netdev_warn(dev, "Rx FIFO 0 Message Lost\n");
782 +-
783 + m_can_read_fifo(dev, rxfs);
784 +
785 + quota--;
786 +diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
787 +index e9fe3897bd9cc..3deda0321c00d 100644
788 +--- a/drivers/net/dsa/bcm_sf2.c
789 ++++ b/drivers/net/dsa/bcm_sf2.c
790 +@@ -482,8 +482,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)
791 + * in bits 15:8 and the patch level in bits 7:0 which is exactly what
792 + * the REG_PHY_REVISION register layout is.
793 + */
794 +-
795 +- return priv->hw_params.gphy_rev;
796 ++ if (priv->int_phy_mask & BIT(port))
797 ++ return priv->hw_params.gphy_rev;
798 ++ else
799 ++ return 0;
800 + }
801 +
802 + static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port,
803 +diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
804 +index acf27c3952865..964407deca350 100644
805 +--- a/drivers/net/ethernet/faraday/ftgmac100.c
806 ++++ b/drivers/net/ethernet/faraday/ftgmac100.c
807 +@@ -1333,6 +1333,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget)
808 + */
809 + if (unlikely(priv->need_mac_restart)) {
810 + ftgmac100_start_hw(priv);
811 ++ priv->need_mac_restart = false;
812 +
813 + /* Re-enable "bad" interrupts */
814 + iowrite32(FTGMAC100_INT_BAD,
815 +diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
816 +index 7e892b1cbd3de..09a762eb4f09e 100644
817 +--- a/drivers/net/ethernet/freescale/fec_ptp.c
818 ++++ b/drivers/net/ethernet/freescale/fec_ptp.c
819 +@@ -382,9 +382,16 @@ static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
820 + u64 ns;
821 + unsigned long flags;
822 +
823 ++ mutex_lock(&adapter->ptp_clk_mutex);
824 ++ /* Check the ptp clock */
825 ++ if (!adapter->ptp_clk_on) {
826 ++ mutex_unlock(&adapter->ptp_clk_mutex);
827 ++ return -EINVAL;
828 ++ }
829 + spin_lock_irqsave(&adapter->tmreg_lock, flags);
830 + ns = timecounter_read(&adapter->tc);
831 + spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
832 ++ mutex_unlock(&adapter->ptp_clk_mutex);
833 +
834 + *ts = ns_to_timespec64(ns);
835 +
836 +diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
837 +index 8db0924ec681c..df03cf63cb026 100644
838 +--- a/drivers/net/ethernet/freescale/gianfar.c
839 ++++ b/drivers/net/ethernet/freescale/gianfar.c
840 +@@ -2940,6 +2940,10 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus,
841 + if (lstatus & BD_LFLAG(RXBD_LAST))
842 + size -= skb->len;
843 +
844 ++ WARN(size < 0, "gianfar: rx fragment size underflow");
845 ++ if (size < 0)
846 ++ return false;
847 ++
848 + skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
849 + rxb->page_offset + RXBUF_ALIGNMENT,
850 + size, GFAR_RXB_TRUESIZE);
851 +@@ -3101,6 +3105,17 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
852 + if (lstatus & BD_LFLAG(RXBD_EMPTY))
853 + break;
854 +
855 ++ /* lost RXBD_LAST descriptor due to overrun */
856 ++ if (skb &&
857 ++ (lstatus & BD_LFLAG(RXBD_FIRST))) {
858 ++ /* discard faulty buffer */
859 ++ dev_kfree_skb(skb);
860 ++ skb = NULL;
861 ++ rx_queue->stats.rx_dropped++;
862 ++
863 ++ /* can continue normally */
864 ++ }
865 ++
866 + /* order rx buffer descriptor reads */
867 + rmb();
868 +
869 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
870 +index 4de65a9de0a63..b7fe3e849872e 100644
871 +--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
872 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
873 +@@ -1677,8 +1677,10 @@ static int hns_nic_clear_all_rx_fetch(struct net_device *ndev)
874 + for (j = 0; j < fetch_num; j++) {
875 + /* alloc one skb and init */
876 + skb = hns_assemble_skb(ndev);
877 +- if (!skb)
878 ++ if (!skb) {
879 ++ ret = -ENOMEM;
880 + goto out;
881 ++ }
882 + rd = &tx_ring_data(priv, skb->queue_mapping);
883 + hns_nic_net_xmit_hw(ndev, skb, rd);
884 +
885 +diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
886 +index b9309302c29e5..16653e94009e1 100644
887 +--- a/drivers/net/ethernet/intel/e1000e/82571.c
888 ++++ b/drivers/net/ethernet/intel/e1000e/82571.c
889 +@@ -899,6 +899,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
890 + } else {
891 + data &= ~IGP02E1000_PM_D0_LPLU;
892 + ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
893 ++ if (ret_val)
894 ++ return ret_val;
895 + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used
896 + * during Dx states where the power conservation is most
897 + * important. During driver activity we should enable
898 +diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
899 +index 7216825e049c2..6bbe7afdf30c4 100644
900 +--- a/drivers/net/ethernet/intel/e1000e/netdev.c
901 ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
902 +@@ -5922,15 +5922,19 @@ static void e1000_reset_task(struct work_struct *work)
903 + struct e1000_adapter *adapter;
904 + adapter = container_of(work, struct e1000_adapter, reset_task);
905 +
906 ++ rtnl_lock();
907 + /* don't run the task if already down */
908 +- if (test_bit(__E1000_DOWN, &adapter->state))
909 ++ if (test_bit(__E1000_DOWN, &adapter->state)) {
910 ++ rtnl_unlock();
911 + return;
912 ++ }
913 +
914 + if (!(adapter->flags & FLAG_RESTART_NOW)) {
915 + e1000e_dump(adapter);
916 + e_err("Reset adapter unexpectedly\n");
917 + }
918 + e1000e_reinit_locked(adapter);
919 ++ rtnl_unlock();
920 + }
921 +
922 + /**
923 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
924 +index faee77fa08044..8fcd3ffb43e00 100644
925 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
926 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
927 +@@ -9487,8 +9487,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
928 + ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask);
929 + err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter,
930 + input->sw_idx, queue);
931 +- if (!err)
932 +- ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
933 ++ if (err)
934 ++ goto err_out_w_lock;
935 ++
936 ++ ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
937 + spin_unlock(&adapter->fdir_perfect_lock);
938 +
939 + if ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))
940 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
941 +index a383276eb816a..3d824c20d2a46 100644
942 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
943 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
944 +@@ -1460,6 +1460,7 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
945 + {
946 + struct mlx5e_priv *priv = netdev_priv(netdev);
947 + struct mlx5_core_dev *mdev = priv->mdev;
948 ++ int err;
949 +
950 + if (!MLX5_CAP_GEN(mdev, cqe_compression))
951 + return -EOPNOTSUPP;
952 +@@ -1469,7 +1470,10 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
953 + return -EINVAL;
954 + }
955 +
956 +- mlx5e_modify_rx_cqe_compression_locked(priv, enable);
957 ++ err = mlx5e_modify_rx_cqe_compression_locked(priv, enable);
958 ++ if (err)
959 ++ return err;
960 ++
961 + priv->channels.params.rx_cqe_compress_def = enable;
962 +
963 + return 0;
964 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
965 +index f34ae8c75bc5e..61a39d167c8bc 100644
966 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
967 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
968 +@@ -1426,6 +1426,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
969 +
970 + if (fw_dump->tmpl_hdr == NULL || current_version > prev_version) {
971 + vfree(fw_dump->tmpl_hdr);
972 ++ fw_dump->tmpl_hdr = NULL;
973 +
974 + if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
975 + extended = !qlcnic_83xx_extend_md_capab(adapter);
976 +@@ -1444,6 +1445,8 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
977 + struct qlcnic_83xx_dump_template_hdr *hdr;
978 +
979 + hdr = fw_dump->tmpl_hdr;
980 ++ if (!hdr)
981 ++ return;
982 + hdr->drv_cap_mask = 0x1f;
983 + fw_dump->cap_mask = 0x1f;
984 + dev_info(&pdev->dev,
985 +diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
986 +index 027367b9cc480..3693a59b6d010 100644
987 +--- a/drivers/net/ethernet/socionext/netsec.c
988 ++++ b/drivers/net/ethernet/socionext/netsec.c
989 +@@ -1386,14 +1386,17 @@ static int netsec_netdev_init(struct net_device *ndev)
990 + goto err1;
991 +
992 + /* set phy power down */
993 +- data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR) |
994 +- BMCR_PDOWN;
995 +- netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data);
996 ++ data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR);
997 ++ netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR,
998 ++ data | BMCR_PDOWN);
999 +
1000 + ret = netsec_reset_hardware(priv, true);
1001 + if (ret)
1002 + goto err2;
1003 +
1004 ++ /* Restore phy power state */
1005 ++ netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data);
1006 ++
1007 + return 0;
1008 + err2:
1009 + netsec_free_dring(priv, NETSEC_RING_RX);
1010 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
1011 +index 1e5e831718dbd..4382deaeb570d 100644
1012 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
1013 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
1014 +@@ -1179,6 +1179,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
1015 + plat_dat->init = sun8i_dwmac_init;
1016 + plat_dat->exit = sun8i_dwmac_exit;
1017 + plat_dat->setup = sun8i_dwmac_setup;
1018 ++ plat_dat->tx_fifo_size = 4096;
1019 ++ plat_dat->rx_fifo_size = 16384;
1020 +
1021 + ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv);
1022 + if (ret)
1023 +diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
1024 +index d84501441edde..602a2025717ab 100644
1025 +--- a/drivers/net/ethernet/sun/niu.c
1026 ++++ b/drivers/net/ethernet/sun/niu.c
1027 +@@ -3933,8 +3933,6 @@ static void niu_xmac_interrupt(struct niu *np)
1028 + mp->rx_mcasts += RXMAC_MC_FRM_CNT_COUNT;
1029 + if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
1030 + mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
1031 +- if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
1032 +- mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
1033 + if (val & XRXMAC_STATUS_RXHIST1_CNT_EXP)
1034 + mp->rx_hist_cnt1 += RXMAC_HIST_CNT1_COUNT;
1035 + if (val & XRXMAC_STATUS_RXHIST2_CNT_EXP)
1036 +diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
1037 +index dc966ddb6d815..358f911fcd9d5 100644
1038 +--- a/drivers/net/ethernet/tehuti/tehuti.c
1039 ++++ b/drivers/net/ethernet/tehuti/tehuti.c
1040 +@@ -2056,6 +2056,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1041 + /*bdx_hw_reset(priv); */
1042 + if (bdx_read_mac(priv)) {
1043 + pr_err("load MAC address failed\n");
1044 ++ err = -EFAULT;
1045 + goto err_out_iomap;
1046 + }
1047 + SET_NETDEV_DEV(ndev, &pdev->dev);
1048 +diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
1049 +index 78b16eb9e58c8..f448e484a341f 100644
1050 +--- a/drivers/net/usb/cdc-phonet.c
1051 ++++ b/drivers/net/usb/cdc-phonet.c
1052 +@@ -400,6 +400,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i
1053 +
1054 + err = register_netdev(dev);
1055 + if (err) {
1056 ++ /* Set disconnected flag so that disconnect() returns early. */
1057 ++ pnd->disconnected = 1;
1058 + usb_driver_release_interface(&usbpn_driver, data_intf);
1059 + goto out;
1060 + }
1061 +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
1062 +index 7dc6055855354..a27ea04cfa6c3 100644
1063 +--- a/drivers/net/usb/r8152.c
1064 ++++ b/drivers/net/usb/r8152.c
1065 +@@ -2593,29 +2593,6 @@ static void __rtl_set_wol(struct r8152 *tp, u32 wolopts)
1066 + device_set_wakeup_enable(&tp->udev->dev, false);
1067 + }
1068 +
1069 +-static void r8153_mac_clk_spd(struct r8152 *tp, bool enable)
1070 +-{
1071 +- /* MAC clock speed down */
1072 +- if (enable) {
1073 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL,
1074 +- ALDPS_SPDWN_RATIO);
1075 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2,
1076 +- EEE_SPDWN_RATIO);
1077 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3,
1078 +- PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN |
1079 +- U1U2_SPDWN_EN | L1_SPDWN_EN);
1080 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4,
1081 +- PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN |
1082 +- TP100_SPDWN_EN | TP500_SPDWN_EN | EEE_SPDWN_EN |
1083 +- TP1000_SPDWN_EN);
1084 +- } else {
1085 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
1086 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0);
1087 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0);
1088 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0);
1089 +- }
1090 +-}
1091 +-
1092 + static void r8153_u1u2en(struct r8152 *tp, bool enable)
1093 + {
1094 + u8 u1u2[8];
1095 +@@ -2847,11 +2824,9 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
1096 + if (enable) {
1097 + r8153_u1u2en(tp, false);
1098 + r8153_u2p3en(tp, false);
1099 +- r8153_mac_clk_spd(tp, true);
1100 + rtl_runtime_suspend_enable(tp, true);
1101 + } else {
1102 + rtl_runtime_suspend_enable(tp, false);
1103 +- r8153_mac_clk_spd(tp, false);
1104 +
1105 + switch (tp->version) {
1106 + case RTL_VER_03:
1107 +@@ -3413,7 +3388,6 @@ static void r8153_first_init(struct r8152 *tp)
1108 + u32 ocp_data;
1109 + int i;
1110 +
1111 +- r8153_mac_clk_spd(tp, false);
1112 + rxdy_gated_en(tp, true);
1113 + r8153_teredo_off(tp);
1114 +
1115 +@@ -3475,8 +3449,6 @@ static void r8153_enter_oob(struct r8152 *tp)
1116 + u32 ocp_data;
1117 + int i;
1118 +
1119 +- r8153_mac_clk_spd(tp, true);
1120 +-
1121 + ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
1122 + ocp_data &= ~NOW_IS_OOB;
1123 + ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
1124 +@@ -4141,9 +4113,14 @@ static void r8153_init(struct r8152 *tp)
1125 +
1126 + ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001);
1127 +
1128 ++ /* MAC clock speed down */
1129 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
1130 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0);
1131 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0);
1132 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0);
1133 ++
1134 + r8153_power_cut_en(tp, false);
1135 + r8153_u1u2en(tp, true);
1136 +- r8153_mac_clk_spd(tp, false);
1137 + usb_enable_lpm(tp->udev);
1138 +
1139 + /* rx aggregation */
1140 +diff --git a/drivers/net/veth.c b/drivers/net/veth.c
1141 +index 2abbad1abaf2e..fd1843fd256bb 100644
1142 +--- a/drivers/net/veth.c
1143 ++++ b/drivers/net/veth.c
1144 +@@ -197,8 +197,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
1145 + if (rxq < rcv->real_num_rx_queues) {
1146 + rq = &rcv_priv->rq[rxq];
1147 + rcv_xdp = rcu_access_pointer(rq->xdp_prog);
1148 +- if (rcv_xdp)
1149 +- skb_record_rx_queue(skb, rxq);
1150 ++ skb_record_rx_queue(skb, rxq);
1151 + }
1152 +
1153 + if (likely(veth_forward_skb(rcv, skb, rq, rcv_xdp) == NET_RX_SUCCESS)) {
1154 +diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
1155 +index 9ab04ef532f34..5df6e85e7ccb7 100644
1156 +--- a/drivers/net/wan/fsl_ucc_hdlc.c
1157 ++++ b/drivers/net/wan/fsl_ucc_hdlc.c
1158 +@@ -201,14 +201,18 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
1159 + priv->rx_skbuff = kcalloc(priv->rx_ring_size,
1160 + sizeof(*priv->rx_skbuff),
1161 + GFP_KERNEL);
1162 +- if (!priv->rx_skbuff)
1163 ++ if (!priv->rx_skbuff) {
1164 ++ ret = -ENOMEM;
1165 + goto free_ucc_pram;
1166 ++ }
1167 +
1168 + priv->tx_skbuff = kcalloc(priv->tx_ring_size,
1169 + sizeof(*priv->tx_skbuff),
1170 + GFP_KERNEL);
1171 +- if (!priv->tx_skbuff)
1172 ++ if (!priv->tx_skbuff) {
1173 ++ ret = -ENOMEM;
1174 + goto free_rx_skbuff;
1175 ++ }
1176 +
1177 + priv->skb_curtx = 0;
1178 + priv->skb_dirtytx = 0;
1179 +diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
1180 +index cf8587f96fc45..772f9ae3d7e92 100644
1181 +--- a/drivers/platform/x86/intel-vbtn.c
1182 ++++ b/drivers/platform/x86/intel-vbtn.c
1183 +@@ -46,8 +46,16 @@ static const struct key_entry intel_vbtn_keymap[] = {
1184 + };
1185 +
1186 + static const struct key_entry intel_vbtn_switchmap[] = {
1187 +- { KE_SW, 0xCA, { .sw = { SW_DOCK, 1 } } }, /* Docked */
1188 +- { KE_SW, 0xCB, { .sw = { SW_DOCK, 0 } } }, /* Undocked */
1189 ++ /*
1190 ++ * SW_DOCK should only be reported for docking stations, but DSDTs using the
1191 ++ * intel-vbtn code, always seem to use this for 2-in-1s / convertibles and set
1192 ++ * SW_DOCK=1 when in laptop-mode (in tandem with setting SW_TABLET_MODE=0).
1193 ++ * This causes userspace to think the laptop is docked to a port-replicator
1194 ++ * and to disable suspend-on-lid-close, which is undesirable.
1195 ++ * Map the dock events to KEY_IGNORE to avoid this broken SW_DOCK reporting.
1196 ++ */
1197 ++ { KE_IGNORE, 0xCA, { .sw = { SW_DOCK, 1 } } }, /* Docked */
1198 ++ { KE_IGNORE, 0xCB, { .sw = { SW_DOCK, 0 } } }, /* Undocked */
1199 + { KE_SW, 0xCC, { .sw = { SW_TABLET_MODE, 1 } } }, /* Tablet */
1200 + { KE_SW, 0xCD, { .sw = { SW_TABLET_MODE, 0 } } }, /* Laptop */
1201 + };
1202 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
1203 +index 07959047d4dc4..447ac667f4b2b 100644
1204 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
1205 ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
1206 +@@ -6629,14 +6629,18 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
1207 + ioc->pend_os_device_add_sz++;
1208 + ioc->pend_os_device_add = kzalloc(ioc->pend_os_device_add_sz,
1209 + GFP_KERNEL);
1210 +- if (!ioc->pend_os_device_add)
1211 ++ if (!ioc->pend_os_device_add) {
1212 ++ r = -ENOMEM;
1213 + goto out_free_resources;
1214 ++ }
1215 +
1216 + ioc->device_remove_in_progress_sz = ioc->pend_os_device_add_sz;
1217 + ioc->device_remove_in_progress =
1218 + kzalloc(ioc->device_remove_in_progress_sz, GFP_KERNEL);
1219 +- if (!ioc->device_remove_in_progress)
1220 ++ if (!ioc->device_remove_in_progress) {
1221 ++ r = -ENOMEM;
1222 + goto out_free_resources;
1223 ++ }
1224 +
1225 + ioc->fwfault_debug = mpt3sas_fwfault_debug;
1226 +
1227 +diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
1228 +index e201c163ea1c8..fe26144d390a9 100644
1229 +--- a/drivers/scsi/qedi/qedi_main.c
1230 ++++ b/drivers/scsi/qedi/qedi_main.c
1231 +@@ -1559,6 +1559,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
1232 + if (!qedi->global_queues[i]) {
1233 + QEDI_ERR(&qedi->dbg_ctx,
1234 + "Unable to allocation global queue %d.\n", i);
1235 ++ status = -ENOMEM;
1236 + goto mem_alloc_failure;
1237 + }
1238 +
1239 +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
1240 +index 4e95b4f8a2ad9..0cd9b84bdd9db 100644
1241 +--- a/fs/ext4/xattr.c
1242 ++++ b/fs/ext4/xattr.c
1243 +@@ -1480,6 +1480,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,
1244 + if (!ce)
1245 + return NULL;
1246 +
1247 ++ WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
1248 ++ !(current->flags & PF_MEMALLOC_NOFS));
1249 ++
1250 + ea_data = ext4_kvmalloc(value_len, GFP_NOFS);
1251 + if (!ea_data) {
1252 + mb_cache_entry_put(ea_inode_cache, ce);
1253 +@@ -2346,6 +2349,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
1254 + error = -ENOSPC;
1255 + goto cleanup;
1256 + }
1257 ++ WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS));
1258 + }
1259 +
1260 + error = ext4_reserve_inode_write(handle, inode, &is.iloc);
1261 +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
1262 +index ac3e06367cb68..e55f86713948b 100644
1263 +--- a/fs/nfs/Kconfig
1264 ++++ b/fs/nfs/Kconfig
1265 +@@ -127,7 +127,7 @@ config PNFS_BLOCK
1266 + config PNFS_FLEXFILE_LAYOUT
1267 + tristate
1268 + depends on NFS_V4_1 && NFS_V3
1269 +- default m
1270 ++ default NFS_V4
1271 +
1272 + config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
1273 + string "NFSv4.1 Implementation ID Domain"
1274 +diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
1275 +index 9956453aa6ffc..0ed419bb02b0f 100644
1276 +--- a/fs/nfs/nfs3xdr.c
1277 ++++ b/fs/nfs/nfs3xdr.c
1278 +@@ -34,6 +34,7 @@
1279 + */
1280 + #define NFS3_fhandle_sz (1+16)
1281 + #define NFS3_fh_sz (NFS3_fhandle_sz) /* shorthand */
1282 ++#define NFS3_post_op_fh_sz (1+NFS3_fh_sz)
1283 + #define NFS3_sattr_sz (15)
1284 + #define NFS3_filename_sz (1+(NFS3_MAXNAMLEN>>2))
1285 + #define NFS3_path_sz (1+(NFS3_MAXPATHLEN>>2))
1286 +@@ -71,7 +72,7 @@
1287 + #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1)
1288 + #define NFS3_readres_sz (1+NFS3_post_op_attr_sz+3)
1289 + #define NFS3_writeres_sz (1+NFS3_wcc_data_sz+4)
1290 +-#define NFS3_createres_sz (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1291 ++#define NFS3_createres_sz (1+NFS3_post_op_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1292 + #define NFS3_renameres_sz (1+(2 * NFS3_wcc_data_sz))
1293 + #define NFS3_linkres_sz (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1294 + #define NFS3_readdirres_sz (1+NFS3_post_op_attr_sz+2)
1295 +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1296 +index d63b248582d1a..bcad052db0650 100644
1297 +--- a/fs/nfs/nfs4proc.c
1298 ++++ b/fs/nfs/nfs4proc.c
1299 +@@ -5535,6 +5535,9 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl
1300 + unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE);
1301 + int ret, i;
1302 +
1303 ++ /* You can't remove system.nfs4_acl: */
1304 ++ if (buflen == 0)
1305 ++ return -EINVAL;
1306 + if (!nfs4_server_supports_acls(server))
1307 + return -EOPNOTSUPP;
1308 + if (npages > ARRAY_SIZE(pages))
1309 +diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c
1310 +index d2a806416c3ab..1d406a2094a56 100644
1311 +--- a/fs/squashfs/export.c
1312 ++++ b/fs/squashfs/export.c
1313 +@@ -165,14 +165,18 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb,
1314 + start = le64_to_cpu(table[n]);
1315 + end = le64_to_cpu(table[n + 1]);
1316 +
1317 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1318 ++ if (start >= end
1319 ++ || (end - start) >
1320 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1321 + kfree(table);
1322 + return ERR_PTR(-EINVAL);
1323 + }
1324 + }
1325 +
1326 + start = le64_to_cpu(table[indexes - 1]);
1327 +- if (start >= lookup_table_start || (lookup_table_start - start) > SQUASHFS_METADATA_SIZE) {
1328 ++ if (start >= lookup_table_start ||
1329 ++ (lookup_table_start - start) >
1330 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1331 + kfree(table);
1332 + return ERR_PTR(-EINVAL);
1333 + }
1334 +diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c
1335 +index 8ccc0e3f6ea5a..d2e15baab5378 100644
1336 +--- a/fs/squashfs/id.c
1337 ++++ b/fs/squashfs/id.c
1338 +@@ -110,14 +110,16 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb,
1339 + start = le64_to_cpu(table[n]);
1340 + end = le64_to_cpu(table[n + 1]);
1341 +
1342 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1343 ++ if (start >= end || (end - start) >
1344 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1345 + kfree(table);
1346 + return ERR_PTR(-EINVAL);
1347 + }
1348 + }
1349 +
1350 + start = le64_to_cpu(table[indexes - 1]);
1351 +- if (start >= id_table_start || (id_table_start - start) > SQUASHFS_METADATA_SIZE) {
1352 ++ if (start >= id_table_start || (id_table_start - start) >
1353 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1354 + kfree(table);
1355 + return ERR_PTR(-EINVAL);
1356 + }
1357 +diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h
1358 +index 4e6853f084d07..10e93345b6153 100644
1359 +--- a/fs/squashfs/squashfs_fs.h
1360 ++++ b/fs/squashfs/squashfs_fs.h
1361 +@@ -30,6 +30,7 @@
1362 +
1363 + /* size of metadata (inode and directory) blocks */
1364 + #define SQUASHFS_METADATA_SIZE 8192
1365 ++#define SQUASHFS_BLOCK_OFFSET 2
1366 +
1367 + /* default size of block device I/O */
1368 + #ifdef CONFIG_SQUASHFS_4K_DEVBLK_SIZE
1369 +diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c
1370 +index 3a655d879600c..7f718d2bf3579 100644
1371 +--- a/fs/squashfs/xattr_id.c
1372 ++++ b/fs/squashfs/xattr_id.c
1373 +@@ -122,14 +122,16 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start,
1374 + start = le64_to_cpu(table[n]);
1375 + end = le64_to_cpu(table[n + 1]);
1376 +
1377 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1378 ++ if (start >= end || (end - start) >
1379 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1380 + kfree(table);
1381 + return ERR_PTR(-EINVAL);
1382 + }
1383 + }
1384 +
1385 + start = le64_to_cpu(table[indexes - 1]);
1386 +- if (start >= table_start || (table_start - start) > SQUASHFS_METADATA_SIZE) {
1387 ++ if (start >= table_start || (table_start - start) >
1388 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1389 + kfree(table);
1390 + return ERR_PTR(-EINVAL);
1391 + }
1392 +diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
1393 +index d9773df60a360..8b19618bad0a0 100644
1394 +--- a/include/acpi/acpi_bus.h
1395 ++++ b/include/acpi/acpi_bus.h
1396 +@@ -248,6 +248,7 @@ struct acpi_pnp_type {
1397 +
1398 + struct acpi_device_pnp {
1399 + acpi_bus_id bus_id; /* Object name */
1400 ++ int instance_no; /* Instance number of this object */
1401 + struct acpi_pnp_type type; /* ID type */
1402 + acpi_bus_address bus_address; /* _ADR */
1403 + char *unique_id; /* _UID */
1404 +diff --git a/include/linux/bpf.h b/include/linux/bpf.h
1405 +index 16f6beef5cad7..3b3337333cfd6 100644
1406 +--- a/include/linux/bpf.h
1407 ++++ b/include/linux/bpf.h
1408 +@@ -382,7 +382,7 @@ int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array,
1409 + struct bpf_prog *include_prog,
1410 + struct bpf_prog_array **new_array);
1411 +
1412 +-#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null) \
1413 ++#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null, set_cg_storage) \
1414 + ({ \
1415 + struct bpf_prog_array_item *_item; \
1416 + struct bpf_prog *_prog; \
1417 +@@ -395,7 +395,8 @@ int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array,
1418 + goto _out; \
1419 + _item = &_array->items[0]; \
1420 + while ((_prog = READ_ONCE(_item->prog))) { \
1421 +- bpf_cgroup_storage_set(_item->cgroup_storage); \
1422 ++ if (set_cg_storage) \
1423 ++ bpf_cgroup_storage_set(_item->cgroup_storage); \
1424 + _ret &= func(_prog, ctx); \
1425 + _item++; \
1426 + } \
1427 +@@ -406,10 +407,10 @@ _out: \
1428 + })
1429 +
1430 + #define BPF_PROG_RUN_ARRAY(array, ctx, func) \
1431 +- __BPF_PROG_RUN_ARRAY(array, ctx, func, false)
1432 ++ __BPF_PROG_RUN_ARRAY(array, ctx, func, false, true)
1433 +
1434 + #define BPF_PROG_RUN_ARRAY_CHECK(array, ctx, func) \
1435 +- __BPF_PROG_RUN_ARRAY(array, ctx, func, true)
1436 ++ __BPF_PROG_RUN_ARRAY(array, ctx, func, true, false)
1437 +
1438 + #ifdef CONFIG_BPF_SYSCALL
1439 + DECLARE_PER_CPU(int, bpf_prog_active);
1440 +diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
1441 +index 2e55e4cdbd8aa..1261559d70b41 100644
1442 +--- a/include/linux/if_macvlan.h
1443 ++++ b/include/linux/if_macvlan.h
1444 +@@ -43,13 +43,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
1445 + if (likely(success)) {
1446 + struct vlan_pcpu_stats *pcpu_stats;
1447 +
1448 +- pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
1449 ++ pcpu_stats = get_cpu_ptr(vlan->pcpu_stats);
1450 + u64_stats_update_begin(&pcpu_stats->syncp);
1451 + pcpu_stats->rx_packets++;
1452 + pcpu_stats->rx_bytes += len;
1453 + if (multicast)
1454 + pcpu_stats->rx_multicast++;
1455 + u64_stats_update_end(&pcpu_stats->syncp);
1456 ++ put_cpu_ptr(vlan->pcpu_stats);
1457 + } else {
1458 + this_cpu_inc(vlan->pcpu_stats->rx_errors);
1459 + }
1460 +diff --git a/include/linux/mutex.h b/include/linux/mutex.h
1461 +index 3093dd1624243..8f7cdf83f3592 100644
1462 +--- a/include/linux/mutex.h
1463 ++++ b/include/linux/mutex.h
1464 +@@ -184,7 +184,7 @@ extern void mutex_lock_io(struct mutex *lock);
1465 + # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
1466 + # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
1467 + # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
1468 +-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
1469 ++# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
1470 + #endif
1471 +
1472 + /*
1473 +diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
1474 +index 728d7716bf4f4..0ade4d1e4dd96 100644
1475 +--- a/include/linux/netfilter/x_tables.h
1476 ++++ b/include/linux/netfilter/x_tables.h
1477 +@@ -227,7 +227,7 @@ struct xt_table {
1478 + unsigned int valid_hooks;
1479 +
1480 + /* Man behind the curtain... */
1481 +- struct xt_table_info __rcu *private;
1482 ++ struct xt_table_info *private;
1483 +
1484 + /* Set this to THIS_MODULE if you are a module, otherwise NULL */
1485 + struct module *me;
1486 +@@ -377,7 +377,7 @@ static inline unsigned int xt_write_recseq_begin(void)
1487 + * since addend is most likely 1
1488 + */
1489 + __this_cpu_add(xt_recseq.sequence, addend);
1490 +- smp_wmb();
1491 ++ smp_mb();
1492 +
1493 + return addend;
1494 + }
1495 +@@ -449,9 +449,6 @@ xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu)
1496 +
1497 + struct nf_hook_ops *xt_hook_ops_alloc(const struct xt_table *, nf_hookfn *);
1498 +
1499 +-struct xt_table_info
1500 +-*xt_table_get_private_protected(const struct xt_table *table);
1501 +-
1502 + #ifdef CONFIG_COMPAT
1503 + #include <net/compat.h>
1504 +
1505 +diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
1506 +index a27604f99ed04..11096b561dab6 100644
1507 +--- a/include/linux/u64_stats_sync.h
1508 ++++ b/include/linux/u64_stats_sync.h
1509 +@@ -69,12 +69,13 @@ struct u64_stats_sync {
1510 + };
1511 +
1512 +
1513 ++#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
1514 ++#define u64_stats_init(syncp) seqcount_init(&(syncp)->seq)
1515 ++#else
1516 + static inline void u64_stats_init(struct u64_stats_sync *syncp)
1517 + {
1518 +-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
1519 +- seqcount_init(&syncp->seq);
1520 +-#endif
1521 + }
1522 ++#endif
1523 +
1524 + static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
1525 + {
1526 +diff --git a/include/net/red.h b/include/net/red.h
1527 +index e21e7fd4fe077..8fe55b8b2fb81 100644
1528 +--- a/include/net/red.h
1529 ++++ b/include/net/red.h
1530 +@@ -168,7 +168,8 @@ static inline void red_set_vars(struct red_vars *v)
1531 + v->qcount = -1;
1532 + }
1533 +
1534 +-static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_log)
1535 ++static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog,
1536 ++ u8 Scell_log, u8 *stab)
1537 + {
1538 + if (fls(qth_min) + Wlog > 32)
1539 + return false;
1540 +@@ -178,6 +179,13 @@ static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_
1541 + return false;
1542 + if (qth_max < qth_min)
1543 + return false;
1544 ++ if (stab) {
1545 ++ int i;
1546 ++
1547 ++ for (i = 0; i < RED_STAB_SIZE; i++)
1548 ++ if (stab[i] >= 32)
1549 ++ return false;
1550 ++ }
1551 + return true;
1552 + }
1553 +
1554 +diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
1555 +index 0bbaa54884233..3d961a3cf3c4a 100644
1556 +--- a/include/net/rtnetlink.h
1557 ++++ b/include/net/rtnetlink.h
1558 +@@ -33,6 +33,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
1559 + *
1560 + * @list: Used internally
1561 + * @kind: Identifier
1562 ++ * @netns_refund: Physical device, move to init_net on netns exit
1563 + * @maxtype: Highest device specific netlink attribute number
1564 + * @policy: Netlink policy for device specific attribute validation
1565 + * @validate: Optional validation function for netlink/changelink parameters
1566 +@@ -64,6 +65,7 @@ struct rtnl_link_ops {
1567 + size_t priv_size;
1568 + void (*setup)(struct net_device *dev);
1569 +
1570 ++ bool netns_refund;
1571 + unsigned int maxtype;
1572 + const struct nla_policy *policy;
1573 + int (*validate)(struct nlattr *tb[],
1574 +diff --git a/net/core/dev.c b/net/core/dev.c
1575 +index 5d9800804d4a4..7803bd9628dc2 100644
1576 +--- a/net/core/dev.c
1577 ++++ b/net/core/dev.c
1578 +@@ -9708,7 +9708,7 @@ static void __net_exit default_device_exit(struct net *net)
1579 + continue;
1580 +
1581 + /* Leave virtual devices for the generic cleanup */
1582 +- if (dev->rtnl_link_ops)
1583 ++ if (dev->rtnl_link_ops && !dev->rtnl_link_ops->netns_refund)
1584 + continue;
1585 +
1586 + /* Push remaining network devices to init_net */
1587 +diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
1588 +index a2cae543a285a..10d8f95eb7712 100644
1589 +--- a/net/ipv4/netfilter/arp_tables.c
1590 ++++ b/net/ipv4/netfilter/arp_tables.c
1591 +@@ -202,7 +202,7 @@ unsigned int arpt_do_table(struct sk_buff *skb,
1592 +
1593 + local_bh_disable();
1594 + addend = xt_write_recseq_begin();
1595 +- private = rcu_access_pointer(table->private);
1596 ++ private = READ_ONCE(table->private); /* Address dependency. */
1597 + cpu = smp_processor_id();
1598 + table_base = private->entries;
1599 + jumpstack = (struct arpt_entry **)private->jumpstack[cpu];
1600 +@@ -648,7 +648,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
1601 + {
1602 + unsigned int countersize;
1603 + struct xt_counters *counters;
1604 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1605 ++ const struct xt_table_info *private = table->private;
1606 +
1607 + /* We need atomic snapshot of counters: rest doesn't change
1608 + * (other than comefrom, which userspace doesn't care
1609 +@@ -672,7 +672,7 @@ static int copy_entries_to_user(unsigned int total_size,
1610 + unsigned int off, num;
1611 + const struct arpt_entry *e;
1612 + struct xt_counters *counters;
1613 +- struct xt_table_info *private = xt_table_get_private_protected(table);
1614 ++ struct xt_table_info *private = table->private;
1615 + int ret = 0;
1616 + void *loc_cpu_entry;
1617 +
1618 +@@ -807,7 +807,7 @@ static int get_info(struct net *net, void __user *user,
1619 + t = xt_request_find_table_lock(net, NFPROTO_ARP, name);
1620 + if (!IS_ERR(t)) {
1621 + struct arpt_getinfo info;
1622 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1623 ++ const struct xt_table_info *private = t->private;
1624 + #ifdef CONFIG_COMPAT
1625 + struct xt_table_info tmp;
1626 +
1627 +@@ -860,7 +860,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr,
1628 +
1629 + t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
1630 + if (!IS_ERR(t)) {
1631 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1632 ++ const struct xt_table_info *private = t->private;
1633 +
1634 + if (get.size == private->size)
1635 + ret = copy_entries_to_user(private->size,
1636 +@@ -1019,7 +1019,7 @@ static int do_add_counters(struct net *net, const void __user *user,
1637 + }
1638 +
1639 + local_bh_disable();
1640 +- private = xt_table_get_private_protected(t);
1641 ++ private = t->private;
1642 + if (private->number != tmp.num_counters) {
1643 + ret = -EINVAL;
1644 + goto unlock_up_free;
1645 +@@ -1356,7 +1356,7 @@ static int compat_copy_entries_to_user(unsigned int total_size,
1646 + void __user *userptr)
1647 + {
1648 + struct xt_counters *counters;
1649 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1650 ++ const struct xt_table_info *private = table->private;
1651 + void __user *pos;
1652 + unsigned int size;
1653 + int ret = 0;
1654 +@@ -1405,7 +1405,7 @@ static int compat_get_entries(struct net *net,
1655 + xt_compat_lock(NFPROTO_ARP);
1656 + t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
1657 + if (!IS_ERR(t)) {
1658 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1659 ++ const struct xt_table_info *private = t->private;
1660 + struct xt_table_info info;
1661 +
1662 + ret = compat_table_info(private, &info);
1663 +diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
1664 +index 6672172a7512d..e77872c93c206 100644
1665 +--- a/net/ipv4/netfilter/ip_tables.c
1666 ++++ b/net/ipv4/netfilter/ip_tables.c
1667 +@@ -261,7 +261,7 @@ ipt_do_table(struct sk_buff *skb,
1668 + WARN_ON(!(table->valid_hooks & (1 << hook)));
1669 + local_bh_disable();
1670 + addend = xt_write_recseq_begin();
1671 +- private = rcu_access_pointer(table->private);
1672 ++ private = READ_ONCE(table->private); /* Address dependency. */
1673 + cpu = smp_processor_id();
1674 + table_base = private->entries;
1675 + jumpstack = (struct ipt_entry **)private->jumpstack[cpu];
1676 +@@ -794,7 +794,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
1677 + {
1678 + unsigned int countersize;
1679 + struct xt_counters *counters;
1680 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1681 ++ const struct xt_table_info *private = table->private;
1682 +
1683 + /* We need atomic snapshot of counters: rest doesn't change
1684 + (other than comefrom, which userspace doesn't care
1685 +@@ -818,7 +818,7 @@ copy_entries_to_user(unsigned int total_size,
1686 + unsigned int off, num;
1687 + const struct ipt_entry *e;
1688 + struct xt_counters *counters;
1689 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1690 ++ const struct xt_table_info *private = table->private;
1691 + int ret = 0;
1692 + const void *loc_cpu_entry;
1693 +
1694 +@@ -968,7 +968,7 @@ static int get_info(struct net *net, void __user *user,
1695 + t = xt_request_find_table_lock(net, AF_INET, name);
1696 + if (!IS_ERR(t)) {
1697 + struct ipt_getinfo info;
1698 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1699 ++ const struct xt_table_info *private = t->private;
1700 + #ifdef CONFIG_COMPAT
1701 + struct xt_table_info tmp;
1702 +
1703 +@@ -1022,7 +1022,7 @@ get_entries(struct net *net, struct ipt_get_entries __user *uptr,
1704 +
1705 + t = xt_find_table_lock(net, AF_INET, get.name);
1706 + if (!IS_ERR(t)) {
1707 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1708 ++ const struct xt_table_info *private = t->private;
1709 + if (get.size == private->size)
1710 + ret = copy_entries_to_user(private->size,
1711 + t, uptr->entrytable);
1712 +@@ -1178,7 +1178,7 @@ do_add_counters(struct net *net, const void __user *user,
1713 + }
1714 +
1715 + local_bh_disable();
1716 +- private = xt_table_get_private_protected(t);
1717 ++ private = t->private;
1718 + if (private->number != tmp.num_counters) {
1719 + ret = -EINVAL;
1720 + goto unlock_up_free;
1721 +@@ -1573,7 +1573,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
1722 + void __user *userptr)
1723 + {
1724 + struct xt_counters *counters;
1725 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1726 ++ const struct xt_table_info *private = table->private;
1727 + void __user *pos;
1728 + unsigned int size;
1729 + int ret = 0;
1730 +@@ -1619,7 +1619,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr,
1731 + xt_compat_lock(AF_INET);
1732 + t = xt_find_table_lock(net, AF_INET, get.name);
1733 + if (!IS_ERR(t)) {
1734 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1735 ++ const struct xt_table_info *private = t->private;
1736 + struct xt_table_info info;
1737 + ret = compat_table_info(private, &info);
1738 + if (!ret && get.size == info.size)
1739 +diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
1740 +index 3b067d5a62ee0..daf2e9e9193d1 100644
1741 +--- a/net/ipv6/netfilter/ip6_tables.c
1742 ++++ b/net/ipv6/netfilter/ip6_tables.c
1743 +@@ -283,7 +283,7 @@ ip6t_do_table(struct sk_buff *skb,
1744 +
1745 + local_bh_disable();
1746 + addend = xt_write_recseq_begin();
1747 +- private = rcu_access_pointer(table->private);
1748 ++ private = READ_ONCE(table->private); /* Address dependency. */
1749 + cpu = smp_processor_id();
1750 + table_base = private->entries;
1751 + jumpstack = (struct ip6t_entry **)private->jumpstack[cpu];
1752 +@@ -810,7 +810,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table)
1753 + {
1754 + unsigned int countersize;
1755 + struct xt_counters *counters;
1756 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1757 ++ const struct xt_table_info *private = table->private;
1758 +
1759 + /* We need atomic snapshot of counters: rest doesn't change
1760 + (other than comefrom, which userspace doesn't care
1761 +@@ -834,7 +834,7 @@ copy_entries_to_user(unsigned int total_size,
1762 + unsigned int off, num;
1763 + const struct ip6t_entry *e;
1764 + struct xt_counters *counters;
1765 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1766 ++ const struct xt_table_info *private = table->private;
1767 + int ret = 0;
1768 + const void *loc_cpu_entry;
1769 +
1770 +@@ -984,7 +984,7 @@ static int get_info(struct net *net, void __user *user,
1771 + t = xt_request_find_table_lock(net, AF_INET6, name);
1772 + if (!IS_ERR(t)) {
1773 + struct ip6t_getinfo info;
1774 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1775 ++ const struct xt_table_info *private = t->private;
1776 + #ifdef CONFIG_COMPAT
1777 + struct xt_table_info tmp;
1778 +
1779 +@@ -1039,7 +1039,7 @@ get_entries(struct net *net, struct ip6t_get_entries __user *uptr,
1780 +
1781 + t = xt_find_table_lock(net, AF_INET6, get.name);
1782 + if (!IS_ERR(t)) {
1783 +- struct xt_table_info *private = xt_table_get_private_protected(t);
1784 ++ struct xt_table_info *private = t->private;
1785 + if (get.size == private->size)
1786 + ret = copy_entries_to_user(private->size,
1787 + t, uptr->entrytable);
1788 +@@ -1194,7 +1194,7 @@ do_add_counters(struct net *net, const void __user *user, unsigned int len,
1789 + }
1790 +
1791 + local_bh_disable();
1792 +- private = xt_table_get_private_protected(t);
1793 ++ private = t->private;
1794 + if (private->number != tmp.num_counters) {
1795 + ret = -EINVAL;
1796 + goto unlock_up_free;
1797 +@@ -1582,7 +1582,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
1798 + void __user *userptr)
1799 + {
1800 + struct xt_counters *counters;
1801 +- const struct xt_table_info *private = xt_table_get_private_protected(table);
1802 ++ const struct xt_table_info *private = table->private;
1803 + void __user *pos;
1804 + unsigned int size;
1805 + int ret = 0;
1806 +@@ -1628,7 +1628,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr,
1807 + xt_compat_lock(AF_INET6);
1808 + t = xt_find_table_lock(net, AF_INET6, get.name);
1809 + if (!IS_ERR(t)) {
1810 +- const struct xt_table_info *private = xt_table_get_private_protected(t);
1811 ++ const struct xt_table_info *private = t->private;
1812 + struct xt_table_info info;
1813 + ret = compat_table_info(private, &info);
1814 + if (!ret && get.size == info.size)
1815 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1816 +index 9926455dd546d..f484f9fc62ca9 100644
1817 +--- a/net/mac80211/cfg.c
1818 ++++ b/net/mac80211/cfg.c
1819 +@@ -2777,14 +2777,14 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
1820 + continue;
1821 +
1822 + for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) {
1823 +- if (~sdata->rc_rateidx_mcs_mask[i][j]) {
1824 ++ if (sdata->rc_rateidx_mcs_mask[i][j] != 0xff) {
1825 + sdata->rc_has_mcs_mask[i] = true;
1826 + break;
1827 + }
1828 + }
1829 +
1830 + for (j = 0; j < NL80211_VHT_NSS_MAX; j++) {
1831 +- if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) {
1832 ++ if (sdata->rc_rateidx_vht_mcs_mask[i][j] != 0xffff) {
1833 + sdata->rc_has_vht_mcs_mask[i] = true;
1834 + break;
1835 + }
1836 +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
1837 +index f0f5fedb8caac..fa13eef25f2c9 100644
1838 +--- a/net/mac80211/ibss.c
1839 ++++ b/net/mac80211/ibss.c
1840 +@@ -1861,6 +1861,8 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1841 +
1842 + /* remove beacon */
1843 + kfree(sdata->u.ibss.ie);
1844 ++ sdata->u.ibss.ie = NULL;
1845 ++ sdata->u.ibss.ie_len = 0;
1846 +
1847 + /* on the next join, re-program HT parameters */
1848 + memset(&ifibss->ht_capa, 0, sizeof(ifibss->ht_capa));
1849 +diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
1850 +index 0b89609a6e9d6..15c9fbcd32f29 100644
1851 +--- a/net/netfilter/nf_conntrack_netlink.c
1852 ++++ b/net/netfilter/nf_conntrack_netlink.c
1853 +@@ -2656,6 +2656,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb,
1854 + memset(&m, 0xFF, sizeof(m));
1855 + memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3));
1856 + m.src.u.all = mask->src.u.all;
1857 ++ m.src.l3num = tuple->src.l3num;
1858 + m.dst.protonum = tuple->dst.protonum;
1859 +
1860 + nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED);
1861 +diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
1862 +index 1314de5f317f0..c9fe35118b33a 100644
1863 +--- a/net/netfilter/x_tables.c
1864 ++++ b/net/netfilter/x_tables.c
1865 +@@ -1356,14 +1356,6 @@ struct xt_counters *xt_counters_alloc(unsigned int counters)
1866 + }
1867 + EXPORT_SYMBOL(xt_counters_alloc);
1868 +
1869 +-struct xt_table_info
1870 +-*xt_table_get_private_protected(const struct xt_table *table)
1871 +-{
1872 +- return rcu_dereference_protected(table->private,
1873 +- mutex_is_locked(&xt[table->af].mutex));
1874 +-}
1875 +-EXPORT_SYMBOL(xt_table_get_private_protected);
1876 +-
1877 + struct xt_table_info *
1878 + xt_replace_table(struct xt_table *table,
1879 + unsigned int num_counters,
1880 +@@ -1371,6 +1363,7 @@ xt_replace_table(struct xt_table *table,
1881 + int *error)
1882 + {
1883 + struct xt_table_info *private;
1884 ++ unsigned int cpu;
1885 + int ret;
1886 +
1887 + ret = xt_jumpstack_alloc(newinfo);
1888 +@@ -1380,20 +1373,47 @@ xt_replace_table(struct xt_table *table,
1889 + }
1890 +
1891 + /* Do the substitution. */
1892 +- private = xt_table_get_private_protected(table);
1893 ++ local_bh_disable();
1894 ++ private = table->private;
1895 +
1896 + /* Check inside lock: is the old number correct? */
1897 + if (num_counters != private->number) {
1898 + pr_debug("num_counters != table->private->number (%u/%u)\n",
1899 + num_counters, private->number);
1900 ++ local_bh_enable();
1901 + *error = -EAGAIN;
1902 + return NULL;
1903 + }
1904 +
1905 + newinfo->initial_entries = private->initial_entries;
1906 ++ /*
1907 ++ * Ensure contents of newinfo are visible before assigning to
1908 ++ * private.
1909 ++ */
1910 ++ smp_wmb();
1911 ++ table->private = newinfo;
1912 ++
1913 ++ /* make sure all cpus see new ->private value */
1914 ++ smp_mb();
1915 +
1916 +- rcu_assign_pointer(table->private, newinfo);
1917 +- synchronize_rcu();
1918 ++ /*
1919 ++ * Even though table entries have now been swapped, other CPU's
1920 ++ * may still be using the old entries...
1921 ++ */
1922 ++ local_bh_enable();
1923 ++
1924 ++ /* ... so wait for even xt_recseq on all cpus */
1925 ++ for_each_possible_cpu(cpu) {
1926 ++ seqcount_t *s = &per_cpu(xt_recseq, cpu);
1927 ++ u32 seq = raw_read_seqcount(s);
1928 ++
1929 ++ if (seq & 1) {
1930 ++ do {
1931 ++ cond_resched();
1932 ++ cpu_relax();
1933 ++ } while (seq == raw_read_seqcount(s));
1934 ++ }
1935 ++ }
1936 +
1937 + #ifdef CONFIG_AUDIT
1938 + if (audit_enabled) {
1939 +@@ -1434,12 +1454,12 @@ struct xt_table *xt_register_table(struct net *net,
1940 + }
1941 +
1942 + /* Simplifies replace_table code. */
1943 +- rcu_assign_pointer(table->private, bootstrap);
1944 ++ table->private = bootstrap;
1945 +
1946 + if (!xt_replace_table(table, 0, newinfo, &ret))
1947 + goto unlock;
1948 +
1949 +- private = xt_table_get_private_protected(table);
1950 ++ private = table->private;
1951 + pr_debug("table->private->number = %u\n", private->number);
1952 +
1953 + /* save number of initial entries */
1954 +@@ -1462,8 +1482,7 @@ void *xt_unregister_table(struct xt_table *table)
1955 + struct xt_table_info *private;
1956 +
1957 + mutex_lock(&xt[table->af].mutex);
1958 +- private = xt_table_get_private_protected(table);
1959 +- RCU_INIT_POINTER(table->private, NULL);
1960 ++ private = table->private;
1961 + list_del(&table->list);
1962 + mutex_unlock(&xt[table->af].mutex);
1963 + kfree(table);
1964 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
1965 +index 0c7cacd854e06..43f63d0606ec1 100644
1966 +--- a/net/qrtr/qrtr.c
1967 ++++ b/net/qrtr/qrtr.c
1968 +@@ -868,6 +868,11 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg,
1969 + rc = copied;
1970 +
1971 + if (addr) {
1972 ++ /* There is an anonymous 2-byte hole after sq_family,
1973 ++ * make sure to clear it.
1974 ++ */
1975 ++ memset(addr, 0, sizeof(*addr));
1976 ++
1977 + cb = (struct qrtr_cb *)skb->cb;
1978 + addr->sq_family = AF_QIPCRTR;
1979 + addr->sq_node = cb->src_node;
1980 +diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
1981 +index d058397d284bf..8b72aed77ed4f 100644
1982 +--- a/net/sched/sch_choke.c
1983 ++++ b/net/sched/sch_choke.c
1984 +@@ -355,6 +355,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt,
1985 + struct sk_buff **old = NULL;
1986 + unsigned int mask;
1987 + u32 max_P;
1988 ++ u8 *stab;
1989 +
1990 + if (opt == NULL)
1991 + return -EINVAL;
1992 +@@ -370,8 +371,8 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt,
1993 + max_P = tb[TCA_CHOKE_MAX_P] ? nla_get_u32(tb[TCA_CHOKE_MAX_P]) : 0;
1994 +
1995 + ctl = nla_data(tb[TCA_CHOKE_PARMS]);
1996 +-
1997 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
1998 ++ stab = nla_data(tb[TCA_CHOKE_STAB]);
1999 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab))
2000 + return -EINVAL;
2001 +
2002 + if (ctl->limit > CHOKE_MAX_QUEUE)
2003 +@@ -421,7 +422,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt,
2004 +
2005 + red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog,
2006 + ctl->Plog, ctl->Scell_log,
2007 +- nla_data(tb[TCA_CHOKE_STAB]),
2008 ++ stab,
2009 + max_P);
2010 + red_set_vars(&q->vars);
2011 +
2012 +diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
2013 +index 6f94bca75520b..db7a91a29b59c 100644
2014 +--- a/net/sched/sch_gred.c
2015 ++++ b/net/sched/sch_gred.c
2016 +@@ -357,7 +357,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp,
2017 + struct gred_sched *table = qdisc_priv(sch);
2018 + struct gred_sched_data *q = table->tab[dp];
2019 +
2020 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
2021 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab))
2022 + return -EINVAL;
2023 +
2024 + if (!q) {
2025 +diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
2026 +index a3dc2118539b9..e42f890fa1478 100644
2027 +--- a/net/sched/sch_red.c
2028 ++++ b/net/sched/sch_red.c
2029 +@@ -199,6 +199,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt,
2030 + struct Qdisc *child = NULL;
2031 + int err;
2032 + u32 max_P;
2033 ++ u8 *stab;
2034 +
2035 + if (opt == NULL)
2036 + return -EINVAL;
2037 +@@ -214,7 +215,9 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt,
2038 + max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0;
2039 +
2040 + ctl = nla_data(tb[TCA_RED_PARMS]);
2041 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
2042 ++ stab = nla_data(tb[TCA_RED_STAB]);
2043 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog,
2044 ++ ctl->Scell_log, stab))
2045 + return -EINVAL;
2046 +
2047 + if (ctl->limit > 0) {
2048 +@@ -240,7 +243,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt,
2049 + red_set_parms(&q->parms,
2050 + ctl->qth_min, ctl->qth_max, ctl->Wlog,
2051 + ctl->Plog, ctl->Scell_log,
2052 +- nla_data(tb[TCA_RED_STAB]),
2053 ++ stab,
2054 + max_P);
2055 + red_set_vars(&q->vars);
2056 +
2057 +diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
2058 +index 74f697c4a4d30..1bfdf90fa0cce 100644
2059 +--- a/net/sched/sch_sfq.c
2060 ++++ b/net/sched/sch_sfq.c
2061 +@@ -651,7 +651,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
2062 + }
2063 +
2064 + if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
2065 +- ctl_v1->Wlog, ctl_v1->Scell_log))
2066 ++ ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
2067 + return -EINVAL;
2068 + if (ctl_v1 && ctl_v1->qth_min) {
2069 + p = kmalloc(sizeof(*p), GFP_KERNEL);
2070 +diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
2071 +index 3624557550a1f..6f57d38443c73 100644
2072 +--- a/tools/lib/bpf/Makefile
2073 ++++ b/tools/lib/bpf/Makefile
2074 +@@ -179,7 +179,7 @@ define do_install
2075 + if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
2076 + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
2077 + fi; \
2078 +- $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2'
2079 ++ $(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
2080 + endef
2081 +
2082 + install_lib: all_cmd
2083 +diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
2084 +index 40c93d8158b5a..f7c4dcb9d5821 100644
2085 +--- a/tools/perf/util/auxtrace.c
2086 ++++ b/tools/perf/util/auxtrace.c
2087 +@@ -256,10 +256,6 @@ static int auxtrace_queues__queue_buffer(struct auxtrace_queues *queues,
2088 + queue->set = true;
2089 + queue->tid = buffer->tid;
2090 + queue->cpu = buffer->cpu;
2091 +- } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) {
2092 +- pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n",
2093 +- queue->cpu, queue->tid, buffer->cpu, buffer->tid);
2094 +- return -EINVAL;
2095 + }
2096 +
2097 + buffer->buffer_nr = queues->next_buffer_nr++;