Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0200-5.4.101-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


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