Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0216-5.4.117-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3635 - (show annotations) (download)
Mon Oct 24 12:34:12 2022 UTC (18 months, 4 weeks ago) by niro
File size: 24768 byte(s)
-sync kernel patches
1 diff --git a/Makefile b/Makefile
2 index cb1a446f832c0..f4115702996c5 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 5
8 PATCHLEVEL = 4
9 -SUBLEVEL = 116
10 +SUBLEVEL = 117
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 diff --git a/arch/mips/include/asm/vdso/gettimeofday.h b/arch/mips/include/asm/vdso/gettimeofday.h
15 index 0ae9b4cbc1537..83f1cbbbf217c 100644
16 --- a/arch/mips/include/asm/vdso/gettimeofday.h
17 +++ b/arch/mips/include/asm/vdso/gettimeofday.h
18 @@ -26,6 +26,12 @@
19
20 #define __VDSO_USE_SYSCALL ULLONG_MAX
21
22 +#if MIPS_ISA_REV < 6
23 +#define VDSO_SYSCALL_CLOBBERS "hi", "lo",
24 +#else
25 +#define VDSO_SYSCALL_CLOBBERS
26 +#endif
27 +
28 static __always_inline long gettimeofday_fallback(
29 struct __kernel_old_timeval *_tv,
30 struct timezone *_tz)
31 @@ -41,7 +47,9 @@ static __always_inline long gettimeofday_fallback(
32 : "=r" (ret), "=r" (error)
33 : "r" (tv), "r" (tz), "r" (nr)
34 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
35 - "$14", "$15", "$24", "$25", "hi", "lo", "memory");
36 + "$14", "$15", "$24", "$25",
37 + VDSO_SYSCALL_CLOBBERS
38 + "memory");
39
40 return error ? -ret : ret;
41 }
42 @@ -65,7 +73,9 @@ static __always_inline long clock_gettime_fallback(
43 : "=r" (ret), "=r" (error)
44 : "r" (clkid), "r" (ts), "r" (nr)
45 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
46 - "$14", "$15", "$24", "$25", "hi", "lo", "memory");
47 + "$14", "$15", "$24", "$25",
48 + VDSO_SYSCALL_CLOBBERS
49 + "memory");
50
51 return error ? -ret : ret;
52 }
53 @@ -89,7 +99,9 @@ static __always_inline int clock_getres_fallback(
54 : "=r" (ret), "=r" (error)
55 : "r" (clkid), "r" (ts), "r" (nr)
56 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
57 - "$14", "$15", "$24", "$25", "hi", "lo", "memory");
58 + "$14", "$15", "$24", "$25",
59 + VDSO_SYSCALL_CLOBBERS
60 + "memory");
61
62 return error ? -ret : ret;
63 }
64 @@ -113,7 +125,9 @@ static __always_inline long clock_gettime32_fallback(
65 : "=r" (ret), "=r" (error)
66 : "r" (clkid), "r" (ts), "r" (nr)
67 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
68 - "$14", "$15", "$24", "$25", "hi", "lo", "memory");
69 + "$14", "$15", "$24", "$25",
70 + VDSO_SYSCALL_CLOBBERS
71 + "memory");
72
73 return error ? -ret : ret;
74 }
75 @@ -133,7 +147,9 @@ static __always_inline int clock_getres32_fallback(
76 : "=r" (ret), "=r" (error)
77 : "r" (clkid), "r" (ts), "r" (nr)
78 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
79 - "$14", "$15", "$24", "$25", "hi", "lo", "memory");
80 + "$14", "$15", "$24", "$25",
81 + VDSO_SYSCALL_CLOBBERS
82 + "memory");
83
84 return error ? -ret : ret;
85 }
86 diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
87 index f9e84a0e2fa2d..4137a7342d687 100644
88 --- a/arch/x86/kernel/acpi/boot.c
89 +++ b/arch/x86/kernel/acpi/boot.c
90 @@ -1553,10 +1553,18 @@ void __init acpi_boot_table_init(void)
91 /*
92 * Initialize the ACPI boot-time table parser.
93 */
94 - if (acpi_table_init()) {
95 + if (acpi_locate_initial_tables())
96 disable_acpi();
97 - return;
98 - }
99 + else
100 + acpi_reserve_initial_tables();
101 +}
102 +
103 +int __init early_acpi_boot_init(void)
104 +{
105 + if (acpi_disabled)
106 + return 1;
107 +
108 + acpi_table_init_complete();
109
110 acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);
111
112 @@ -1569,18 +1577,9 @@ void __init acpi_boot_table_init(void)
113 } else {
114 printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
115 disable_acpi();
116 - return;
117 + return 1;
118 }
119 }
120 -}
121 -
122 -int __init early_acpi_boot_init(void)
123 -{
124 - /*
125 - * If acpi_disabled, bail out
126 - */
127 - if (acpi_disabled)
128 - return 1;
129
130 /*
131 * Process the Multiple APIC Description Table (MADT), if present
132 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
133 index 77ea96b794bd1..366875a828b32 100644
134 --- a/arch/x86/kernel/setup.c
135 +++ b/arch/x86/kernel/setup.c
136 @@ -1196,6 +1196,8 @@ void __init setup_arch(char **cmdline_p)
137 reserve_initrd();
138
139 acpi_table_upgrade();
140 + /* Look for ACPI tables and reserve memory occupied by them. */
141 + acpi_boot_table_init();
142
143 vsmp_init();
144
145 @@ -1203,11 +1205,6 @@ void __init setup_arch(char **cmdline_p)
146
147 early_platform_quirks();
148
149 - /*
150 - * Parse the ACPI tables for possible boot-time SMP configuration.
151 - */
152 - acpi_boot_table_init();
153 -
154 early_acpi_boot_init();
155
156 initmem_init();
157 diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
158 index 180ac43297631..b2cafa37df7c0 100644
159 --- a/drivers/acpi/tables.c
160 +++ b/drivers/acpi/tables.c
161 @@ -791,7 +791,7 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table,
162 }
163
164 /*
165 - * acpi_table_init()
166 + * acpi_locate_initial_tables()
167 *
168 * find RSDP, find and checksum SDT/XSDT.
169 * checksum all tables, print SDT/XSDT
170 @@ -799,7 +799,7 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table,
171 * result: sdt_entry[] is initialized
172 */
173
174 -int __init acpi_table_init(void)
175 +int __init acpi_locate_initial_tables(void)
176 {
177 acpi_status status;
178
179 @@ -814,9 +814,45 @@ int __init acpi_table_init(void)
180 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
181 if (ACPI_FAILURE(status))
182 return -EINVAL;
183 - acpi_table_initrd_scan();
184
185 + return 0;
186 +}
187 +
188 +void __init acpi_reserve_initial_tables(void)
189 +{
190 + int i;
191 +
192 + for (i = 0; i < ACPI_MAX_TABLES; i++) {
193 + struct acpi_table_desc *table_desc = &initial_tables[i];
194 + u64 start = table_desc->address;
195 + u64 size = table_desc->length;
196 +
197 + if (!start || !size)
198 + break;
199 +
200 + pr_info("Reserving %4s table memory at [mem 0x%llx-0x%llx]\n",
201 + table_desc->signature.ascii, start, start + size - 1);
202 +
203 + memblock_reserve(start, size);
204 + }
205 +}
206 +
207 +void __init acpi_table_init_complete(void)
208 +{
209 + acpi_table_initrd_scan();
210 check_multiple_madt();
211 +}
212 +
213 +int __init acpi_table_init(void)
214 +{
215 + int ret;
216 +
217 + ret = acpi_locate_initial_tables();
218 + if (ret)
219 + return ret;
220 +
221 + acpi_table_init_complete();
222 +
223 return 0;
224 }
225
226 diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
227 index 3e41b20ed8eb5..7a4e2b014dd66 100644
228 --- a/drivers/net/ethernet/intel/igb/igb_main.c
229 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
230 @@ -4326,8 +4326,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
231 else
232 mrqc |= E1000_MRQC_ENABLE_VMDQ;
233 } else {
234 - if (hw->mac.type != e1000_i211)
235 - mrqc |= E1000_MRQC_ENABLE_RSS_MQ;
236 + mrqc |= E1000_MRQC_ENABLE_RSS_MQ;
237 }
238 igb_vmm_control(adapter);
239
240 diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
241 index 8e37e1f58c4b9..ec4b148b1e6c3 100644
242 --- a/drivers/net/usb/ax88179_178a.c
243 +++ b/drivers/net/usb/ax88179_178a.c
244 @@ -295,12 +295,12 @@ static int ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
245 int ret;
246
247 if (2 == size) {
248 - u16 buf;
249 + u16 buf = 0;
250 ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
251 le16_to_cpus(&buf);
252 *((u16 *)data) = buf;
253 } else if (4 == size) {
254 - u32 buf;
255 + u32 buf = 0;
256 ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf, 0);
257 le32_to_cpus(&buf);
258 *((u32 *)data) = buf;
259 diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
260 index 248d42bf00c15..92fbef5d760cc 100644
261 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
262 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
263 @@ -705,6 +705,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
264 const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
265 u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
266 struct iwl_tfh_tfd *tfd;
267 + unsigned long flags2;
268
269 copy_size = sizeof(struct iwl_cmd_header_wide);
270 cmd_size = sizeof(struct iwl_cmd_header_wide);
271 @@ -773,14 +774,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
272 goto free_dup_buf;
273 }
274
275 - spin_lock_bh(&txq->lock);
276 + spin_lock_irqsave(&txq->lock, flags2);
277
278 idx = iwl_pcie_get_cmd_index(txq, txq->write_ptr);
279 tfd = iwl_pcie_get_tfd(trans, txq, txq->write_ptr);
280 memset(tfd, 0, sizeof(*tfd));
281
282 if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
283 - spin_unlock_bh(&txq->lock);
284 + spin_unlock_irqrestore(&txq->lock, flags2);
285
286 IWL_ERR(trans, "No space in command queue\n");
287 iwl_op_mode_cmd_queue_full(trans->op_mode);
288 @@ -915,7 +916,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
289 spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);
290
291 out:
292 - spin_unlock_bh(&txq->lock);
293 + spin_unlock_irqrestore(&txq->lock, flags2);
294 free_dup_buf:
295 if (idx < 0)
296 kfree(dup_buf);
297 diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
298 index e7dcf8bc99b7c..c8531d6a05925 100644
299 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
300 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
301 @@ -1544,6 +1544,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
302 u32 cmd_pos;
303 const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
304 u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
305 + unsigned long flags2;
306
307 if (WARN(!trans->wide_cmd_header &&
308 group_id > IWL_ALWAYS_LONG_GROUP,
309 @@ -1627,10 +1628,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
310 goto free_dup_buf;
311 }
312
313 - spin_lock_bh(&txq->lock);
314 + spin_lock_irqsave(&txq->lock, flags2);
315
316 if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
317 - spin_unlock_bh(&txq->lock);
318 + spin_unlock_irqrestore(&txq->lock, flags2);
319
320 IWL_ERR(trans, "No space in command queue\n");
321 iwl_op_mode_cmd_queue_full(trans->op_mode);
322 @@ -1791,7 +1792,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
323 spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);
324
325 out:
326 - spin_unlock_bh(&txq->lock);
327 + spin_unlock_irqrestore(&txq->lock, flags2);
328 free_dup_buf:
329 if (idx < 0)
330 kfree(dup_buf);
331 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
332 index e8257de495fd3..f027609fdab6d 100644
333 --- a/drivers/platform/x86/thinkpad_acpi.c
334 +++ b/drivers/platform/x86/thinkpad_acpi.c
335 @@ -6284,6 +6284,7 @@ enum thermal_access_mode {
336 enum { /* TPACPI_THERMAL_TPEC_* */
337 TP_EC_THERMAL_TMP0 = 0x78, /* ACPI EC regs TMP 0..7 */
338 TP_EC_THERMAL_TMP8 = 0xC0, /* ACPI EC regs TMP 8..15 */
339 + TP_EC_FUNCREV = 0xEF, /* ACPI EC Functional revision */
340 TP_EC_THERMAL_TMP_NA = -128, /* ACPI EC sensor not available */
341
342 TPACPI_THERMAL_SENSOR_NA = -128000, /* Sensor not available */
343 @@ -6482,7 +6483,7 @@ static const struct attribute_group thermal_temp_input8_group = {
344
345 static int __init thermal_init(struct ibm_init_struct *iibm)
346 {
347 - u8 t, ta1, ta2;
348 + u8 t, ta1, ta2, ver = 0;
349 int i;
350 int acpi_tmp7;
351 int res;
352 @@ -6497,7 +6498,14 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
353 * 0x78-0x7F, 0xC0-0xC7. Registers return 0x00 for
354 * non-implemented, thermal sensors return 0x80 when
355 * not available
356 + * The above rule is unfortunately flawed. This has been seen with
357 + * 0xC2 (power supply ID) causing thermal control problems.
358 + * The EC version can be determined by offset 0xEF and at least for
359 + * version 3 the Lenovo firmware team confirmed that registers 0xC0-0xC7
360 + * are not thermal registers.
361 */
362 + if (!acpi_ec_read(TP_EC_FUNCREV, &ver))
363 + pr_warn("Thinkpad ACPI EC unable to access EC version\n");
364
365 ta1 = ta2 = 0;
366 for (i = 0; i < 8; i++) {
367 @@ -6507,11 +6515,13 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
368 ta1 = 0;
369 break;
370 }
371 - if (acpi_ec_read(TP_EC_THERMAL_TMP8 + i, &t)) {
372 - ta2 |= t;
373 - } else {
374 - ta1 = 0;
375 - break;
376 + if (ver < 3) {
377 + if (acpi_ec_read(TP_EC_THERMAL_TMP8 + i, &t)) {
378 + ta2 |= t;
379 + } else {
380 + ta1 = 0;
381 + break;
382 + }
383 }
384 }
385 if (ta1 == 0) {
386 @@ -6524,9 +6534,12 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
387 thermal_read_mode = TPACPI_THERMAL_NONE;
388 }
389 } else {
390 - thermal_read_mode =
391 - (ta2 != 0) ?
392 - TPACPI_THERMAL_TPEC_16 : TPACPI_THERMAL_TPEC_8;
393 + if (ver >= 3)
394 + thermal_read_mode = TPACPI_THERMAL_TPEC_8;
395 + else
396 + thermal_read_mode =
397 + (ta2 != 0) ?
398 + TPACPI_THERMAL_TPEC_16 : TPACPI_THERMAL_TPEC_8;
399 }
400 } else if (acpi_tmp7) {
401 if (tpacpi_is_ibm() &&
402 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
403 index b81eebc7e2df2..25112c2fe2db6 100644
404 --- a/drivers/scsi/ufs/ufshcd.c
405 +++ b/drivers/scsi/ufs/ufshcd.c
406 @@ -2639,8 +2639,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
407 * the maximum wait time is bounded by SCSI request timeout.
408 */
409 req = blk_get_request(q, REQ_OP_DRV_OUT, 0);
410 - if (IS_ERR(req))
411 - return PTR_ERR(req);
412 + if (IS_ERR(req)) {
413 + err = PTR_ERR(req);
414 + goto out_unlock;
415 + }
416 tag = req->tag;
417 WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag));
418
419 @@ -2668,6 +2670,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
420
421 out_put_tag:
422 blk_put_request(req);
423 +out_unlock:
424 up_read(&hba->clk_scaling_lock);
425 return err;
426 }
427 @@ -5842,8 +5845,10 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
428 down_read(&hba->clk_scaling_lock);
429
430 req = blk_get_request(q, REQ_OP_DRV_OUT, 0);
431 - if (IS_ERR(req))
432 - return PTR_ERR(req);
433 + if (IS_ERR(req)) {
434 + err = PTR_ERR(req);
435 + goto out_unlock;
436 + }
437 tag = req->tag;
438 WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag));
439
440 @@ -5920,6 +5925,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
441 }
442
443 blk_put_request(req);
444 +out_unlock:
445 up_read(&hba->clk_scaling_lock);
446 return err;
447 }
448 diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
449 index b8a4707dfafab..f6a6c54cba35f 100644
450 --- a/drivers/usb/core/quirks.c
451 +++ b/drivers/usb/core/quirks.c
452 @@ -406,6 +406,7 @@ static const struct usb_device_id usb_quirk_list[] = {
453
454 /* Realtek hub in Dell WD19 (Type-C) */
455 { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
456 + { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME },
457
458 /* Generic RTL8153 based ethernet adapters */
459 { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM },
460 @@ -438,6 +439,9 @@ static const struct usb_device_id usb_quirk_list[] = {
461 { USB_DEVICE(0x17ef, 0xa012), .driver_info =
462 USB_QUIRK_DISCONNECT_SUSPEND },
463
464 + /* Lenovo ThinkPad USB-C Dock Gen2 Ethernet (RTL8153 GigE) */
465 + { USB_DEVICE(0x17ef, 0xa387), .driver_info = USB_QUIRK_NO_LPM },
466 +
467 /* BUILDWIN Photo Frame */
468 { USB_DEVICE(0x1908, 0x1315), .driver_info =
469 USB_QUIRK_HONOR_BNUMINTERFACES },
470 diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig
471 index 9dc95024afaeb..503ed2f3fbb5e 100644
472 --- a/drivers/vfio/Kconfig
473 +++ b/drivers/vfio/Kconfig
474 @@ -22,7 +22,7 @@ config VFIO_VIRQFD
475 menuconfig VFIO
476 tristate "VFIO Non-Privileged userspace driver framework"
477 select IOMMU_API
478 - select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)
479 + select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
480 help
481 VFIO provides a framework for secure userspace device drivers.
482 See Documentation/driver-api/vfio.rst for more details.
483 diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
484 index 87cf9b1d2eca3..f036d7544d4a6 100644
485 --- a/fs/overlayfs/super.c
486 +++ b/fs/overlayfs/super.c
487 @@ -1525,7 +1525,8 @@ out_err:
488 * - upper/work dir of any overlayfs instance
489 */
490 static int ovl_check_layer(struct super_block *sb, struct ovl_fs *ofs,
491 - struct dentry *dentry, const char *name)
492 + struct dentry *dentry, const char *name,
493 + bool is_lower)
494 {
495 struct dentry *next = dentry, *parent;
496 int err = 0;
497 @@ -1537,7 +1538,7 @@ static int ovl_check_layer(struct super_block *sb, struct ovl_fs *ofs,
498
499 /* Walk back ancestors to root (inclusive) looking for traps */
500 while (!err && parent != next) {
501 - if (ovl_lookup_trap_inode(sb, parent)) {
502 + if (is_lower && ovl_lookup_trap_inode(sb, parent)) {
503 err = -ELOOP;
504 pr_err("overlayfs: overlapping %s path\n", name);
505 } else if (ovl_is_inuse(parent)) {
506 @@ -1563,7 +1564,7 @@ static int ovl_check_overlapping_layers(struct super_block *sb,
507
508 if (ofs->upper_mnt) {
509 err = ovl_check_layer(sb, ofs, ofs->upper_mnt->mnt_root,
510 - "upperdir");
511 + "upperdir", false);
512 if (err)
513 return err;
514
515 @@ -1574,7 +1575,8 @@ static int ovl_check_overlapping_layers(struct super_block *sb,
516 * workbasedir. In that case, we already have their traps in
517 * inode cache and we will catch that case on lookup.
518 */
519 - err = ovl_check_layer(sb, ofs, ofs->workbasedir, "workdir");
520 + err = ovl_check_layer(sb, ofs, ofs->workbasedir, "workdir",
521 + false);
522 if (err)
523 return err;
524 }
525 @@ -1582,7 +1584,7 @@ static int ovl_check_overlapping_layers(struct super_block *sb,
526 for (i = 0; i < ofs->numlower; i++) {
527 err = ovl_check_layer(sb, ofs,
528 ofs->lower_layers[i].mnt->mnt_root,
529 - "lowerdir");
530 + "lowerdir", true);
531 if (err)
532 return err;
533 }
534 diff --git a/include/linux/acpi.h b/include/linux/acpi.h
535 index dd6170357ec72..c708fd8315652 100644
536 --- a/include/linux/acpi.h
537 +++ b/include/linux/acpi.h
538 @@ -222,10 +222,14 @@ void __iomem *__acpi_map_table(unsigned long phys, unsigned long size);
539 void __acpi_unmap_table(void __iomem *map, unsigned long size);
540 int early_acpi_boot_init(void);
541 int acpi_boot_init (void);
542 +void acpi_boot_table_prepare (void);
543 void acpi_boot_table_init (void);
544 int acpi_mps_check (void);
545 int acpi_numa_init (void);
546
547 +int acpi_locate_initial_tables (void);
548 +void acpi_reserve_initial_tables (void);
549 +void acpi_table_init_complete (void);
550 int acpi_table_init (void);
551 int acpi_table_parse(char *id, acpi_tbl_table_handler handler);
552 int __init acpi_table_parse_entries(char *id, unsigned long table_size,
553 @@ -759,9 +763,12 @@ static inline int acpi_boot_init(void)
554 return 0;
555 }
556
557 +static inline void acpi_boot_table_prepare(void)
558 +{
559 +}
560 +
561 static inline void acpi_boot_table_init(void)
562 {
563 - return;
564 }
565
566 static inline int acpi_mps_check(void)
567 diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
568 index 81c7ea83e8079..22f070085971b 100644
569 --- a/include/linux/bpf_verifier.h
570 +++ b/include/linux/bpf_verifier.h
571 @@ -281,10 +281,11 @@ struct bpf_verifier_state_list {
572 };
573
574 /* Possible states for alu_state member. */
575 -#define BPF_ALU_SANITIZE_SRC 1U
576 -#define BPF_ALU_SANITIZE_DST 2U
577 +#define BPF_ALU_SANITIZE_SRC (1U << 0)
578 +#define BPF_ALU_SANITIZE_DST (1U << 1)
579 #define BPF_ALU_NEG_VALUE (1U << 2)
580 #define BPF_ALU_NON_POINTER (1U << 3)
581 +#define BPF_ALU_IMMEDIATE (1U << 4)
582 #define BPF_ALU_SANITIZE (BPF_ALU_SANITIZE_SRC | \
583 BPF_ALU_SANITIZE_DST)
584
585 diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
586 index bc439dcd438f1..11b217b0f4541 100644
587 --- a/kernel/bpf/verifier.c
588 +++ b/kernel/bpf/verifier.c
589 @@ -4359,6 +4359,7 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env,
590 {
591 struct bpf_insn_aux_data *aux = commit_window ? cur_aux(env) : tmp_aux;
592 struct bpf_verifier_state *vstate = env->cur_state;
593 + bool off_is_imm = tnum_is_const(off_reg->var_off);
594 bool off_is_neg = off_reg->smin_value < 0;
595 bool ptr_is_dst_reg = ptr_reg == dst_reg;
596 u8 opcode = BPF_OP(insn->code);
597 @@ -4389,6 +4390,7 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env,
598 alu_limit = abs(tmp_aux->alu_limit - alu_limit);
599 } else {
600 alu_state = off_is_neg ? BPF_ALU_NEG_VALUE : 0;
601 + alu_state |= off_is_imm ? BPF_ALU_IMMEDIATE : 0;
602 alu_state |= ptr_is_dst_reg ?
603 BPF_ALU_SANITIZE_SRC : BPF_ALU_SANITIZE_DST;
604 }
605 @@ -9156,7 +9158,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
606 const u8 code_sub = BPF_ALU64 | BPF_SUB | BPF_X;
607 struct bpf_insn insn_buf[16];
608 struct bpf_insn *patch = &insn_buf[0];
609 - bool issrc, isneg;
610 + bool issrc, isneg, isimm;
611 u32 off_reg;
612
613 aux = &env->insn_aux_data[i + delta];
614 @@ -9167,28 +9169,29 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
615 isneg = aux->alu_state & BPF_ALU_NEG_VALUE;
616 issrc = (aux->alu_state & BPF_ALU_SANITIZE) ==
617 BPF_ALU_SANITIZE_SRC;
618 + isimm = aux->alu_state & BPF_ALU_IMMEDIATE;
619
620 off_reg = issrc ? insn->src_reg : insn->dst_reg;
621 - if (isneg)
622 - *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1);
623 - *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit);
624 - *patch++ = BPF_ALU64_REG(BPF_SUB, BPF_REG_AX, off_reg);
625 - *patch++ = BPF_ALU64_REG(BPF_OR, BPF_REG_AX, off_reg);
626 - *patch++ = BPF_ALU64_IMM(BPF_NEG, BPF_REG_AX, 0);
627 - *patch++ = BPF_ALU64_IMM(BPF_ARSH, BPF_REG_AX, 63);
628 - if (issrc) {
629 - *patch++ = BPF_ALU64_REG(BPF_AND, BPF_REG_AX,
630 - off_reg);
631 - insn->src_reg = BPF_REG_AX;
632 + if (isimm) {
633 + *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit);
634 } else {
635 - *patch++ = BPF_ALU64_REG(BPF_AND, off_reg,
636 - BPF_REG_AX);
637 + if (isneg)
638 + *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1);
639 + *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit);
640 + *patch++ = BPF_ALU64_REG(BPF_SUB, BPF_REG_AX, off_reg);
641 + *patch++ = BPF_ALU64_REG(BPF_OR, BPF_REG_AX, off_reg);
642 + *patch++ = BPF_ALU64_IMM(BPF_NEG, BPF_REG_AX, 0);
643 + *patch++ = BPF_ALU64_IMM(BPF_ARSH, BPF_REG_AX, 63);
644 + *patch++ = BPF_ALU64_REG(BPF_AND, BPF_REG_AX, off_reg);
645 }
646 + if (!issrc)
647 + *patch++ = BPF_MOV64_REG(insn->dst_reg, insn->src_reg);
648 + insn->src_reg = BPF_REG_AX;
649 if (isneg)
650 insn->code = insn->code == code_add ?
651 code_sub : code_add;
652 *patch++ = *insn;
653 - if (issrc && isneg)
654 + if (issrc && isneg && !isimm)
655 *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1);
656 cnt = patch - insn_buf;
657
658 diff --git a/kernel/events/core.c b/kernel/events/core.c
659 index 2ef33e9a75910..ec1add9e7f3a3 100644
660 --- a/kernel/events/core.c
661 +++ b/kernel/events/core.c
662 @@ -10953,12 +10953,12 @@ SYSCALL_DEFINE5(perf_event_open,
663 perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
664 return -EACCES;
665
666 - err = security_locked_down(LOCKDOWN_PERF);
667 - if (err && (attr.sample_type & PERF_SAMPLE_REGS_INTR))
668 - /* REGS_INTR can leak data, lockdown must prevent this */
669 - return err;
670 -
671 - err = 0;
672 + /* REGS_INTR can leak data, lockdown must prevent this */
673 + if (attr.sample_type & PERF_SAMPLE_REGS_INTR) {
674 + err = security_locked_down(LOCKDOWN_PERF);
675 + if (err)
676 + return err;
677 + }
678
679 /*
680 * In cgroup mode, the pid argument is used to pass the fd
681 diff --git a/lib/Makefile b/lib/Makefile
682 index c5892807e06fa..3b8977aed1b4c 100644
683 --- a/lib/Makefile
684 +++ b/lib/Makefile
685 @@ -31,7 +31,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
686 flex_proportions.o ratelimit.o show_mem.o \
687 is_single_threaded.o plist.o decompress.o kobject_uevent.o \
688 earlycpio.o seq_buf.o siphash.o dec_and_lock.o \
689 - nmi_backtrace.o nodemask.o win_minmax.o memcat_p.o
690 + nmi_backtrace.o nodemask.o win_minmax.o
691
692 lib-$(CONFIG_PRINTK) += dump_stack.o
693 lib-$(CONFIG_MMU) += ioremap.o
694 @@ -46,7 +46,7 @@ obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \
695 bsearch.o find_bit.o llist.o memweight.o kfifo.o \
696 percpu-refcount.o rhashtable.o \
697 once.o refcount.o usercopy.o errseq.o bucket_locks.o \
698 - generic-radix-tree.o
699 + generic-radix-tree.o memcat_p.o
700 obj-$(CONFIG_STRING_SELFTEST) += test_string.o
701 obj-y += string_helpers.o
702 obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
703 diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
704 index 8c3b3a291ddbf..441335abb4018 100644
705 --- a/sound/usb/quirks-table.h
706 +++ b/sound/usb/quirks-table.h
707 @@ -2485,6 +2485,16 @@ YAMAHA_DEVICE(0x7010, "UB99"),
708 }
709 },
710
711 +{
712 + USB_DEVICE_VENDOR_SPEC(0x0944, 0x0204),
713 + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
714 + .vendor_name = "KORG, Inc.",
715 + /* .product_name = "ToneLab EX", */
716 + .ifnum = 3,
717 + .type = QUIRK_MIDI_STANDARD_INTERFACE,
718 + }
719 +},
720 +
721 /* AKAI devices */
722 {
723 USB_DEVICE(0x09e8, 0x0062),
724 diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
725 index d5adc417a4ca4..40b179f54428e 100644
726 --- a/tools/perf/builtin-ftrace.c
727 +++ b/tools/perf/builtin-ftrace.c
728 @@ -161,7 +161,7 @@ static int set_tracing_pid(struct perf_ftrace *ftrace)
729
730 for (i = 0; i < perf_thread_map__nr(ftrace->evlist->core.threads); i++) {
731 scnprintf(buf, sizeof(buf), "%d",
732 - ftrace->evlist->core.threads->map[i]);
733 + perf_thread_map__pid(ftrace->evlist->core.threads, i));
734 if (append_tracing_file("set_ftrace_pid", buf) < 0)
735 return -1;
736 }
737 diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
738 index 88fba2ba549f2..7534455ffc6a6 100644
739 --- a/tools/perf/util/data.c
740 +++ b/tools/perf/util/data.c
741 @@ -35,7 +35,7 @@ void perf_data__close_dir(struct perf_data *data)
742 int perf_data__create_dir(struct perf_data *data, int nr)
743 {
744 struct perf_data_file *files = NULL;
745 - int i, ret = -1;
746 + int i, ret;
747
748 if (WARN_ON(!data->is_dir))
749 return -EINVAL;
750 @@ -51,7 +51,8 @@ int perf_data__create_dir(struct perf_data *data, int nr)
751 for (i = 0; i < nr; i++) {
752 struct perf_data_file *file = &files[i];
753
754 - if (asprintf(&file->path, "%s/data.%d", data->path, i) < 0)
755 + ret = asprintf(&file->path, "%s/data.%d", data->path, i);
756 + if (ret < 0)
757 goto out_err;
758
759 ret = open(file->path, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);