Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Thu, 20 Jan 2022 10:00:54
Message-Id: 1642672840.8ccc4e665a43df9a1d94143ccfa1a96a5ebcd056.mpagano@gentoo
1 commit: 8ccc4e665a43df9a1d94143ccfa1a96a5ebcd056
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 20 10:00:40 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 20 10:00:40 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=8ccc4e66
7
8 Linux patch 5.4.173
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1172_linux-5.4.173.patch | 788 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 792 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 85a7c8aa..65d034ea 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -731,6 +731,10 @@ Patch: 1171_linux-5.4.172.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.172
23
24 +Patch: 1172_linux-5.4.173.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.173
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/1172_linux-5.4.173.patch b/1172_linux-5.4.173.patch
33 new file mode 100644
34 index 00000000..bba402e5
35 --- /dev/null
36 +++ b/1172_linux-5.4.173.patch
37 @@ -0,0 +1,788 @@
38 +diff --git a/Makefile b/Makefile
39 +index 2f914dd223c81..cb9e6cd0d0249 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 = 172
47 ++SUBLEVEL = 173
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +@@ -1022,7 +1022,7 @@ HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
52 +
53 + ifdef CONFIG_STACK_VALIDATION
54 + has_libelf := $(call try-run,\
55 +- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
56 ++ echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
57 + ifeq ($(has_libelf),1)
58 + objtool_target := tools/objtool FORCE
59 + else
60 +diff --git a/arch/arm/kernel/perf_callchain.c b/arch/arm/kernel/perf_callchain.c
61 +index 3b69a76d341e7..1626dfc6f6ce6 100644
62 +--- a/arch/arm/kernel/perf_callchain.c
63 ++++ b/arch/arm/kernel/perf_callchain.c
64 +@@ -62,9 +62,10 @@ user_backtrace(struct frame_tail __user *tail,
65 + void
66 + perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
67 + {
68 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
69 + struct frame_tail __user *tail;
70 +
71 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
72 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
73 + /* We don't support guest os callchain now */
74 + return;
75 + }
76 +@@ -98,9 +99,10 @@ callchain_trace(struct stackframe *fr,
77 + void
78 + perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
79 + {
80 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
81 + struct stackframe fr;
82 +
83 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
84 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
85 + /* We don't support guest os callchain now */
86 + return;
87 + }
88 +@@ -111,18 +113,21 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
89 +
90 + unsigned long perf_instruction_pointer(struct pt_regs *regs)
91 + {
92 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
93 +- return perf_guest_cbs->get_guest_ip();
94 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
95 ++
96 ++ if (guest_cbs && guest_cbs->is_in_guest())
97 ++ return guest_cbs->get_guest_ip();
98 +
99 + return instruction_pointer(regs);
100 + }
101 +
102 + unsigned long perf_misc_flags(struct pt_regs *regs)
103 + {
104 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
105 + int misc = 0;
106 +
107 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
108 +- if (perf_guest_cbs->is_user_mode())
109 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
110 ++ if (guest_cbs->is_user_mode())
111 + misc |= PERF_RECORD_MISC_GUEST_USER;
112 + else
113 + misc |= PERF_RECORD_MISC_GUEST_KERNEL;
114 +diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
115 +index fc388eb60e0b7..64cce0c8560ab 100644
116 +--- a/arch/arm/mm/Kconfig
117 ++++ b/arch/arm/mm/Kconfig
118 +@@ -743,6 +743,7 @@ config SWP_EMULATE
119 + config CPU_BIG_ENDIAN
120 + bool "Build big-endian kernel"
121 + depends on ARCH_SUPPORTS_BIG_ENDIAN
122 ++ depends on !LD_IS_LLD
123 + help
124 + Say Y if you plan on running a kernel in big-endian mode.
125 + Note that your board must be properly built and your board
126 +diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c
127 +index b0e03e052dd1d..b84ec4ce7d8dc 100644
128 +--- a/arch/arm64/kernel/perf_callchain.c
129 ++++ b/arch/arm64/kernel/perf_callchain.c
130 +@@ -102,7 +102,9 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
131 + void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
132 + struct pt_regs *regs)
133 + {
134 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
135 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
136 ++
137 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
138 + /* We don't support guest os callchain now */
139 + return;
140 + }
141 +@@ -147,9 +149,10 @@ static int callchain_trace(struct stackframe *frame, void *data)
142 + void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
143 + struct pt_regs *regs)
144 + {
145 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
146 + struct stackframe frame;
147 +
148 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
149 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
150 + /* We don't support guest os callchain now */
151 + return;
152 + }
153 +@@ -160,18 +163,21 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
154 +
155 + unsigned long perf_instruction_pointer(struct pt_regs *regs)
156 + {
157 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
158 +- return perf_guest_cbs->get_guest_ip();
159 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
160 ++
161 ++ if (guest_cbs && guest_cbs->is_in_guest())
162 ++ return guest_cbs->get_guest_ip();
163 +
164 + return instruction_pointer(regs);
165 + }
166 +
167 + unsigned long perf_misc_flags(struct pt_regs *regs)
168 + {
169 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
170 + int misc = 0;
171 +
172 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
173 +- if (perf_guest_cbs->is_user_mode())
174 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
175 ++ if (guest_cbs->is_user_mode())
176 + misc |= PERF_RECORD_MISC_GUEST_USER;
177 + else
178 + misc |= PERF_RECORD_MISC_GUEST_KERNEL;
179 +diff --git a/arch/csky/kernel/perf_callchain.c b/arch/csky/kernel/perf_callchain.c
180 +index ab55e98ee8f62..35318a635a5fa 100644
181 +--- a/arch/csky/kernel/perf_callchain.c
182 ++++ b/arch/csky/kernel/perf_callchain.c
183 +@@ -86,10 +86,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
184 + void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
185 + struct pt_regs *regs)
186 + {
187 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
188 + unsigned long fp = 0;
189 +
190 + /* C-SKY does not support virtualization. */
191 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
192 ++ if (guest_cbs && guest_cbs->is_in_guest())
193 + return;
194 +
195 + fp = regs->regs[4];
196 +@@ -110,10 +111,11 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
197 + void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
198 + struct pt_regs *regs)
199 + {
200 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
201 + struct stackframe fr;
202 +
203 + /* C-SKY does not support virtualization. */
204 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
205 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
206 + pr_warn("C-SKY does not support perf in guest mode!");
207 + return;
208 + }
209 +diff --git a/arch/nds32/kernel/perf_event_cpu.c b/arch/nds32/kernel/perf_event_cpu.c
210 +index 334c2a6cec23d..8a4f9babb1646 100644
211 +--- a/arch/nds32/kernel/perf_event_cpu.c
212 ++++ b/arch/nds32/kernel/perf_event_cpu.c
213 +@@ -1363,6 +1363,7 @@ void
214 + perf_callchain_user(struct perf_callchain_entry_ctx *entry,
215 + struct pt_regs *regs)
216 + {
217 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
218 + unsigned long fp = 0;
219 + unsigned long gp = 0;
220 + unsigned long lp = 0;
221 +@@ -1371,7 +1372,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry,
222 +
223 + leaf_fp = 0;
224 +
225 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
226 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
227 + /* We don't support guest os callchain now */
228 + return;
229 + }
230 +@@ -1479,9 +1480,10 @@ void
231 + perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
232 + struct pt_regs *regs)
233 + {
234 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
235 + struct stackframe fr;
236 +
237 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
238 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
239 + /* We don't support guest os callchain now */
240 + return;
241 + }
242 +@@ -1493,20 +1495,23 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
243 +
244 + unsigned long perf_instruction_pointer(struct pt_regs *regs)
245 + {
246 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
247 ++
248 + /* However, NDS32 does not support virtualization */
249 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
250 +- return perf_guest_cbs->get_guest_ip();
251 ++ if (guest_cbs && guest_cbs->is_in_guest())
252 ++ return guest_cbs->get_guest_ip();
253 +
254 + return instruction_pointer(regs);
255 + }
256 +
257 + unsigned long perf_misc_flags(struct pt_regs *regs)
258 + {
259 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
260 + int misc = 0;
261 +
262 + /* However, NDS32 does not support virtualization */
263 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
264 +- if (perf_guest_cbs->is_user_mode())
265 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
266 ++ if (guest_cbs->is_user_mode())
267 + misc |= PERF_RECORD_MISC_GUEST_USER;
268 + else
269 + misc |= PERF_RECORD_MISC_GUEST_KERNEL;
270 +diff --git a/arch/riscv/kernel/perf_callchain.c b/arch/riscv/kernel/perf_callchain.c
271 +index 8d2804f05cf93..22a93009362d7 100644
272 +--- a/arch/riscv/kernel/perf_callchain.c
273 ++++ b/arch/riscv/kernel/perf_callchain.c
274 +@@ -60,10 +60,11 @@ static unsigned long user_backtrace(struct perf_callchain_entry_ctx *entry,
275 + void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
276 + struct pt_regs *regs)
277 + {
278 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
279 + unsigned long fp = 0;
280 +
281 + /* RISC-V does not support perf in guest mode. */
282 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
283 ++ if (guest_cbs && guest_cbs->is_in_guest())
284 + return;
285 +
286 + fp = regs->s0;
287 +@@ -84,8 +85,10 @@ void notrace walk_stackframe(struct task_struct *task,
288 + void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
289 + struct pt_regs *regs)
290 + {
291 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
292 ++
293 + /* RISC-V does not support perf in guest mode. */
294 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
295 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
296 + pr_warn("RISC-V does not support perf in guest mode!");
297 + return;
298 + }
299 +diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
300 +index fd73a8aa89d23..8be5750fe5ac3 100644
301 +--- a/arch/s390/kvm/interrupt.c
302 ++++ b/arch/s390/kvm/interrupt.c
303 +@@ -1982,6 +1982,13 @@ int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu)
304 + return test_bit(IRQ_PEND_SIGP_STOP, &li->pending_irqs);
305 + }
306 +
307 ++int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu)
308 ++{
309 ++ struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
310 ++
311 ++ return test_bit(IRQ_PEND_RESTART, &li->pending_irqs);
312 ++}
313 ++
314 + void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu)
315 + {
316 + struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
317 +diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
318 +index b286818d8d54d..49dc00d82e5ea 100644
319 +--- a/arch/s390/kvm/kvm-s390.c
320 ++++ b/arch/s390/kvm/kvm-s390.c
321 +@@ -4205,10 +4205,15 @@ void kvm_s390_vcpu_stop(struct kvm_vcpu *vcpu)
322 + spin_lock(&vcpu->kvm->arch.start_stop_lock);
323 + online_vcpus = atomic_read(&vcpu->kvm->online_vcpus);
324 +
325 +- /* SIGP STOP and SIGP STOP AND STORE STATUS has been fully processed */
326 ++ /*
327 ++ * Set the VCPU to STOPPED and THEN clear the interrupt flag,
328 ++ * now that the SIGP STOP and SIGP STOP AND STORE STATUS orders
329 ++ * have been fully processed. This will ensure that the VCPU
330 ++ * is kept BUSY if another VCPU is inquiring with SIGP SENSE.
331 ++ */
332 ++ kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
333 + kvm_s390_clear_stop_irq(vcpu);
334 +
335 +- kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
336 + __disable_ibs_on_vcpu(vcpu);
337 +
338 + for (i = 0; i < online_vcpus; i++) {
339 +diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
340 +index 63d94a5253a8f..d497d3e58784b 100644
341 +--- a/arch/s390/kvm/kvm-s390.h
342 ++++ b/arch/s390/kvm/kvm-s390.h
343 +@@ -373,6 +373,7 @@ void kvm_s390_destroy_adapters(struct kvm *kvm);
344 + int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu);
345 + extern struct kvm_device_ops kvm_flic_ops;
346 + int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu);
347 ++int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu);
348 + void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu);
349 + int kvm_s390_set_irq_state(struct kvm_vcpu *vcpu,
350 + void __user *buf, int len);
351 +diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
352 +index 683036c1c92a8..3dc921e853b6e 100644
353 +--- a/arch/s390/kvm/sigp.c
354 ++++ b/arch/s390/kvm/sigp.c
355 +@@ -288,6 +288,34 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
356 + if (!dst_vcpu)
357 + return SIGP_CC_NOT_OPERATIONAL;
358 +
359 ++ /*
360 ++ * SIGP RESTART, SIGP STOP, and SIGP STOP AND STORE STATUS orders
361 ++ * are processed asynchronously. Until the affected VCPU finishes
362 ++ * its work and calls back into KVM to clear the (RESTART or STOP)
363 ++ * interrupt, we need to return any new non-reset orders "busy".
364 ++ *
365 ++ * This is important because a single VCPU could issue:
366 ++ * 1) SIGP STOP $DESTINATION
367 ++ * 2) SIGP SENSE $DESTINATION
368 ++ *
369 ++ * If the SIGP SENSE would not be rejected as "busy", it could
370 ++ * return an incorrect answer as to whether the VCPU is STOPPED
371 ++ * or OPERATING.
372 ++ */
373 ++ if (order_code != SIGP_INITIAL_CPU_RESET &&
374 ++ order_code != SIGP_CPU_RESET) {
375 ++ /*
376 ++ * Lockless check. Both SIGP STOP and SIGP (RE)START
377 ++ * properly synchronize everything while processing
378 ++ * their orders, while the guest cannot observe a
379 ++ * difference when issuing other orders from two
380 ++ * different VCPUs.
381 ++ */
382 ++ if (kvm_s390_is_stop_irq_pending(dst_vcpu) ||
383 ++ kvm_s390_is_restart_irq_pending(dst_vcpu))
384 ++ return SIGP_CC_BUSY;
385 ++ }
386 ++
387 + switch (order_code) {
388 + case SIGP_SENSE:
389 + vcpu->stat.instruction_sigp_sense++;
390 +diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
391 +index 00bccb4d17722..e4f7ac28dcf2b 100644
392 +--- a/arch/x86/events/core.c
393 ++++ b/arch/x86/events/core.c
394 +@@ -2366,10 +2366,11 @@ static bool perf_hw_regs(struct pt_regs *regs)
395 + void
396 + perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
397 + {
398 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
399 + struct unwind_state state;
400 + unsigned long addr;
401 +
402 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
403 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
404 + /* TODO: We don't support guest os callchain now */
405 + return;
406 + }
407 +@@ -2475,10 +2476,11 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *ent
408 + void
409 + perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
410 + {
411 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
412 + struct stack_frame frame;
413 + const unsigned long __user *fp;
414 +
415 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
416 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
417 + /* TODO: We don't support guest os callchain now */
418 + return;
419 + }
420 +@@ -2562,18 +2564,21 @@ static unsigned long code_segment_base(struct pt_regs *regs)
421 +
422 + unsigned long perf_instruction_pointer(struct pt_regs *regs)
423 + {
424 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest())
425 +- return perf_guest_cbs->get_guest_ip();
426 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
427 ++
428 ++ if (guest_cbs && guest_cbs->is_in_guest())
429 ++ return guest_cbs->get_guest_ip();
430 +
431 + return regs->ip + code_segment_base(regs);
432 + }
433 +
434 + unsigned long perf_misc_flags(struct pt_regs *regs)
435 + {
436 ++ struct perf_guest_info_callbacks *guest_cbs = perf_get_guest_cbs();
437 + int misc = 0;
438 +
439 +- if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
440 +- if (perf_guest_cbs->is_user_mode())
441 ++ if (guest_cbs && guest_cbs->is_in_guest()) {
442 ++ if (guest_cbs->is_user_mode())
443 + misc |= PERF_RECORD_MISC_GUEST_USER;
444 + else
445 + misc |= PERF_RECORD_MISC_GUEST_KERNEL;
446 +diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
447 +index 70758f99c9e47..b33540e1efa88 100644
448 +--- a/arch/x86/events/intel/core.c
449 ++++ b/arch/x86/events/intel/core.c
450 +@@ -2333,6 +2333,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
451 + {
452 + struct perf_sample_data data;
453 + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
454 ++ struct perf_guest_info_callbacks *guest_cbs;
455 + int bit;
456 + int handled = 0;
457 +
458 +@@ -2386,9 +2387,11 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
459 + */
460 + if (__test_and_clear_bit(55, (unsigned long *)&status)) {
461 + handled++;
462 +- if (unlikely(perf_guest_cbs && perf_guest_cbs->is_in_guest() &&
463 +- perf_guest_cbs->handle_intel_pt_intr))
464 +- perf_guest_cbs->handle_intel_pt_intr();
465 ++
466 ++ guest_cbs = perf_get_guest_cbs();
467 ++ if (unlikely(guest_cbs && guest_cbs->is_in_guest() &&
468 ++ guest_cbs->handle_intel_pt_intr))
469 ++ guest_cbs->handle_intel_pt_intr();
470 + else
471 + intel_pt_interrupt();
472 + }
473 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
474 +index 0aaf40be956ff..1f7dfa5aa42da 100644
475 +--- a/arch/x86/kvm/x86.c
476 ++++ b/arch/x86/kvm/x86.c
477 +@@ -1218,7 +1218,7 @@ static const u32 msrs_to_save_all[] = {
478 + MSR_IA32_UMWAIT_CONTROL,
479 +
480 + MSR_ARCH_PERFMON_FIXED_CTR0, MSR_ARCH_PERFMON_FIXED_CTR1,
481 +- MSR_ARCH_PERFMON_FIXED_CTR0 + 2, MSR_ARCH_PERFMON_FIXED_CTR0 + 3,
482 ++ MSR_ARCH_PERFMON_FIXED_CTR0 + 2,
483 + MSR_CORE_PERF_FIXED_CTR_CTRL, MSR_CORE_PERF_GLOBAL_STATUS,
484 + MSR_CORE_PERF_GLOBAL_CTRL, MSR_CORE_PERF_GLOBAL_OVF_CTRL,
485 + MSR_ARCH_PERFMON_PERFCTR0, MSR_ARCH_PERFMON_PERFCTR1,
486 +diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
487 +index 30d0523014e0d..5e9b00711357b 100644
488 +--- a/drivers/base/devtmpfs.c
489 ++++ b/drivers/base/devtmpfs.c
490 +@@ -25,6 +25,7 @@
491 + #include <linux/sched.h>
492 + #include <linux/slab.h>
493 + #include <linux/kthread.h>
494 ++#include <linux/fs_context.h>
495 + #include <uapi/linux/mount.h>
496 + #include "base.h"
497 +
498 +@@ -62,8 +63,15 @@ static struct dentry *public_dev_mount(struct file_system_type *fs_type, int fla
499 + const char *dev_name, void *data)
500 + {
501 + struct super_block *s = mnt->mnt_sb;
502 ++ int err;
503 ++
504 + atomic_inc(&s->s_active);
505 + down_write(&s->s_umount);
506 ++ err = reconfigure_single(s, flags, data);
507 ++ if (err < 0) {
508 ++ deactivate_locked_super(s);
509 ++ return ERR_PTR(err);
510 ++ }
511 + return dget(s->s_root);
512 + }
513 +
514 +diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
515 +index 59db70fb45614..314b9bb78e437 100644
516 +--- a/drivers/firmware/qemu_fw_cfg.c
517 ++++ b/drivers/firmware/qemu_fw_cfg.c
518 +@@ -385,9 +385,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
519 + struct fw_cfg_sysfs_entry *entry, *next;
520 +
521 + list_for_each_entry_safe(entry, next, &fw_cfg_entry_cache, list) {
522 +- /* will end up invoking fw_cfg_sysfs_cache_delist()
523 +- * via each object's release() method (i.e. destructor)
524 +- */
525 ++ fw_cfg_sysfs_cache_delist(entry);
526 + kobject_put(&entry->kobj);
527 + }
528 + }
529 +@@ -445,7 +443,6 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
530 + {
531 + struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
532 +
533 +- fw_cfg_sysfs_cache_delist(entry);
534 + kfree(entry);
535 + }
536 +
537 +@@ -598,20 +595,18 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
538 + /* set file entry information */
539 + entry->size = be32_to_cpu(f->size);
540 + entry->select = be16_to_cpu(f->select);
541 +- memcpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
542 ++ strscpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
543 +
544 + /* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
545 + err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
546 + fw_cfg_sel_ko, "%d", entry->select);
547 +- if (err) {
548 +- kobject_put(&entry->kobj);
549 +- return err;
550 +- }
551 ++ if (err)
552 ++ goto err_put_entry;
553 +
554 + /* add raw binary content access */
555 + err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
556 + if (err)
557 +- goto err_add_raw;
558 ++ goto err_del_entry;
559 +
560 + /* try adding "/sys/firmware/qemu_fw_cfg/by_name/" symlink */
561 + fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->name);
562 +@@ -620,9 +615,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
563 + fw_cfg_sysfs_cache_enlist(entry);
564 + return 0;
565 +
566 +-err_add_raw:
567 ++err_del_entry:
568 + kobject_del(&entry->kobj);
569 +- kfree(entry);
570 ++err_put_entry:
571 ++ kobject_put(&entry->kobj);
572 + return err;
573 + }
574 +
575 +diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
576 +index 96b85d66e7a87..fe58723fc5ac7 100644
577 +--- a/drivers/media/usb/uvc/uvc_video.c
578 ++++ b/drivers/media/usb/uvc/uvc_video.c
579 +@@ -1915,6 +1915,10 @@ static int uvc_video_start_transfer(struct uvc_streaming *stream,
580 + if (ep == NULL)
581 + return -EIO;
582 +
583 ++ /* Reject broken descriptors. */
584 ++ if (usb_endpoint_maxp(&ep->desc) == 0)
585 ++ return -EIO;
586 ++
587 + ret = uvc_init_video_bulk(stream, ep, gfp_flags);
588 + }
589 +
590 +diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
591 +index a7e47e068ad9b..7769a9b556c70 100644
592 +--- a/drivers/mtd/chips/Kconfig
593 ++++ b/drivers/mtd/chips/Kconfig
594 +@@ -55,12 +55,14 @@ choice
595 + LITTLE_ENDIAN_BYTE, if the bytes are reversed.
596 +
597 + config MTD_CFI_NOSWAP
598 ++ depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN
599 + bool "NO"
600 +
601 + config MTD_CFI_BE_BYTE_SWAP
602 + bool "BIG_ENDIAN_BYTE"
603 +
604 + config MTD_CFI_LE_BYTE_SWAP
605 ++ depends on !ARCH_IXP4XX
606 + bool "LITTLE_ENDIAN_BYTE"
607 +
608 + endchoice
609 +diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
610 +index bc82305ebb4c2..ffbf4f6cb9cfe 100644
611 +--- a/drivers/mtd/maps/Kconfig
612 ++++ b/drivers/mtd/maps/Kconfig
613 +@@ -303,7 +303,7 @@ config MTD_DC21285
614 +
615 + config MTD_IXP4XX
616 + tristate "CFI Flash device mapped on Intel IXP4xx based systems"
617 +- depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
618 ++ depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS
619 + help
620 + This enables MTD access to flash devices on platforms based
621 + on Intel's IXP4xx family of network processors such as the
622 +diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
623 +index f070f25bb735a..df7a14320fd29 100644
624 +--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
625 ++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
626 +@@ -1000,6 +1000,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
627 + _initpabias(hw);
628 + rtl92c_dm_init(hw);
629 + exit:
630 ++ local_irq_disable();
631 + local_irq_restore(flags);
632 + return err;
633 + }
634 +diff --git a/fs/fs_context.c b/fs/fs_context.c
635 +index 138b5b4d621d2..a2367c7aef5b3 100644
636 +--- a/fs/fs_context.c
637 ++++ b/fs/fs_context.c
638 +@@ -585,7 +585,7 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
639 + param->key);
640 + }
641 +
642 +- if (len > PAGE_SIZE - 2 - size)
643 ++ if (size + len + 2 > PAGE_SIZE)
644 + return invalf(fc, "VFS: Legacy: Cumulative options too large");
645 + if (strchr(param->key, ',') ||
646 + (param->type == fs_value_is_string &&
647 +diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
648 +index 2bb916d68576f..023b9bc54b7ce 100644
649 +--- a/fs/orangefs/orangefs-bufmap.c
650 ++++ b/fs/orangefs/orangefs-bufmap.c
651 +@@ -179,7 +179,7 @@ orangefs_bufmap_free(struct orangefs_bufmap *bufmap)
652 + {
653 + kfree(bufmap->page_array);
654 + kfree(bufmap->desc_array);
655 +- kfree(bufmap->buffer_index_array);
656 ++ bitmap_free(bufmap->buffer_index_array);
657 + kfree(bufmap);
658 + }
659 +
660 +@@ -229,8 +229,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
661 + bufmap->desc_size = user_desc->size;
662 + bufmap->desc_shift = ilog2(bufmap->desc_size);
663 +
664 +- bufmap->buffer_index_array =
665 +- kzalloc(DIV_ROUND_UP(bufmap->desc_count, BITS_PER_LONG), GFP_KERNEL);
666 ++ bufmap->buffer_index_array = bitmap_zalloc(bufmap->desc_count, GFP_KERNEL);
667 + if (!bufmap->buffer_index_array)
668 + goto out_free_bufmap;
669 +
670 +@@ -253,7 +252,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc)
671 + out_free_desc_array:
672 + kfree(bufmap->desc_array);
673 + out_free_index_array:
674 +- kfree(bufmap->buffer_index_array);
675 ++ bitmap_free(bufmap->buffer_index_array);
676 + out_free_bufmap:
677 + kfree(bufmap);
678 + out:
679 +diff --git a/fs/super.c b/fs/super.c
680 +index 877532baf513d..b289356f302fc 100644
681 +--- a/fs/super.c
682 ++++ b/fs/super.c
683 +@@ -1470,8 +1470,8 @@ struct dentry *mount_nodev(struct file_system_type *fs_type,
684 + }
685 + EXPORT_SYMBOL(mount_nodev);
686 +
687 +-static int reconfigure_single(struct super_block *s,
688 +- int flags, void *data)
689 ++int reconfigure_single(struct super_block *s,
690 ++ int flags, void *data)
691 + {
692 + struct fs_context *fc;
693 + int ret;
694 +diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h
695 +index ba8a58754340d..ebcb91a57e865 100644
696 +--- a/include/linux/fs_context.h
697 ++++ b/include/linux/fs_context.h
698 +@@ -135,6 +135,8 @@ extern int generic_parse_monolithic(struct fs_context *fc, void *data);
699 + extern int vfs_get_tree(struct fs_context *fc);
700 + extern void put_fs_context(struct fs_context *fc);
701 + extern void fc_drop_locked(struct fs_context *fc);
702 ++int reconfigure_single(struct super_block *s,
703 ++ int flags, void *data);
704 +
705 + /*
706 + * sget() wrappers to be called from the ->get_tree() op.
707 +diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
708 +index 68ccc5b1913b4..b7ac395513c0f 100644
709 +--- a/include/linux/perf_event.h
710 ++++ b/include/linux/perf_event.h
711 +@@ -1175,7 +1175,18 @@ extern void perf_event_bpf_event(struct bpf_prog *prog,
712 + enum perf_bpf_event_type type,
713 + u16 flags);
714 +
715 +-extern struct perf_guest_info_callbacks *perf_guest_cbs;
716 ++extern struct perf_guest_info_callbacks __rcu *perf_guest_cbs;
717 ++static inline struct perf_guest_info_callbacks *perf_get_guest_cbs(void)
718 ++{
719 ++ /*
720 ++ * Callbacks are RCU-protected and must be READ_ONCE to avoid reloading
721 ++ * the callbacks between a !NULL check and dereferences, to ensure
722 ++ * pending stores/changes to the callback pointers are visible before a
723 ++ * non-NULL perf_guest_cbs is visible to readers, and to prevent a
724 ++ * module from unloading callbacks while readers are active.
725 ++ */
726 ++ return rcu_dereference(perf_guest_cbs);
727 ++}
728 + extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
729 + extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
730 +
731 +diff --git a/kernel/events/core.c b/kernel/events/core.c
732 +index 6ffe3d3e7b06d..7e124f9abb18b 100644
733 +--- a/kernel/events/core.c
734 ++++ b/kernel/events/core.c
735 +@@ -6045,18 +6045,25 @@ static void perf_pending_event(struct irq_work *entry)
736 + * Later on, we might change it to a list if there is
737 + * another virtualization implementation supporting the callbacks.
738 + */
739 +-struct perf_guest_info_callbacks *perf_guest_cbs;
740 ++struct perf_guest_info_callbacks __rcu *perf_guest_cbs;
741 +
742 + int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs)
743 + {
744 +- perf_guest_cbs = cbs;
745 ++ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs)))
746 ++ return -EBUSY;
747 ++
748 ++ rcu_assign_pointer(perf_guest_cbs, cbs);
749 + return 0;
750 + }
751 + EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks);
752 +
753 + int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs)
754 + {
755 +- perf_guest_cbs = NULL;
756 ++ if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs) != cbs))
757 ++ return -EINVAL;
758 ++
759 ++ rcu_assign_pointer(perf_guest_cbs, NULL);
760 ++ synchronize_rcu();
761 + return 0;
762 + }
763 + EXPORT_SYMBOL_GPL(perf_unregister_guest_info_callbacks);
764 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
765 +index 022799479a722..d06205626cd54 100644
766 +--- a/sound/pci/hda/patch_realtek.c
767 ++++ b/sound/pci/hda/patch_realtek.c
768 +@@ -1926,6 +1926,7 @@ enum {
769 + ALC887_FIXUP_ASUS_BASS,
770 + ALC887_FIXUP_BASS_CHMAP,
771 + ALC1220_FIXUP_GB_DUAL_CODECS,
772 ++ ALC1220_FIXUP_GB_X570,
773 + ALC1220_FIXUP_CLEVO_P950,
774 + ALC1220_FIXUP_CLEVO_PB51ED,
775 + ALC1220_FIXUP_CLEVO_PB51ED_PINS,
776 +@@ -2115,6 +2116,29 @@ static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
777 + }
778 + }
779 +
780 ++static void alc1220_fixup_gb_x570(struct hda_codec *codec,
781 ++ const struct hda_fixup *fix,
782 ++ int action)
783 ++{
784 ++ static const hda_nid_t conn1[] = { 0x0c };
785 ++ static const struct coef_fw gb_x570_coefs[] = {
786 ++ WRITE_COEF(0x1a, 0x01c1),
787 ++ WRITE_COEF(0x1b, 0x0202),
788 ++ WRITE_COEF(0x43, 0x3005),
789 ++ {}
790 ++ };
791 ++
792 ++ switch (action) {
793 ++ case HDA_FIXUP_ACT_PRE_PROBE:
794 ++ snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
795 ++ snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
796 ++ break;
797 ++ case HDA_FIXUP_ACT_INIT:
798 ++ alc_process_coef_fw(codec, gb_x570_coefs);
799 ++ break;
800 ++ }
801 ++}
802 ++
803 + static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
804 + const struct hda_fixup *fix,
805 + int action)
806 +@@ -2417,6 +2441,10 @@ static const struct hda_fixup alc882_fixups[] = {
807 + .type = HDA_FIXUP_FUNC,
808 + .v.func = alc1220_fixup_gb_dual_codecs,
809 + },
810 ++ [ALC1220_FIXUP_GB_X570] = {
811 ++ .type = HDA_FIXUP_FUNC,
812 ++ .v.func = alc1220_fixup_gb_x570,
813 ++ },
814 + [ALC1220_FIXUP_CLEVO_P950] = {
815 + .type = HDA_FIXUP_FUNC,
816 + .v.func = alc1220_fixup_clevo_p950,
817 +@@ -2519,7 +2547,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
818 + SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
819 + SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
820 + SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
821 +- SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
822 ++ SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
823 + SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
824 + SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
825 + SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),