Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.14 commit in: /
Date: Sun, 21 Nov 2021 20:38:53
Message-Id: 1637527118.b9cd64dcc70590a28789f605a8aebdc47983e1dd.mpagano@gentoo
1 commit: b9cd64dcc70590a28789f605a8aebdc47983e1dd
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 21 20:38:38 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 21 20:38:38 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b9cd64dc
7
8 Linux patch 5.14.21
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1020_linux-5.14.21.patch | 375 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 379 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 6e5582fd..e8f44666 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -127,6 +127,10 @@ Patch: 1019_linux-5.14.20.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.14.20
23
24 +Patch: 1020_linux-5.14.21.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.14.21
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/1020_linux-5.14.21.patch b/1020_linux-5.14.21.patch
33 new file mode 100644
34 index 00000000..d1393a87
35 --- /dev/null
36 +++ b/1020_linux-5.14.21.patch
37 @@ -0,0 +1,375 @@
38 +diff --git a/Makefile b/Makefile
39 +index 0e14a3a30d073..8b5ba7ee7543e 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 20
47 ++SUBLEVEL = 21
48 + EXTRAVERSION =
49 + NAME = Opossums on Parade
50 +
51 +diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
52 +index 2716e58b498bb..437c8d31f3907 100644
53 +--- a/arch/parisc/kernel/entry.S
54 ++++ b/arch/parisc/kernel/entry.S
55 +@@ -1835,7 +1835,7 @@ syscall_restore:
56 +
57 + /* Are we being ptraced? */
58 + LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
59 +- ldi _TIF_SYSCALL_TRACE_MASK,%r2
60 ++ ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r2
61 + and,COND(=) %r19,%r2,%r0
62 + b,n syscall_restore_rfi
63 +
64 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
65 +index 285e865931436..599ed79581bf2 100644
66 +--- a/arch/x86/kvm/x86.c
67 ++++ b/arch/x86/kvm/x86.c
68 +@@ -3237,9 +3237,9 @@ static void record_steal_time(struct kvm_vcpu *vcpu)
69 + "xor %1, %1\n"
70 + "2:\n"
71 + _ASM_EXTABLE_UA(1b, 2b)
72 +- : "+r" (st_preempted),
73 +- "+&r" (err)
74 +- : "m" (st->preempted));
75 ++ : "+q" (st_preempted),
76 ++ "+&r" (err),
77 ++ "+m" (st->preempted));
78 + if (err)
79 + goto out;
80 +
81 +diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
82 +index 3fd1713f1f626..fce3f3bba714a 100644
83 +--- a/drivers/acpi/glue.c
84 ++++ b/drivers/acpi/glue.c
85 +@@ -363,28 +363,3 @@ int acpi_platform_notify(struct device *dev, enum kobject_action action)
86 + }
87 + return 0;
88 + }
89 +-
90 +-int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used)
91 +-{
92 +- struct acpi_device *adev = to_acpi_device(dev);
93 +-
94 +- /*
95 +- * Skip device objects with device IDs, because they may be in use even
96 +- * if they are not companions of any physical device objects.
97 +- */
98 +- if (adev->pnp.type.hardware_id)
99 +- return 0;
100 +-
101 +- mutex_lock(&adev->physical_node_lock);
102 +-
103 +- /*
104 +- * Device objects without device IDs are not in use if they have no
105 +- * corresponding physical device objects.
106 +- */
107 +- if (list_empty(&adev->physical_node_list))
108 +- acpi_device_set_power(adev, ACPI_STATE_D3_COLD);
109 +-
110 +- mutex_unlock(&adev->physical_node_lock);
111 +-
112 +- return 0;
113 +-}
114 +diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
115 +index 8fbdc172864b0..d91b560e88674 100644
116 +--- a/drivers/acpi/internal.h
117 ++++ b/drivers/acpi/internal.h
118 +@@ -117,7 +117,6 @@ bool acpi_device_is_battery(struct acpi_device *adev);
119 + bool acpi_device_is_first_physical_node(struct acpi_device *adev,
120 + const struct device *dev);
121 + int acpi_bus_register_early_device(int type);
122 +-int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used);
123 +
124 + /* --------------------------------------------------------------------------
125 + Device Matching and Notification
126 +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
127 +index ae9464091f1b1..b24513ec3fae1 100644
128 +--- a/drivers/acpi/scan.c
129 ++++ b/drivers/acpi/scan.c
130 +@@ -2560,12 +2560,6 @@ int __init acpi_scan_init(void)
131 + }
132 + }
133 +
134 +- /*
135 +- * Make sure that power management resources are not blocked by ACPI
136 +- * device objects with no users.
137 +- */
138 +- bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused);
139 +-
140 + acpi_turn_off_unused_power_resources();
141 +
142 + acpi_scan_initialized = true;
143 +diff --git a/drivers/block/loop.c b/drivers/block/loop.c
144 +index 1f91bd41a29b2..b7956c5294257 100644
145 +--- a/drivers/block/loop.c
146 ++++ b/drivers/block/loop.c
147 +@@ -272,19 +272,6 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
148 + blk_mq_unfreeze_queue(lo->lo_queue);
149 + }
150 +
151 +-/**
152 +- * loop_validate_block_size() - validates the passed in block size
153 +- * @bsize: size to validate
154 +- */
155 +-static int
156 +-loop_validate_block_size(unsigned short bsize)
157 +-{
158 +- if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize))
159 +- return -EINVAL;
160 +-
161 +- return 0;
162 +-}
163 +-
164 + /**
165 + * loop_set_size() - sets device size and notifies userspace
166 + * @lo: struct loop_device to set the size for
167 +@@ -1235,7 +1222,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
168 + }
169 +
170 + if (config->block_size) {
171 +- error = loop_validate_block_size(config->block_size);
172 ++ error = blk_validate_block_size(config->block_size);
173 + if (error)
174 + goto out_unlock;
175 + }
176 +@@ -1761,7 +1748,7 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
177 + if (lo->lo_state != Lo_bound)
178 + return -ENXIO;
179 +
180 +- err = loop_validate_block_size(arg);
181 ++ err = blk_validate_block_size(arg);
182 + if (err)
183 + return err;
184 +
185 +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
186 +index bd37d6fb88c26..40814d98a1a4b 100644
187 +--- a/drivers/bluetooth/btusb.c
188 ++++ b/drivers/bluetooth/btusb.c
189 +@@ -434,6 +434,10 @@ static const struct usb_device_id blacklist_table[] = {
190 + { USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK },
191 + { USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },
192 +
193 ++ /* Additional Realtek 8761B Bluetooth devices */
194 ++ { USB_DEVICE(0x2357, 0x0604), .driver_info = BTUSB_REALTEK |
195 ++ BTUSB_WIDEBAND_SPEECH },
196 ++
197 + /* Additional Realtek 8761BU Bluetooth devices */
198 + { USB_DEVICE(0x0b05, 0x190e), .driver_info = BTUSB_REALTEK |
199 + BTUSB_WIDEBAND_SPEECH },
200 +diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
201 +index 0bba672176b10..7ff89690a976a 100644
202 +--- a/drivers/gpu/drm/Kconfig
203 ++++ b/drivers/gpu/drm/Kconfig
204 +@@ -97,8 +97,9 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
205 +
206 + config DRM_FBDEV_EMULATION
207 + bool "Enable legacy fbdev support for your modesetting driver"
208 +- depends on DRM_KMS_HELPER
209 +- depends on FB=y || FB=DRM_KMS_HELPER
210 ++ depends on DRM
211 ++ depends on FB
212 ++ select DRM_KMS_HELPER
213 + select FB_CFB_FILLRECT
214 + select FB_CFB_COPYAREA
215 + select FB_CFB_IMAGEBLIT
216 +diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
217 +index 3a9f4f8ad8f94..da5fbfcda433d 100644
218 +--- a/drivers/pci/msi.c
219 ++++ b/drivers/pci/msi.c
220 +@@ -368,18 +368,6 @@ static void free_msi_irqs(struct pci_dev *dev)
221 + for (i = 0; i < entry->nvec_used; i++)
222 + BUG_ON(irq_has_action(entry->irq + i));
223 +
224 +- pci_msi_teardown_msi_irqs(dev);
225 +-
226 +- list_for_each_entry_safe(entry, tmp, msi_list, list) {
227 +- if (entry->msi_attrib.is_msix) {
228 +- if (list_is_last(&entry->list, msi_list))
229 +- iounmap(entry->mask_base);
230 +- }
231 +-
232 +- list_del(&entry->list);
233 +- free_msi_entry(entry);
234 +- }
235 +-
236 + if (dev->msi_irq_groups) {
237 + sysfs_remove_groups(&dev->dev.kobj, dev->msi_irq_groups);
238 + msi_attrs = dev->msi_irq_groups[0]->attrs;
239 +@@ -395,6 +383,18 @@ static void free_msi_irqs(struct pci_dev *dev)
240 + kfree(dev->msi_irq_groups);
241 + dev->msi_irq_groups = NULL;
242 + }
243 ++
244 ++ pci_msi_teardown_msi_irqs(dev);
245 ++
246 ++ list_for_each_entry_safe(entry, tmp, msi_list, list) {
247 ++ if (entry->msi_attrib.is_msix) {
248 ++ if (list_is_last(&entry->list, msi_list))
249 ++ iounmap(entry->mask_base);
250 ++ }
251 ++
252 ++ list_del(&entry->list);
253 ++ free_msi_entry(entry);
254 ++ }
255 + }
256 +
257 + static void pci_intx_for_msi(struct pci_dev *dev, int enable)
258 +@@ -585,6 +585,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, struct irq_affinity *affd)
259 + goto out;
260 +
261 + pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control);
262 ++ /* Lies, damned lies, and MSIs */
263 ++ if (dev->dev_flags & PCI_DEV_FLAGS_HAS_MSI_MASKING)
264 ++ control |= PCI_MSI_FLAGS_MASKBIT;
265 +
266 + entry->msi_attrib.is_msix = 0;
267 + entry->msi_attrib.is_64 = !!(control & PCI_MSI_FLAGS_64BIT);
268 +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
269 +index cef69b71a6f12..d6000202a4556 100644
270 +--- a/drivers/pci/quirks.c
271 ++++ b/drivers/pci/quirks.c
272 +@@ -5760,3 +5760,9 @@ static void apex_pci_fixup_class(struct pci_dev *pdev)
273 + }
274 + DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
275 + PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);
276 ++
277 ++static void nvidia_ion_ahci_fixup(struct pci_dev *pdev)
278 ++{
279 ++ pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING;
280 ++}
281 ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup);
282 +diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
283 +index 6379f26a335f6..9233f7e744544 100644
284 +--- a/drivers/thermal/thermal_of.c
285 ++++ b/drivers/thermal/thermal_of.c
286 +@@ -89,7 +89,7 @@ static int of_thermal_get_temp(struct thermal_zone_device *tz,
287 + {
288 + struct __thermal_zone *data = tz->devdata;
289 +
290 +- if (!data->ops->get_temp)
291 ++ if (!data->ops || !data->ops->get_temp)
292 + return -EINVAL;
293 +
294 + return data->ops->get_temp(data->sensor_data, temp);
295 +@@ -186,6 +186,9 @@ static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
296 + {
297 + struct __thermal_zone *data = tz->devdata;
298 +
299 ++ if (!data->ops || !data->ops->set_emul_temp)
300 ++ return -EINVAL;
301 ++
302 + return data->ops->set_emul_temp(data->sensor_data, temp);
303 + }
304 +
305 +@@ -194,7 +197,7 @@ static int of_thermal_get_trend(struct thermal_zone_device *tz, int trip,
306 + {
307 + struct __thermal_zone *data = tz->devdata;
308 +
309 +- if (!data->ops->get_trend)
310 ++ if (!data->ops || !data->ops->get_trend)
311 + return -EINVAL;
312 +
313 + return data->ops->get_trend(data->sensor_data, trip, trend);
314 +@@ -301,7 +304,7 @@ static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
315 + if (trip >= data->ntrips || trip < 0)
316 + return -EDOM;
317 +
318 +- if (data->ops->set_trip_temp) {
319 ++ if (data->ops && data->ops->set_trip_temp) {
320 + int ret;
321 +
322 + ret = data->ops->set_trip_temp(data->sensor_data, trip, temp);
323 +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
324 +index e7979fe7e4fad..42ed8ccc40e77 100644
325 +--- a/include/linux/blkdev.h
326 ++++ b/include/linux/blkdev.h
327 +@@ -240,6 +240,14 @@ struct request {
328 + void *end_io_data;
329 + };
330 +
331 ++static inline int blk_validate_block_size(unsigned int bsize)
332 ++{
333 ++ if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize))
334 ++ return -EINVAL;
335 ++
336 ++ return 0;
337 ++}
338 ++
339 + static inline bool blk_op_is_passthrough(unsigned int op)
340 + {
341 + op &= REQ_OP_MASK;
342 +diff --git a/include/linux/pci.h b/include/linux/pci.h
343 +index acbed2ecf6e8c..25acd447c9227 100644
344 +--- a/include/linux/pci.h
345 ++++ b/include/linux/pci.h
346 +@@ -227,6 +227,8 @@ enum pci_dev_flags {
347 + PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10),
348 + /* Don't use Relaxed Ordering for TLPs directed at this device */
349 + PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 11),
350 ++ /* Device does honor MSI masking despite saying otherwise */
351 ++ PCI_DEV_FLAGS_HAS_MSI_MASKING = (__force pci_dev_flags_t) (1 << 12),
352 + };
353 +
354 + enum pci_irq_reroute_variant {
355 +diff --git a/init/main.c b/init/main.c
356 +index 90733a916791f..5840218c06775 100644
357 +--- a/init/main.c
358 ++++ b/init/main.c
359 +@@ -382,6 +382,7 @@ static char * __init xbc_make_cmdline(const char *key)
360 + ret = xbc_snprint_cmdline(new_cmdline, len + 1, root);
361 + if (ret < 0 || ret > len) {
362 + pr_err("Failed to print extra kernel cmdline.\n");
363 ++ memblock_free(__pa(new_cmdline), len + 1);
364 + return NULL;
365 + }
366 +
367 +diff --git a/kernel/events/core.c b/kernel/events/core.c
368 +index 22c5b1622c226..69f86bc95011d 100644
369 +--- a/kernel/events/core.c
370 ++++ b/kernel/events/core.c
371 +@@ -7141,7 +7141,6 @@ void perf_output_sample(struct perf_output_handle *handle,
372 + static u64 perf_virt_to_phys(u64 virt)
373 + {
374 + u64 phys_addr = 0;
375 +- struct page *p = NULL;
376 +
377 + if (!virt)
378 + return 0;
379 +@@ -7160,14 +7159,15 @@ static u64 perf_virt_to_phys(u64 virt)
380 + * If failed, leave phys_addr as 0.
381 + */
382 + if (current->mm != NULL) {
383 ++ struct page *p;
384 ++
385 + pagefault_disable();
386 +- if (get_user_page_fast_only(virt, 0, &p))
387 ++ if (get_user_page_fast_only(virt, 0, &p)) {
388 + phys_addr = page_to_phys(p) + virt % PAGE_SIZE;
389 ++ put_page(p);
390 ++ }
391 + pagefault_enable();
392 + }
393 +-
394 +- if (p)
395 +- put_page(p);
396 + }
397 +
398 + return phys_addr;
399 +diff --git a/security/Kconfig b/security/Kconfig
400 +index 0ced7fd33e4d0..fe6c0395fa025 100644
401 +--- a/security/Kconfig
402 ++++ b/security/Kconfig
403 +@@ -191,6 +191,9 @@ config HARDENED_USERCOPY_PAGESPAN
404 + config FORTIFY_SOURCE
405 + bool "Harden common str/mem functions against buffer overflows"
406 + depends on ARCH_HAS_FORTIFY_SOURCE
407 ++ # https://bugs.llvm.org/show_bug.cgi?id=50322
408 ++ # https://bugs.llvm.org/show_bug.cgi?id=41459
409 ++ depends on !CC_IS_CLANG
410 + help
411 + Detect overflows of buffers in common string and memory functions
412 + where the compiler can determine and validate the buffer sizes.