Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Sun, 07 Feb 2021 14:40:08
Message-Id: 1612708773.7006cd0e76273c68b9b7f1a6e924b8e11541e064.alicef@gentoo
1 commit: 7006cd0e76273c68b9b7f1a6e924b8e11541e064
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 7 14:39:25 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 7 14:39:33 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7006cd0e
7
8 Linux patch 4.19.174
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1173_linux-4.19.174.patch | 640 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 644 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 0bd69fd..1d2c2d9 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -731,6 +731,10 @@ Patch: 1172_linux-4.19.173.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.173
23
24 +Patch: 1173_linux-4.19.174.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.174
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/1173_linux-4.19.174.patch b/1173_linux-4.19.174.patch
33 new file mode 100644
34 index 0000000..33d2ee8
35 --- /dev/null
36 +++ b/1173_linux-4.19.174.patch
37 @@ -0,0 +1,640 @@
38 +diff --git a/Makefile b/Makefile
39 +index 5770b9d8026b9..8f326d0652a73 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 = 173
47 ++SUBLEVEL = 174
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
52 +index 04addd6e0a4a2..2571e2017a8bb 100644
53 +--- a/arch/x86/include/asm/msr.h
54 ++++ b/arch/x86/include/asm/msr.h
55 +@@ -88,7 +88,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {}
56 + * think of extending them - you will be slapped with a stinking trout or a frozen
57 + * shark will reach you, wherever you are! You've been warned.
58 + */
59 +-static inline unsigned long long notrace __rdmsr(unsigned int msr)
60 ++static __always_inline unsigned long long __rdmsr(unsigned int msr)
61 + {
62 + DECLARE_ARGS(val, low, high);
63 +
64 +@@ -100,7 +100,7 @@ static inline unsigned long long notrace __rdmsr(unsigned int msr)
65 + return EAX_EDX_VAL(val, low, high);
66 + }
67 +
68 +-static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high)
69 ++static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high)
70 + {
71 + asm volatile("1: wrmsr\n"
72 + "2:\n"
73 +diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
74 +index 551b71a24b857..3bdab6eb33bf3 100644
75 +--- a/drivers/acpi/thermal.c
76 ++++ b/drivers/acpi/thermal.c
77 +@@ -188,6 +188,8 @@ struct acpi_thermal {
78 + int tz_enabled;
79 + int kelvin_offset;
80 + struct work_struct thermal_check_work;
81 ++ struct mutex thermal_check_lock;
82 ++ refcount_t thermal_check_count;
83 + };
84 +
85 + /* --------------------------------------------------------------------------
86 +@@ -513,17 +515,6 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
87 + return 0;
88 + }
89 +
90 +-static void acpi_thermal_check(void *data)
91 +-{
92 +- struct acpi_thermal *tz = data;
93 +-
94 +- if (!tz->tz_enabled)
95 +- return;
96 +-
97 +- thermal_zone_device_update(tz->thermal_zone,
98 +- THERMAL_EVENT_UNSPECIFIED);
99 +-}
100 +-
101 + /* sys I/F for generic thermal sysfs support */
102 +
103 + static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
104 +@@ -557,6 +548,8 @@ static int thermal_get_mode(struct thermal_zone_device *thermal,
105 + return 0;
106 + }
107 +
108 ++static void acpi_thermal_check_fn(struct work_struct *work);
109 ++
110 + static int thermal_set_mode(struct thermal_zone_device *thermal,
111 + enum thermal_device_mode mode)
112 + {
113 +@@ -582,7 +575,7 @@ static int thermal_set_mode(struct thermal_zone_device *thermal,
114 + ACPI_DEBUG_PRINT((ACPI_DB_INFO,
115 + "%s kernel ACPI thermal control\n",
116 + tz->tz_enabled ? "Enable" : "Disable"));
117 +- acpi_thermal_check(tz);
118 ++ acpi_thermal_check_fn(&tz->thermal_check_work);
119 + }
120 + return 0;
121 + }
122 +@@ -951,6 +944,12 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
123 + Driver Interface
124 + -------------------------------------------------------------------------- */
125 +
126 ++static void acpi_queue_thermal_check(struct acpi_thermal *tz)
127 ++{
128 ++ if (!work_pending(&tz->thermal_check_work))
129 ++ queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
130 ++}
131 ++
132 + static void acpi_thermal_notify(struct acpi_device *device, u32 event)
133 + {
134 + struct acpi_thermal *tz = acpi_driver_data(device);
135 +@@ -961,17 +960,17 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event)
136 +
137 + switch (event) {
138 + case ACPI_THERMAL_NOTIFY_TEMPERATURE:
139 +- acpi_thermal_check(tz);
140 ++ acpi_queue_thermal_check(tz);
141 + break;
142 + case ACPI_THERMAL_NOTIFY_THRESHOLDS:
143 + acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS);
144 +- acpi_thermal_check(tz);
145 ++ acpi_queue_thermal_check(tz);
146 + acpi_bus_generate_netlink_event(device->pnp.device_class,
147 + dev_name(&device->dev), event, 0);
148 + break;
149 + case ACPI_THERMAL_NOTIFY_DEVICES:
150 + acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES);
151 +- acpi_thermal_check(tz);
152 ++ acpi_queue_thermal_check(tz);
153 + acpi_bus_generate_netlink_event(device->pnp.device_class,
154 + dev_name(&device->dev), event, 0);
155 + break;
156 +@@ -1071,7 +1070,27 @@ static void acpi_thermal_check_fn(struct work_struct *work)
157 + {
158 + struct acpi_thermal *tz = container_of(work, struct acpi_thermal,
159 + thermal_check_work);
160 +- acpi_thermal_check(tz);
161 ++
162 ++ if (!tz->tz_enabled)
163 ++ return;
164 ++ /*
165 ++ * In general, it is not sufficient to check the pending bit, because
166 ++ * subsequent instances of this function may be queued after one of them
167 ++ * has started running (e.g. if _TMP sleeps). Avoid bailing out if just
168 ++ * one of them is running, though, because it may have done the actual
169 ++ * check some time ago, so allow at least one of them to block on the
170 ++ * mutex while another one is running the update.
171 ++ */
172 ++ if (!refcount_dec_not_one(&tz->thermal_check_count))
173 ++ return;
174 ++
175 ++ mutex_lock(&tz->thermal_check_lock);
176 ++
177 ++ thermal_zone_device_update(tz->thermal_zone, THERMAL_EVENT_UNSPECIFIED);
178 ++
179 ++ refcount_inc(&tz->thermal_check_count);
180 ++
181 ++ mutex_unlock(&tz->thermal_check_lock);
182 + }
183 +
184 + static int acpi_thermal_add(struct acpi_device *device)
185 +@@ -1103,6 +1122,8 @@ static int acpi_thermal_add(struct acpi_device *device)
186 + if (result)
187 + goto free_memory;
188 +
189 ++ refcount_set(&tz->thermal_check_count, 3);
190 ++ mutex_init(&tz->thermal_check_lock);
191 + INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
192 +
193 + pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
194 +@@ -1168,7 +1189,7 @@ static int acpi_thermal_resume(struct device *dev)
195 + tz->state.active |= tz->trips.active[i].flags.enabled;
196 + }
197 +
198 +- queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
199 ++ acpi_queue_thermal_check(tz);
200 +
201 + return AE_OK;
202 + }
203 +diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
204 +index c0bba680d4a88..613f03f9d9eca 100644
205 +--- a/drivers/net/dsa/bcm_sf2.c
206 ++++ b/drivers/net/dsa/bcm_sf2.c
207 +@@ -423,15 +423,19 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
208 + /* Find our integrated MDIO bus node */
209 + dn = of_find_compatible_node(NULL, NULL, "brcm,unimac-mdio");
210 + priv->master_mii_bus = of_mdio_find_bus(dn);
211 +- if (!priv->master_mii_bus)
212 ++ if (!priv->master_mii_bus) {
213 ++ of_node_put(dn);
214 + return -EPROBE_DEFER;
215 ++ }
216 +
217 + get_device(&priv->master_mii_bus->dev);
218 + priv->master_mii_dn = dn;
219 +
220 + priv->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
221 +- if (!priv->slave_mii_bus)
222 ++ if (!priv->slave_mii_bus) {
223 ++ of_node_put(dn);
224 + return -ENOMEM;
225 ++ }
226 +
227 + priv->slave_mii_bus->priv = priv;
228 + priv->slave_mii_bus->name = "sf2 slave mii";
229 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
230 +index d762eb491a7c3..68d5971c200a1 100644
231 +--- a/drivers/net/ethernet/ibm/ibmvnic.c
232 ++++ b/drivers/net/ethernet/ibm/ibmvnic.c
233 +@@ -4434,6 +4434,12 @@ static void ibmvnic_tasklet(void *data)
234 + while (!done) {
235 + /* Pull all the valid messages off the CRQ */
236 + while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
237 ++ /* This barrier makes sure ibmvnic_next_crq()'s
238 ++ * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
239 ++ * before ibmvnic_handle_crq()'s
240 ++ * switch(gen_crq->first) and switch(gen_crq->cmd).
241 ++ */
242 ++ dma_rmb();
243 + ibmvnic_handle_crq(crq, adapter);
244 + crq->generic.first = 0;
245 + }
246 +diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
247 +index 593c77dbde2eb..106f53f333242 100644
248 +--- a/drivers/phy/motorola/phy-cpcap-usb.c
249 ++++ b/drivers/phy/motorola/phy-cpcap-usb.c
250 +@@ -623,35 +623,42 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)
251 + generic_phy = devm_phy_create(ddata->dev, NULL, &ops);
252 + if (IS_ERR(generic_phy)) {
253 + error = PTR_ERR(generic_phy);
254 +- return PTR_ERR(generic_phy);
255 ++ goto out_reg_disable;
256 + }
257 +
258 + phy_set_drvdata(generic_phy, ddata);
259 +
260 + phy_provider = devm_of_phy_provider_register(ddata->dev,
261 + of_phy_simple_xlate);
262 +- if (IS_ERR(phy_provider))
263 +- return PTR_ERR(phy_provider);
264 ++ if (IS_ERR(phy_provider)) {
265 ++ error = PTR_ERR(phy_provider);
266 ++ goto out_reg_disable;
267 ++ }
268 +
269 + error = cpcap_usb_init_optional_pins(ddata);
270 + if (error)
271 +- return error;
272 ++ goto out_reg_disable;
273 +
274 + cpcap_usb_init_optional_gpios(ddata);
275 +
276 + error = cpcap_usb_init_iio(ddata);
277 + if (error)
278 +- return error;
279 ++ goto out_reg_disable;
280 +
281 + error = cpcap_usb_init_interrupts(pdev, ddata);
282 + if (error)
283 +- return error;
284 ++ goto out_reg_disable;
285 +
286 + usb_add_phy_dev(&ddata->phy);
287 + atomic_set(&ddata->active, 1);
288 + schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1));
289 +
290 + return 0;
291 ++
292 ++out_reg_disable:
293 ++ regulator_disable(ddata->vusb);
294 ++
295 ++ return error;
296 + }
297 +
298 + static int cpcap_usb_phy_remove(struct platform_device *pdev)
299 +diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
300 +index f5774372c3871..cf8587f96fc45 100644
301 +--- a/drivers/platform/x86/intel-vbtn.c
302 ++++ b/drivers/platform/x86/intel-vbtn.c
303 +@@ -203,6 +203,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
304 + DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271"),
305 + },
306 + },
307 ++ {
308 ++ .matches = {
309 ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
310 ++ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7352"),
311 ++ },
312 ++ },
313 + {} /* Array terminator */
314 + };
315 +
316 +diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
317 +index cb204f9734913..f122a0263a1ba 100644
318 +--- a/drivers/platform/x86/touchscreen_dmi.c
319 ++++ b/drivers/platform/x86/touchscreen_dmi.c
320 +@@ -163,6 +163,16 @@ static const struct ts_dmi_data digma_citi_e200_data = {
321 + .properties = digma_citi_e200_props,
322 + };
323 +
324 ++static const struct property_entry estar_beauty_hd_props[] = {
325 ++ PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
326 ++ { }
327 ++};
328 ++
329 ++static const struct ts_dmi_data estar_beauty_hd_data = {
330 ++ .acpi_name = "GDIX1001:00",
331 ++ .properties = estar_beauty_hd_props,
332 ++};
333 ++
334 + static const struct property_entry gp_electronic_t701_props[] = {
335 + PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
336 + PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
337 +@@ -501,6 +511,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = {
338 + DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
339 + },
340 + },
341 ++ {
342 ++ /* Estar Beauty HD (MID 7316R) */
343 ++ .driver_data = (void *)&estar_beauty_hd_data,
344 ++ .matches = {
345 ++ DMI_MATCH(DMI_SYS_VENDOR, "Estar"),
346 ++ DMI_MATCH(DMI_PRODUCT_NAME, "eSTAR BEAUTY HD Intel Quad core"),
347 ++ },
348 ++ },
349 + {
350 + /* GP-electronic T701 */
351 + .driver_data = (void *)&gp_electronic_t701_data,
352 +diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
353 +index 090ab377f65e5..50078a199fea0 100644
354 +--- a/drivers/scsi/ibmvscsi/ibmvfc.c
355 ++++ b/drivers/scsi/ibmvscsi/ibmvfc.c
356 +@@ -2890,8 +2890,10 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
357 + unsigned long flags = 0;
358 +
359 + spin_lock_irqsave(shost->host_lock, flags);
360 +- if (sdev->type == TYPE_DISK)
361 ++ if (sdev->type == TYPE_DISK) {
362 + sdev->allow_restart = 1;
363 ++ blk_queue_rq_timeout(sdev->request_queue, 120 * HZ);
364 ++ }
365 + spin_unlock_irqrestore(shost->host_lock, flags);
366 + return 0;
367 + }
368 +diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
369 +index 6ba257cbc6d94..384458d1f73c3 100644
370 +--- a/drivers/scsi/libfc/fc_exch.c
371 ++++ b/drivers/scsi/libfc/fc_exch.c
372 +@@ -1631,8 +1631,13 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
373 + rc = fc_exch_done_locked(ep);
374 + WARN_ON(fc_seq_exch(sp) != ep);
375 + spin_unlock_bh(&ep->ex_lock);
376 +- if (!rc)
377 ++ if (!rc) {
378 + fc_exch_delete(ep);
379 ++ } else {
380 ++ FC_EXCH_DBG(ep, "ep is completed already,"
381 ++ "hence skip calling the resp\n");
382 ++ goto skip_resp;
383 ++ }
384 + }
385 +
386 + /*
387 +@@ -1651,6 +1656,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
388 + if (!fc_invoke_resp(ep, sp, fp))
389 + fc_frame_free(fp);
390 +
391 ++skip_resp:
392 + fc_exch_release(ep);
393 + return;
394 + rel:
395 +@@ -1907,10 +1913,16 @@ static void fc_exch_reset(struct fc_exch *ep)
396 +
397 + fc_exch_hold(ep);
398 +
399 +- if (!rc)
400 ++ if (!rc) {
401 + fc_exch_delete(ep);
402 ++ } else {
403 ++ FC_EXCH_DBG(ep, "ep is completed already,"
404 ++ "hence skip calling the resp\n");
405 ++ goto skip_resp;
406 ++ }
407 +
408 + fc_invoke_resp(ep, sp, ERR_PTR(-FC_EX_CLOSED));
409 ++skip_resp:
410 + fc_seq_set_resp(sp, NULL, ep->arg);
411 + fc_exch_release(ep);
412 + }
413 +diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
414 +index 4e46fdb2d7c99..2aaf1b7103981 100644
415 +--- a/drivers/scsi/scsi_transport_srp.c
416 ++++ b/drivers/scsi/scsi_transport_srp.c
417 +@@ -555,7 +555,14 @@ int srp_reconnect_rport(struct srp_rport *rport)
418 + res = mutex_lock_interruptible(&rport->mutex);
419 + if (res)
420 + goto out;
421 +- scsi_target_block(&shost->shost_gendev);
422 ++ if (rport->state != SRP_RPORT_FAIL_FAST)
423 ++ /*
424 ++ * sdev state must be SDEV_TRANSPORT_OFFLINE, transition
425 ++ * to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
426 ++ * later is ok though, scsi_internal_device_unblock_nowait()
427 ++ * treats SDEV_TRANSPORT_OFFLINE like SDEV_BLOCK.
428 ++ */
429 ++ scsi_target_block(&shost->shost_gendev);
430 + res = rport->state != SRP_RPORT_LOST ? i->f->reconnect(rport) : -ENODEV;
431 + pr_debug("%s (state %d): transport.reconnect() returned %d\n",
432 + dev_name(&shost->shost_gendev), rport->state, res);
433 +diff --git a/include/linux/kthread.h b/include/linux/kthread.h
434 +index c1961761311db..72308c38e06c4 100644
435 +--- a/include/linux/kthread.h
436 ++++ b/include/linux/kthread.h
437 +@@ -32,6 +32,9 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
438 + unsigned int cpu,
439 + const char *namefmt);
440 +
441 ++void kthread_set_per_cpu(struct task_struct *k, int cpu);
442 ++bool kthread_is_per_cpu(struct task_struct *k);
443 ++
444 + /**
445 + * kthread_run - create and wake a thread.
446 + * @threadfn: the function to run until signal_pending(current).
447 +diff --git a/kernel/kthread.c b/kernel/kthread.c
448 +index 2eed853ab9cc5..81abfac351272 100644
449 +--- a/kernel/kthread.c
450 ++++ b/kernel/kthread.c
451 +@@ -460,11 +460,36 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
452 + return p;
453 + kthread_bind(p, cpu);
454 + /* CPU hotplug need to bind once again when unparking the thread. */
455 +- set_bit(KTHREAD_IS_PER_CPU, &to_kthread(p)->flags);
456 + to_kthread(p)->cpu = cpu;
457 + return p;
458 + }
459 +
460 ++void kthread_set_per_cpu(struct task_struct *k, int cpu)
461 ++{
462 ++ struct kthread *kthread = to_kthread(k);
463 ++ if (!kthread)
464 ++ return;
465 ++
466 ++ WARN_ON_ONCE(!(k->flags & PF_NO_SETAFFINITY));
467 ++
468 ++ if (cpu < 0) {
469 ++ clear_bit(KTHREAD_IS_PER_CPU, &kthread->flags);
470 ++ return;
471 ++ }
472 ++
473 ++ kthread->cpu = cpu;
474 ++ set_bit(KTHREAD_IS_PER_CPU, &kthread->flags);
475 ++}
476 ++
477 ++bool kthread_is_per_cpu(struct task_struct *k)
478 ++{
479 ++ struct kthread *kthread = to_kthread(k);
480 ++ if (!kthread)
481 ++ return false;
482 ++
483 ++ return test_bit(KTHREAD_IS_PER_CPU, &kthread->flags);
484 ++}
485 ++
486 + /**
487 + * kthread_unpark - unpark a thread created by kthread_create().
488 + * @k: thread created by kthread_create().
489 +diff --git a/kernel/smpboot.c b/kernel/smpboot.c
490 +index c230c2dd48e19..84c16654d8598 100644
491 +--- a/kernel/smpboot.c
492 ++++ b/kernel/smpboot.c
493 +@@ -187,6 +187,7 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu)
494 + kfree(td);
495 + return PTR_ERR(tsk);
496 + }
497 ++ kthread_set_per_cpu(tsk, cpu);
498 + /*
499 + * Park the thread so that it could start right on the CPU
500 + * when it is available.
501 +diff --git a/kernel/sysctl.c b/kernel/sysctl.c
502 +index 4c4fd4339d330..a5d75bc38eea2 100644
503 +--- a/kernel/sysctl.c
504 ++++ b/kernel/sysctl.c
505 +@@ -68,6 +68,8 @@
506 + #include <linux/mount.h>
507 + #include <linux/pipe_fs_i.h>
508 +
509 ++#include "../lib/kstrtox.h"
510 ++
511 + #include <linux/uaccess.h>
512 + #include <asm/processor.h>
513 +
514 +@@ -2069,6 +2071,41 @@ static void proc_skip_char(char **buf, size_t *size, const char v)
515 + }
516 + }
517 +
518 ++/**
519 ++ * strtoul_lenient - parse an ASCII formatted integer from a buffer and only
520 ++ * fail on overflow
521 ++ *
522 ++ * @cp: kernel buffer containing the string to parse
523 ++ * @endp: pointer to store the trailing characters
524 ++ * @base: the base to use
525 ++ * @res: where the parsed integer will be stored
526 ++ *
527 ++ * In case of success 0 is returned and @res will contain the parsed integer,
528 ++ * @endp will hold any trailing characters.
529 ++ * This function will fail the parse on overflow. If there wasn't an overflow
530 ++ * the function will defer the decision what characters count as invalid to the
531 ++ * caller.
532 ++ */
533 ++static int strtoul_lenient(const char *cp, char **endp, unsigned int base,
534 ++ unsigned long *res)
535 ++{
536 ++ unsigned long long result;
537 ++ unsigned int rv;
538 ++
539 ++ cp = _parse_integer_fixup_radix(cp, &base);
540 ++ rv = _parse_integer(cp, base, &result);
541 ++ if ((rv & KSTRTOX_OVERFLOW) || (result != (unsigned long)result))
542 ++ return -ERANGE;
543 ++
544 ++ cp += rv;
545 ++
546 ++ if (endp)
547 ++ *endp = (char *)cp;
548 ++
549 ++ *res = (unsigned long)result;
550 ++ return 0;
551 ++}
552 ++
553 + #define TMPBUFLEN 22
554 + /**
555 + * proc_get_long - reads an ASCII formatted integer from a user buffer
556 +@@ -2112,7 +2149,8 @@ static int proc_get_long(char **buf, size_t *size,
557 + if (!isdigit(*p))
558 + return -EINVAL;
559 +
560 +- *val = simple_strtoul(p, &p, 0);
561 ++ if (strtoul_lenient(p, &p, 0, val))
562 ++ return -EINVAL;
563 +
564 + len = p - tmp;
565 +
566 +diff --git a/kernel/workqueue.c b/kernel/workqueue.c
567 +index cd98ef48345e1..78600f97ffa72 100644
568 +--- a/kernel/workqueue.c
569 ++++ b/kernel/workqueue.c
570 +@@ -1728,12 +1728,6 @@ static void worker_attach_to_pool(struct worker *worker,
571 + {
572 + mutex_lock(&wq_pool_attach_mutex);
573 +
574 +- /*
575 +- * set_cpus_allowed_ptr() will fail if the cpumask doesn't have any
576 +- * online CPUs. It'll be re-applied when any of the CPUs come up.
577 +- */
578 +- set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask);
579 +-
580 + /*
581 + * The wq_pool_attach_mutex ensures %POOL_DISASSOCIATED remains
582 + * stable across this function. See the comments above the flag
583 +@@ -1742,6 +1736,9 @@ static void worker_attach_to_pool(struct worker *worker,
584 + if (pool->flags & POOL_DISASSOCIATED)
585 + worker->flags |= WORKER_UNBOUND;
586 +
587 ++ if (worker->rescue_wq)
588 ++ set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask);
589 ++
590 + list_add_tail(&worker->node, &pool->workers);
591 + worker->pool = pool;
592 +
593 +diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c
594 +index e4e442d70c2d0..752744db11ffc 100644
595 +--- a/net/core/gen_estimator.c
596 ++++ b/net/core/gen_estimator.c
597 +@@ -84,11 +84,11 @@ static void est_timer(struct timer_list *t)
598 + u64 rate, brate;
599 +
600 + est_fetch_counters(est, &b);
601 +- brate = (b.bytes - est->last_bytes) << (10 - est->ewma_log - est->intvl_log);
602 +- brate -= (est->avbps >> est->ewma_log);
603 ++ brate = (b.bytes - est->last_bytes) << (10 - est->intvl_log);
604 ++ brate = (brate >> est->ewma_log) - (est->avbps >> est->ewma_log);
605 +
606 +- rate = (u64)(b.packets - est->last_packets) << (10 - est->ewma_log - est->intvl_log);
607 +- rate -= (est->avpps >> est->ewma_log);
608 ++ rate = (u64)(b.packets - est->last_packets) << (10 - est->intvl_log);
609 ++ rate = (rate >> est->ewma_log) - (est->avpps >> est->ewma_log);
610 +
611 + write_seqcount_begin(&est->seq);
612 + est->avbps += brate;
613 +@@ -147,6 +147,9 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
614 + if (parm->interval < -2 || parm->interval > 3)
615 + return -EINVAL;
616 +
617 ++ if (parm->ewma_log == 0 || parm->ewma_log >= 31)
618 ++ return -EINVAL;
619 ++
620 + est = kzalloc(sizeof(*est), GFP_KERNEL);
621 + if (!est)
622 + return -ENOBUFS;
623 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
624 +index 5e56719f999c4..9e92e5e2336be 100644
625 +--- a/net/mac80211/rx.c
626 ++++ b/net/mac80211/rx.c
627 +@@ -4003,6 +4003,8 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
628 +
629 + rcu_read_lock();
630 + key = rcu_dereference(sta->ptk[sta->ptk_idx]);
631 ++ if (!key)
632 ++ key = rcu_dereference(sdata->default_unicast_key);
633 + if (key) {
634 + switch (key->conf.cipher) {
635 + case WLAN_CIPHER_SUITE_TKIP:
636 +diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
637 +index b8f3cca8e58b4..264d49fea8142 100644
638 +--- a/tools/objtool/elf.c
639 ++++ b/tools/objtool/elf.c
640 +@@ -226,8 +226,11 @@ static int read_symbols(struct elf *elf)
641 +
642 + symtab = find_section_by_name(elf, ".symtab");
643 + if (!symtab) {
644 +- WARN("missing symbol table");
645 +- return -1;
646 ++ /*
647 ++ * A missing symbol table is actually possible if it's an empty
648 ++ * .o file. This can happen for thunk_64.o.
649 ++ */
650 ++ return 0;
651 + }
652 +
653 + symbols_nr = symtab->sh.sh_size / symtab->sh.sh_entsize;
654 +diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
655 +index 169a8b9719fb9..4f8335e0c9858 100644
656 +--- a/tools/testing/selftests/powerpc/alignment/alignment_handler.c
657 ++++ b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
658 +@@ -384,7 +384,6 @@ int test_alignment_handler_integer(void)
659 + LOAD_DFORM_TEST(ldu);
660 + LOAD_XFORM_TEST(ldx);
661 + LOAD_XFORM_TEST(ldux);
662 +- LOAD_DFORM_TEST(lmw);
663 + STORE_DFORM_TEST(stb);
664 + STORE_XFORM_TEST(stbx);
665 + STORE_DFORM_TEST(stbu);
666 +@@ -403,7 +402,11 @@ int test_alignment_handler_integer(void)
667 + STORE_XFORM_TEST(stdx);
668 + STORE_DFORM_TEST(stdu);
669 + STORE_XFORM_TEST(stdux);
670 ++
671 ++#ifdef __BIG_ENDIAN__
672 ++ LOAD_DFORM_TEST(lmw);
673 + STORE_DFORM_TEST(stmw);
674 ++#endif
675 +
676 + return rc;
677 + }