Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Fri, 26 Feb 2021 10:01:25
Message-Id: 1614333660.2f51bc969051457c56542367d6f1d45ffec4daa0.alicef@gentoo
1 commit: 2f51bc969051457c56542367d6f1d45ffec4daa0
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 26 10:00:46 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 26 10:01:00 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=2f51bc96
7
8 Linux patch 5.4.101
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1100_linux-5.4.101.patch | 397 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 401 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 23e242b..aab74c6 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -443,6 +443,10 @@ Patch: 1099_linux-5.4.100.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.100
23
24 +Patch: 1100_linux-5.4.101.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.101
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/1100_linux-5.4.101.patch b/1100_linux-5.4.101.patch
33 new file mode 100644
34 index 0000000..87f0074
35 --- /dev/null
36 +++ b/1100_linux-5.4.101.patch
37 @@ -0,0 +1,397 @@
38 +diff --git a/Makefile b/Makefile
39 +index d0d4beb4f8373..f56442751d2c3 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 4
46 +-SUBLEVEL = 100
47 ++SUBLEVEL = 101
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
52 +index 078d2506365c0..8a02b26d07cd4 100644
53 +--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
54 ++++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
55 +@@ -917,6 +917,7 @@
56 + <&tegra_car 128>, /* hda2hdmi */
57 + <&tegra_car 111>; /* hda2codec_2x */
58 + reset-names = "hda", "hda2hdmi", "hda2codec_2x";
59 ++ power-domains = <&pd_sor>;
60 + status = "disabled";
61 + };
62 +
63 +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
64 +index d2ecc9c452554..263eca119ff0f 100644
65 +--- a/drivers/hid/hid-core.c
66 ++++ b/drivers/hid/hid-core.c
67 +@@ -90,7 +90,7 @@ EXPORT_SYMBOL_GPL(hid_register_report);
68 + * Register a new field for this report.
69 + */
70 +
71 +-static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
72 ++static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages)
73 + {
74 + struct hid_field *field;
75 +
76 +@@ -101,7 +101,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned
77 +
78 + field = kzalloc((sizeof(struct hid_field) +
79 + usages * sizeof(struct hid_usage) +
80 +- values * sizeof(unsigned)), GFP_KERNEL);
81 ++ usages * sizeof(unsigned)), GFP_KERNEL);
82 + if (!field)
83 + return NULL;
84 +
85 +@@ -300,7 +300,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
86 + usages = max_t(unsigned, parser->local.usage_index,
87 + parser->global.report_count);
88 +
89 +- field = hid_register_field(report, usages, parser->global.report_count);
90 ++ field = hid_register_field(report, usages);
91 + if (!field)
92 + return 0;
93 +
94 +diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
95 +index 0c5373462cedb..0b1b5f9c67d47 100644
96 +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
97 ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
98 +@@ -219,6 +219,7 @@ CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN
99 + CH_PCI_ID_TABLE_FENTRY(0x6089), /* Custom T62100-KR */
100 + CH_PCI_ID_TABLE_FENTRY(0x608a), /* Custom T62100-CR */
101 + CH_PCI_ID_TABLE_FENTRY(0x608b), /* Custom T6225-CR */
102 ++ CH_PCI_ID_TABLE_FENTRY(0x6092), /* Custom T62100-CR-LOM */
103 + CH_PCI_DEVICE_ID_TABLE_DEFINE_END;
104 +
105 + #endif /* __T4_PCI_ID_TBL_H__ */
106 +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
107 +index 72a3a5dc51319..5a1d21aae2a9e 100644
108 +--- a/drivers/net/usb/qmi_wwan.c
109 ++++ b/drivers/net/usb/qmi_wwan.c
110 +@@ -1354,6 +1354,7 @@ static const struct usb_device_id products[] = {
111 + {QMI_FIXED_INTF(0x1e2d, 0x0082, 5)}, /* Cinterion PHxx,PXxx (2 RmNet) */
112 + {QMI_FIXED_INTF(0x1e2d, 0x0083, 4)}, /* Cinterion PHxx,PXxx (1 RmNet + USB Audio)*/
113 + {QMI_QUIRK_SET_DTR(0x1e2d, 0x00b0, 4)}, /* Cinterion CLS8 */
114 ++ {QMI_FIXED_INTF(0x1e2d, 0x00b7, 0)}, /* Cinterion MV31 RmNet */
115 + {QMI_FIXED_INTF(0x413c, 0x81a2, 8)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
116 + {QMI_FIXED_INTF(0x413c, 0x81a3, 8)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
117 + {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
118 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
119 +index c1592403222f5..239443ce52001 100644
120 +--- a/drivers/usb/core/quirks.c
121 ++++ b/drivers/usb/core/quirks.c
122 +@@ -391,6 +391,9 @@ static const struct usb_device_id usb_quirk_list[] = {
123 + /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
124 + { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
125 +
126 ++ /* ELMO L-12F document camera */
127 ++ { USB_DEVICE(0x09a1, 0x0028), .driver_info = USB_QUIRK_DELAY_CTRL_MSG },
128 ++
129 + /* Broadcom BCM92035DGROM BT dongle */
130 + { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
131 +
132 +@@ -415,6 +418,9 @@ static const struct usb_device_id usb_quirk_list[] = {
133 + { USB_DEVICE(0x10d6, 0x2200), .driver_info =
134 + USB_QUIRK_STRING_FETCH_255 },
135 +
136 ++ /* novation SoundControl XL */
137 ++ { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
138 ++
139 + /* Huawei 4G LTE module */
140 + { USB_DEVICE(0x12d1, 0x15bb), .driver_info =
141 + USB_QUIRK_DISCONNECT_SUSPEND },
142 +@@ -495,9 +501,6 @@ static const struct usb_device_id usb_quirk_list[] = {
143 + /* INTEL VALUE SSD */
144 + { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
145 +
146 +- /* novation SoundControl XL */
147 +- { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
148 +-
149 + { } /* terminating entry must be last */
150 + };
151 +
152 +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
153 +index ab9eeb5ff8e57..67c2e6487479a 100644
154 +--- a/fs/cifs/connect.c
155 ++++ b/fs/cifs/connect.c
156 +@@ -4198,6 +4198,7 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
157 + cifs_sb->prepath = kstrdup(pvolume_info->prepath, GFP_KERNEL);
158 + if (cifs_sb->prepath == NULL)
159 + return -ENOMEM;
160 ++ cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH;
161 + }
162 +
163 + return 0;
164 +diff --git a/fs/dax.c b/fs/dax.c
165 +index cc56313c6b3b9..3b0e5da96d541 100644
166 +--- a/fs/dax.c
167 ++++ b/fs/dax.c
168 +@@ -794,12 +794,12 @@ static void dax_entry_mkclean(struct address_space *mapping, pgoff_t index,
169 + address = pgoff_address(index, vma);
170 +
171 + /*
172 +- * Note because we provide range to follow_pte_pmd it will
173 +- * call mmu_notifier_invalidate_range_start() on our behalf
174 +- * before taking any lock.
175 ++ * follow_invalidate_pte() will use the range to call
176 ++ * mmu_notifier_invalidate_range_start() on our behalf before
177 ++ * taking any lock.
178 + */
179 +- if (follow_pte_pmd(vma->vm_mm, address, &range,
180 +- &ptep, &pmdp, &ptl))
181 ++ if (follow_invalidate_pte(vma->vm_mm, address, &range, &ptep,
182 ++ &pmdp, &ptl))
183 + continue;
184 +
185 + /*
186 +diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
187 +index 84933a0af49b6..672feb96e250e 100644
188 +--- a/fs/ntfs/inode.c
189 ++++ b/fs/ntfs/inode.c
190 +@@ -628,6 +628,12 @@ static int ntfs_read_locked_inode(struct inode *vi)
191 + }
192 + a = ctx->attr;
193 + /* Get the standard information attribute value. */
194 ++ if ((u8 *)a + le16_to_cpu(a->data.resident.value_offset)
195 ++ + le32_to_cpu(a->data.resident.value_length) >
196 ++ (u8 *)ctx->mrec + vol->mft_record_size) {
197 ++ ntfs_error(vi->i_sb, "Corrupt standard information attribute in inode.");
198 ++ goto unm_err_out;
199 ++ }
200 + si = (STANDARD_INFORMATION*)((u8*)a +
201 + le16_to_cpu(a->data.resident.value_offset));
202 +
203 +diff --git a/include/linux/mm.h b/include/linux/mm.h
204 +index 7249cf58f78d1..c63e4b38b7fe0 100644
205 +--- a/include/linux/mm.h
206 ++++ b/include/linux/mm.h
207 +@@ -1466,9 +1466,11 @@ void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
208 + unsigned long end, unsigned long floor, unsigned long ceiling);
209 + int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
210 + struct vm_area_struct *vma);
211 +-int follow_pte_pmd(struct mm_struct *mm, unsigned long address,
212 +- struct mmu_notifier_range *range,
213 +- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp);
214 ++int follow_invalidate_pte(struct mm_struct *mm, unsigned long address,
215 ++ struct mmu_notifier_range *range, pte_t **ptepp,
216 ++ pmd_t **pmdpp, spinlock_t **ptlp);
217 ++int follow_pte(struct mm_struct *mm, unsigned long address,
218 ++ pte_t **ptepp, spinlock_t **ptlp);
219 + int follow_pfn(struct vm_area_struct *vma, unsigned long address,
220 + unsigned long *pfn);
221 + int follow_phys(struct vm_area_struct *vma, unsigned long address,
222 +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
223 +index 2c248c4f6419c..e6a43c0fdee88 100644
224 +--- a/kernel/bpf/verifier.c
225 ++++ b/kernel/bpf/verifier.c
226 +@@ -9005,7 +9005,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
227 + bool isdiv = BPF_OP(insn->code) == BPF_DIV;
228 + struct bpf_insn *patchlet;
229 + struct bpf_insn chk_and_div[] = {
230 +- /* Rx div 0 -> 0 */
231 ++ /* [R,W]x div 0 -> 0 */
232 + BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
233 + BPF_JNE | BPF_K, insn->src_reg,
234 + 0, 2, 0),
235 +@@ -9014,16 +9014,18 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
236 + *insn,
237 + };
238 + struct bpf_insn chk_and_mod[] = {
239 +- /* Rx mod 0 -> Rx */
240 ++ /* [R,W]x mod 0 -> [R,W]x */
241 + BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) |
242 + BPF_JEQ | BPF_K, insn->src_reg,
243 +- 0, 1, 0),
244 ++ 0, 1 + (is64 ? 0 : 1), 0),
245 + *insn,
246 ++ BPF_JMP_IMM(BPF_JA, 0, 0, 1),
247 ++ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg),
248 + };
249 +
250 + patchlet = isdiv ? chk_and_div : chk_and_mod;
251 + cnt = isdiv ? ARRAY_SIZE(chk_and_div) :
252 +- ARRAY_SIZE(chk_and_mod);
253 ++ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0);
254 +
255 + new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt);
256 + if (!new_prog)
257 +diff --git a/mm/memory.c b/mm/memory.c
258 +index 2157bb28117ac..b23831132933a 100644
259 +--- a/mm/memory.c
260 ++++ b/mm/memory.c
261 +@@ -4222,9 +4222,9 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
262 + }
263 + #endif /* __PAGETABLE_PMD_FOLDED */
264 +
265 +-static int __follow_pte_pmd(struct mm_struct *mm, unsigned long address,
266 +- struct mmu_notifier_range *range,
267 +- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp)
268 ++int follow_invalidate_pte(struct mm_struct *mm, unsigned long address,
269 ++ struct mmu_notifier_range *range, pte_t **ptepp,
270 ++ pmd_t **pmdpp, spinlock_t **ptlp)
271 + {
272 + pgd_t *pgd;
273 + p4d_t *p4d;
274 +@@ -4289,31 +4289,33 @@ out:
275 + return -EINVAL;
276 + }
277 +
278 +-static inline int follow_pte(struct mm_struct *mm, unsigned long address,
279 +- pte_t **ptepp, spinlock_t **ptlp)
280 +-{
281 +- int res;
282 +-
283 +- /* (void) is needed to make gcc happy */
284 +- (void) __cond_lock(*ptlp,
285 +- !(res = __follow_pte_pmd(mm, address, NULL,
286 +- ptepp, NULL, ptlp)));
287 +- return res;
288 +-}
289 +-
290 +-int follow_pte_pmd(struct mm_struct *mm, unsigned long address,
291 +- struct mmu_notifier_range *range,
292 +- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp)
293 ++/**
294 ++ * follow_pte - look up PTE at a user virtual address
295 ++ * @mm: the mm_struct of the target address space
296 ++ * @address: user virtual address
297 ++ * @ptepp: location to store found PTE
298 ++ * @ptlp: location to store the lock for the PTE
299 ++ *
300 ++ * On a successful return, the pointer to the PTE is stored in @ptepp;
301 ++ * the corresponding lock is taken and its location is stored in @ptlp.
302 ++ * The contents of the PTE are only stable until @ptlp is released;
303 ++ * any further use, if any, must be protected against invalidation
304 ++ * with MMU notifiers.
305 ++ *
306 ++ * Only IO mappings and raw PFN mappings are allowed. The mmap semaphore
307 ++ * should be taken for read.
308 ++ *
309 ++ * KVM uses this function. While it is arguably less bad than ``follow_pfn``,
310 ++ * it is not a good general-purpose API.
311 ++ *
312 ++ * Return: zero on success, -ve otherwise.
313 ++ */
314 ++int follow_pte(struct mm_struct *mm, unsigned long address,
315 ++ pte_t **ptepp, spinlock_t **ptlp)
316 + {
317 +- int res;
318 +-
319 +- /* (void) is needed to make gcc happy */
320 +- (void) __cond_lock(*ptlp,
321 +- !(res = __follow_pte_pmd(mm, address, range,
322 +- ptepp, pmdpp, ptlp)));
323 +- return res;
324 ++ return follow_invalidate_pte(mm, address, NULL, ptepp, NULL, ptlp);
325 + }
326 +-EXPORT_SYMBOL(follow_pte_pmd);
327 ++EXPORT_SYMBOL_GPL(follow_pte);
328 +
329 + /**
330 + * follow_pfn - look up PFN at a user virtual address
331 +@@ -4323,6 +4325,9 @@ EXPORT_SYMBOL(follow_pte_pmd);
332 + *
333 + * Only IO mappings and raw PFN mappings are allowed.
334 + *
335 ++ * This function does not allow the caller to read the permissions
336 ++ * of the PTE. Do not use it.
337 ++ *
338 + * Return: zero and the pfn at @pfn on success, -ve otherwise.
339 + */
340 + int follow_pfn(struct vm_area_struct *vma, unsigned long address,
341 +diff --git a/scripts/Makefile b/scripts/Makefile
342 +index 3e86b300f5a10..b4b7d8b58cd68 100644
343 +--- a/scripts/Makefile
344 ++++ b/scripts/Makefile
345 +@@ -10,6 +10,9 @@
346 +
347 + HOST_EXTRACFLAGS += -I$(srctree)/tools/include
348 +
349 ++CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
350 ++CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
351 ++
352 + hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
353 + hostprogs-$(CONFIG_KALLSYMS) += kallsyms
354 + hostprogs-$(CONFIG_LOGO) += pnmtologo
355 +@@ -23,8 +26,10 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
356 +
357 + HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
358 + HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
359 +-HOSTLDLIBS_sign-file = -lcrypto
360 +-HOSTLDLIBS_extract-cert = -lcrypto
361 ++HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS)
362 ++HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
363 ++HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
364 ++HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
365 +
366 + always := $(hostprogs-y) $(hostprogs-m)
367 +
368 +diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
369 +index 3f77a5d695c13..0bafed857e171 100755
370 +--- a/scripts/recordmcount.pl
371 ++++ b/scripts/recordmcount.pl
372 +@@ -268,7 +268,11 @@ if ($arch eq "x86_64") {
373 +
374 + # force flags for this arch
375 + $ld .= " -m shlelf_linux";
376 +- $objcopy .= " -O elf32-sh-linux";
377 ++ if ($endian eq "big") {
378 ++ $objcopy .= " -O elf32-shbig-linux";
379 ++ } else {
380 ++ $objcopy .= " -O elf32-sh-linux";
381 ++ }
382 +
383 + } elsif ($arch eq "powerpc") {
384 + my $ldemulation;
385 +diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
386 +index f25b5043cbcae..048b555c5acc9 100644
387 +--- a/virt/kvm/kvm_main.c
388 ++++ b/virt/kvm/kvm_main.c
389 +@@ -1598,10 +1598,12 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
390 + bool write_fault, bool *writable,
391 + kvm_pfn_t *p_pfn)
392 + {
393 +- unsigned long pfn;
394 ++ kvm_pfn_t pfn;
395 ++ pte_t *ptep;
396 ++ spinlock_t *ptl;
397 + int r;
398 +
399 +- r = follow_pfn(vma, addr, &pfn);
400 ++ r = follow_pte(vma->vm_mm, addr, &ptep, &ptl);
401 + if (r) {
402 + /*
403 + * get_user_pages fails for VM_IO and VM_PFNMAP vmas and does
404 +@@ -1616,14 +1618,19 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
405 + if (r)
406 + return r;
407 +
408 +- r = follow_pfn(vma, addr, &pfn);
409 ++ r = follow_pte(vma->vm_mm, addr, &ptep, &ptl);
410 + if (r)
411 + return r;
412 ++ }
413 +
414 ++ if (write_fault && !pte_write(*ptep)) {
415 ++ pfn = KVM_PFN_ERR_RO_FAULT;
416 ++ goto out;
417 + }
418 +
419 + if (writable)
420 +- *writable = true;
421 ++ *writable = pte_write(*ptep);
422 ++ pfn = pte_pfn(*ptep);
423 +
424 + /*
425 + * Get a reference here because callers of *hva_to_pfn* and
426 +@@ -1638,6 +1645,8 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
427 + */
428 + kvm_get_pfn(pfn);
429 +
430 ++out:
431 ++ pte_unmap_unlock(ptep, ptl);
432 + *p_pfn = pfn;
433 + return 0;
434 + }