5.15.75-rc1 review
Subsystems (9)
Greg Kroah-Hartman
maintainerPATCH 256/530 ia64: export memory_add_physaddr_to_nid to fix cxl build error
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 97c318bfbe84efded246e80428054f300042f110 ]
cxl_pmem.ko uses memory_add_physaddr_to_nid() but ia64 does not export it, so this causes a build error:
ERROR: modpost: "memory_add_physaddr_to_nid" [drivers/cxl/cxl_pmem.ko] undefined!
Fix this by exporting that function.
--- arch/ia64/mm/numa.c | 1 + 1 file changed, 1 insertion(+)
arch/ia64/mm/numa.c +1 -0
@@ -75,5 +75,6 @@ int memory_add_physaddr_to_nid(u64 addr)return 0 ;return nid; } +EXPORT_SYMBOL (memory_add_physaddr_to_nid);#endif #endif
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 86/530 hardening: Avoid harmless Clang option under CONFIG_INIT_STACK_ALL_ZERO
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit f02003c860d921171be4a27e2893766eb3bc6871 upstream.
Currently under Clang, CC_HAS_AUTO_VAR_INIT_ZERO requires an extra -enable flag compared to CC_HAS_AUTO_VAR_INIT_PATTERN. GCC 12[1] will not, and will happily ignore the Clang-specific flag. However, its presence on the command-line is both cumbersome and confusing. Due to GCC's tolerant behavior, though, we can continue to use a single Kconfig cc-option test for the feature on both compilers, but then drop the Clang-specific option in the Makefile.
In other words, this patch does not change anything other than making the compiler command line shorter once GCC supports -ftrivial-auto-var-init=zero.
[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a25e0b5e6ac8a77a71c229e0a7b744603365b0e9
--- Makefile | 6 +++--- security/Kconfig.hardening | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-)
Makefile +3 -3
@@ -844,12 +844,12 @@ endif # Initialize all stack variables with a zero value. ifdef CONFIG_INIT_STACK_ALL_ZERO -# Future support for zero initialization is still being debated, see -# https://bugs.llvm.org/show_bug.cgi?id=45497. These flags are subject to being -# renamed or dropped. KBUILD_CFLAGS += -ftrivial-auto-var-init=zero +ifdef CONFIG_CC_IS_CLANG +# https://bugs.llvm.org/show_bug.cgi?id=45497 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang endif +endif # While VLAs have been removed, GCC produces unreachable stack probes # for the randomize_kstack_offset feature. Disable it for all compilers.
security/Kconfig.hardening +4 -1
@@ -23,13 +23,16 @@ config CC_HAS_AUTO_VAR_INIT_PATTERN def_bool $(cc-option,-ftrivial-auto-var-init=pattern) config CC_HAS_AUTO_VAR_INIT_ZERO + # GCC ignores the -enable flag, so we can test for the feature with + # a single invocation using the flag, but drop it as appropriate in + # the Makefile, depending on the presence of Clang. def_bool $(cc-option,-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang) choice prompt "Initialize kernel stack variables at function entry" default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL if COMPILE_TEST && GCC_PLUGINS default INIT_STACK_ALL_PATTERN if COMPILE_TEST && CC_HAS_AUTO_VAR_INIT_PATTERN - default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_PATTERN + default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO default INIT_STACK_NONE help This option enables initialization of stack variables at
Greg Kroah-Hartman
maintainerPATCH 87/530 hardening: Remove Clangs enable flag for -ftrivial-auto-var-init=zero
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit 607e57c6c62c00965ae276902c166834ce73014a upstream.
Now that Clang's -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang option is no longer required, remove it from the command line. Clang 16
and later will warn when it is used, which will cause Kconfig to think
it can't use -ftrivial-auto-var-init=zero at all. Check for whether it
is required and only use it when so.
--- Makefile | 4 ++-- security/Kconfig.hardening | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-)
Makefile +2 -2
@@ -845,8 +845,8 @@ endif # Initialize all stack variables with a zero value. ifdef CONFIG_INIT_STACK_ALL_ZERO KBUILD_CFLAGS += -ftrivial-auto-var-init=zero -ifdef CONFIG_CC_IS_CLANG -# https://bugs.llvm.org/show_bug.cgi?id=45497 +ifdef CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER +# https://github.com/llvm/llvm-project/issues/44842 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang endif endif
security/Kconfig.hardening +10 -4
@@ -22,11 +22,17 @@ menu "Memory initialization" config CC_HAS_AUTO_VAR_INIT_PATTERN def_bool $(cc-option,-ftrivial-auto-var-init=pattern) -config CC_HAS_AUTO_VAR_INIT_ZERO - # GCC ignores the -enable flag, so we can test for the feature with - # a single invocation using the flag, but drop it as appropriate in - # the Makefile, depending on the presence of Clang. +config CC_HAS_AUTO_VAR_INIT_ZERO_BARE + def_bool $(cc-option,-ftrivial-auto-var-init=zero) + +config CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER + # Clang 16 and later warn about using the -enable flag, but it + # is required before then. def_bool $(cc-option,-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang) + depends on !CC_HAS_AUTO_VAR_INIT_ZERO_BARE + +config CC_HAS_AUTO_VAR_INIT_ZERO + def_bool CC_HAS_AUTO_VAR_INIT_ZERO_BARE || CC_HAS_AUTO_VAR_INIT_ZERO_ENABLER choice prompt "Initialize kernel stack variables at function entry"
Greg Kroah-Hartman
maintainerPATCH 388/530 tracing: kprobe: Fix kprobe event gen test module on exit
In reply to Greg Kroah-HartmanFrom: Yipeng Zou <[email protected]>
[ Upstream commit ac48e189527fae87253ef2bf58892e782fb36874 ]
Correct gen_kretprobe_test clr event para on module exit. This will make it can't to delete.
--- kernel/trace/kprobe_event_gen_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/kprobe_event_gen_test.c +1 -1
@@ -206,7 +206,7 @@ static void __exit kprobe_event_gen_test_exit(void)WARN_ON (kprobe_event_delete ("gen_kprobe_test" ));/* Disable the event or you can't remove it */ -WARN_ON (trace_array_set_clr_event (gen_kprobe_test->tr, +WARN_ON (trace_array_set_clr_event (gen_kretprobe_test->tr,"kprobes" ,"gen_kretprobe_test" , false));
Signature · 9 lines
2.35.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Greg Kroah-Hartman
maintainerPATCH 389/530 tracing: kprobe: Make gen test module work in arm and riscv
In reply to Greg Kroah-HartmanFrom: Yipeng Zou <[email protected]>
[ Upstream commit d8ef45d66c01425ff748e13ef7dd1da7a91cc93c ]
For now, this selftest module can only work in x86 because of the kprobe cmd was fixed use of x86 registers.
This patch adapted to register names under arm and riscv, So that this module can be worked on those platform.
--- kernel/trace/kprobe_event_gen_test.c | 47 +++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-)
kernel/trace/kprobe_event_gen_test.c +43 -4
@@ -35,6 +35,45 @@static struct trace_event_file *gen_kprobe_test;static struct trace_event_file *gen_kretprobe_test; +#define KPROBE_GEN_TEST_FUNC "do_sys_open" + +/* X86 */ +#if defined(CONFIG_X86_64 ) || defined(CONFIG_X86_32 ) +#define KPROBE_GEN_TEST_ARG0 "dfd=%ax" +#define KPROBE_GEN_TEST_ARG1 "filename=%dx" +#define KPROBE_GEN_TEST_ARG2 "flags=%cx" +#define KPROBE_GEN_TEST_ARG3 "mode=+4($stack)" + +/* ARM64 */ +#elif defined(CONFIG_ARM64 ) +#define KPROBE_GEN_TEST_ARG0 "dfd=%x0" +#define KPROBE_GEN_TEST_ARG1 "filename=%x1" +#define KPROBE_GEN_TEST_ARG2 "flags=%x2" +#define KPROBE_GEN_TEST_ARG3 "mode=%x3" + +/* ARM */ +#elif defined(CONFIG_ARM ) +#define KPROBE_GEN_TEST_ARG0 "dfd=%r0" +#define KPROBE_GEN_TEST_ARG1 "filename=%r1" +#define KPROBE_GEN_TEST_ARG2 "flags=%r2" +#define KPROBE_GEN_TEST_ARG3 "mode=%r3" + +/* RISCV */ +#elif defined(CONFIG_RISCV ) +#define KPROBE_GEN_TEST_ARG0 "dfd=%a0" +#define KPROBE_GEN_TEST_ARG1 "filename=%a1" +#define KPROBE_GEN_TEST_ARG2 "flags=%a2" +#define KPROBE_GEN_TEST_ARG3 "mode=%a3" + +/* others */ +#else +#define KPROBE_GEN_TEST_ARG0 NULL +#define KPROBE_GEN_TEST_ARG1 NULL +#define KPROBE_GEN_TEST_ARG2 NULL +#define KPROBE_GEN_TEST_ARG3 NULL +#endif + +/* * Test to make sure we can create a kprobe event, then add more * fields.
@@ -58,14 +97,14 @@ static int __init test_gen_kprobe_cmd(void)* fields. */ ret =kprobe_event_gen_cmd_start (&cmd,"gen_kprobe_test" , -"do_sys_open" , -"dfd=%ax" ,"filename=%dx" ); +KPROBE_GEN_TEST_FUNC , +KPROBE_GEN_TEST_ARG0 ,KPROBE_GEN_TEST_ARG1 );if (ret) goto free;/* Use kprobe_event_add_fields to add the rest of the fields */ - ret =kprobe_event_add_fields (&cmd,"flags=%cx" ,"mode=+4($stack)" ); + ret =kprobe_event_add_fields (&cmd,KPROBE_GEN_TEST_ARG2 ,KPROBE_GEN_TEST_ARG3 );if (ret) goto free;
@@ -128,7 +167,7 @@ static int __init test_gen_kretprobe_cmd(void)* Define the kretprobe event. */ ret =kretprobe_event_gen_cmd_start (&cmd,"gen_kretprobe_test" , -"do_sys_open" , +KPROBE_GEN_TEST_FUNC ,"$retval" );if (ret) goto free;
Signature · 9 lines
2.35.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Greg Kroah-Hartman
maintainerPATCH 407/530 MIPS: BCM47XX: Cast memcmp() of function to (void *)
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 0dedcf6e3301836eb70cfa649052e7ce4fcd13ba ]
Clang is especially sensitive about argument type matching when using __overloaded functions (like memcmp(), etc). Help it see that function pointers are just "void *". Avoids this error:
arch/mips/bcm47xx/prom.c:89:8: error: no matching function for call to 'memcmp'
if (!memcmp(prom_init, prom_init + mem, 32))
^~~~~~include/linux/string.h:156:12: note: candidate function not viable: no known conversion from 'void (void)' to 'const void *' for 1st argument extern int memcmp(const void *,const void *,__kernel_size_t);
--- arch/mips/bcm47xx/prom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/bcm47xx/prom.c +2 -2
@@ -86,7 +86,7 @@ static __init void prom_init_mem(void)pr_debug ("Assume 128MB RAM\n" );break ; } -if (!memcmp (prom_init, prom_init + mem,32 )) +if (!memcmp ((void *)prom_init, (void *)prom_init + mem,32 ))break ; } lowmem = mem;
@@ -159,7 +159,7 @@ void __init bcm47xx_prom_highmem_init(void) off =EXTVBASE +__pa (off);for (extmem =128 <<20 ; extmem <512 <<20 ; extmem <<=1 ) { -if (!memcmp (prom_init, (void *)(off + extmem),16 )) +if (!memcmp ((void *)prom_init, (void *)(off + extmem),16 ))break ; } extmem -= lowmem;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 412/530 x86/entry: Work around Clang __bdos() bug
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 3e1730842f142add55dc658929221521a9ea62b6 ]
Clang produces a false positive when building with CONFIG_FORTIFY_SOURCE=y and CONFIG_UBSAN_BOUNDS=y when operating on an array with a dynamic offset. Work around this by using a direct assignment of an empty instance. Avoids this warning:
../include/linux/fortify-string.h:309:4: warning: call to __write_overflow_field declared with 'warn ing' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wat tribute-warning]
__write_overflow_field(p_size_field, size);
^which was isolated to the memset() call in xen_load_idt().
Note that this looks very much like another bug that was worked around:
https://github.com/ClangBuiltLinux/linux/issues/1592
--- arch/x86/xen/enlighten_pv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/xen/enlighten_pv.c +2 -1
@@ -759,6 +759,7 @@ static void xen_load_idt(const struct desc_ptr *desc) {static DEFINE_SPINLOCK (lock);static struct trap_info traps[257 ]; +static const struct trap_info zero = { };unsigned out;trace_xen_cpu_load_idt (desc);
@@ -768,7 +769,7 @@ static void xen_load_idt(const struct desc_ptr *desc)memcpy (this_cpu_ptr (&idt_desc), desc,sizeof (idt_desc)); out =xen_convert_trap_info (desc, traps, false); -memset (&traps[out],0 ,sizeof (traps[0 ])); + traps[out] = zero;xen_mc_flush ();if (HYPERVISOR_set_trap_table (traps))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 410/530 ARM: decompressor: Include .data.rel.ro.local
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 1b64daf413acd86c2c13f5443f6b4ef3690c8061 ]
The .data.rel.ro.local section has the same semantics as .data.rel.ro here, so include it in the .rodata section of the decompressor. Additionally since the .printk_index section isn't usable outside of the core kernel, discard it in the decompressor. Avoids these warnings:
arm-linux-gnueabi-ld: warning: orphan section .data.rel.ro.local' from arch/arm/boot/compressed/fdt_rw.o' being placed in section `.data.rel.ro.local'
arm-linux-gnueabi-ld: warning: orphan section .printk_index' from arch/arm/boot/compressed/fdt_rw.o' being placed in section `.printk_index'
--- arch/arm/boot/compressed/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/compressed/vmlinux.lds.S +2 -0
@@ -23,6 +23,7 @@ SECTIONS *(.ARM.extab*) *(.note.*) *(.rel.*) + *(.printk_index) /* * Discard any r/w data - this produces a link error if we have any, * which is required for PIC decompression. Local data generates
@@ -57,6 +58,7 @@ SECTIONS *(.rodata) *(.rodata.*) *(.data.rel.ro) + *(.data.rel.ro.*) } .piggydata : { *(.piggydata)
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 11/530 io_uring/net: dont update msg_name if not provided
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit 6f10ae8a155446248055c7ddd480ef40139af788 upstream.
io_sendmsg_copy_hdr() may clear msg->msg_name if the userspace didn't provide it, we should retain NULL in this case.
--- fs/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/io_uring.c +2 -1
@@ -4762,7 +4762,8 @@ static int io_setup_async_msg(struct io_ async_msg = req->async_data; req->flags |=REQ_F_NEED_CLEANUP ;memcpy (async_msg, kmsg,sizeof (*kmsg)); - async_msg->msg.msg_name = &async_msg->addr; +if (async_msg->msg.msg_name) + async_msg->msg.msg_name = &async_msg->addr;/* if were using fast_iov, set it to the new one */ if (!async_msg->free_iov) async_msg->msg.msg_iter.iov = async_msg->fast_iov;
Greg Kroah-Hartman
maintainerPATCH 16/530 iio: ltc2497: Fix reading conversion results
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
commit 7f4f1096d5921f5d90547596f9ce80e0b924f887 upstream.
After the result of the previous conversion is read the chip automatically starts a new conversion and doesn't accept new i2c transfers until this conversion is completed which makes the function return failure.
So add an early return iff the programming of the new address isn't needed. Note this will not fix the problem in general, but all cases that are currently used. Once this changes we get the failure back, but this can be addressed when the need arises.
--- drivers/iio/adc/ltc2497.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/iio/adc/ltc2497.c +13 -0
@@ -41,6 +41,19 @@ static int ltc2497_result_and_measure(st } *val = (be32_to_cpu (st->buf) >>14 ) - (1 <<17 ); + +/* +* The part started a new conversion at the end of the above i2c +* transfer, so if the address didn't change since the last call +* everything is fine and we can return early. +* If not (which should only happen when some sort of bulk +* conversion is implemented) we have to program the new +* address. Note that this probably fails as the conversion that +* was triggered above is like not complete yet and the two +* operations have to be done in a single transfer. +*/ +if (ddata->addr_prev == address) +return 0 ; } ret = i2c_smbus_write_byte(st->client,
Greg Kroah-Hartman
maintainerPATCH 21/530 usb: add quirks for Lenovo OneLink+ Dock
In reply to Greg Kroah-HartmanFrom: Jean-Francois Le Fillatre <[email protected]>
commit 37d49519b41405b08748392c6a7f193d9f77ecd2 upstream.
The Lenovo OneLink+ Dock contains two VL812 USB3.0 controllers:
17ef:1018 upstream
17ef:1019 downstream
These hubs suffer from two separate problems:
1) After the host system was suspended and woken up, the hubs appear to be in a random state. Some downstream ports (both internal to the built-in audio and network controllers, and external to USB sockets) may no longer be functional. The exact list of disabled ports (if any) changes from wakeup to wakeup. Ports remain in that state until the dock is power-cycled, or until the laptop is rebooted.
Wakeup sources connected to the hubs (keyboard, WoL on the integrated gigabit controller) will wake the system up from suspend, but they may no longer work after wakeup (and in that case will no longer work as wakeup source in a subsequent suspend-wakeup cycle).
This issue appears in the logs with messages such as:
usb 1-6.1-port4: cannot disable (err = -71)
usb 1-6-port2: cannot disable (err = -71)
usb 1-6.1: clear tt 1 (80c0) error -71
usb 1-6-port4: cannot disable (err = -71)
usb 1-6.4: PM: dpm_run_callback(): usb_dev_resume+0x0/0x10 [usbcore] returns -71
usb 1-6.4: PM: failed to resume async: error -71
usb 1-7: reset full-speed USB device number 5 using xhci_hcd
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad?
usb 1-6.1-port1: cannot disable (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad?
usb 1-6.1-port1: cannot disable (err = -71)2) Some USB devices cannot be enumerated properly. So far I have only seen the issue with USB 3.0 devices. The same devices work without problem directly connected to the host system, to other systems or to other hubs (even when those hubs are connected to the OneLink+ dock).
One very reliable reproducer is this USB 3.0 HDD enclosure:
152d:9561 JMicron Technology Corp. / JMicron USA Technology Corp. Mobius
I have seen it happen sporadically with other USB 3.0 enclosures, with controllers from different manufacturers, all self-powered.
Typical messages in the logs:
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 6, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 7, error -62
usb 2-1-port4: attempt power cycle
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 8, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 9, error -62
usb 2-1-port4: unable to enumerate USB device
Through trial and error, I found that the USB_QUIRK_RESET_RESUME solved the second issue. Further testing then uncovered the first issue. Test results are summarized in this table:
=======================================================================================
Settings USB2 hotplug USB3 hotplug State after waking up
---------------------------------------------------------------------------------------
power/control=auto works fails broken
usbcore.autosuspend=-1 works works broken
OR power/control=on
power/control=auto works (1) works (1) works
and USB_QUIRK_RESET_RESUME
power/control=on works works works
and USB_QUIRK_RESET_RESUME
HUB_QUIRK_DISABLE_AUTOSUSPEND works works works
and USB_QUIRK_RESET_RESUME
=======================================================================================
In those results, the power/control settings are applied to both hubs, both on the USB2 and USB3 side, before each test.
Quoted 1 line
From those results,
USB_QUIRK_RESET_RESUMEis required to reset the hubs
properly after a suspend-wakeup cycle, and the hubs must not autosuspend to work around the USB3 issue.
A secondary effect of USB_QUIRK_RESET_RESUME is to prevent the hubs' upstream links from suspending (the downstream ports can still suspend). This secondary effect is used in results (1). It is enough to solve the USB3 problem.
Setting USB_QUIRK_RESET_RESUME on those hubs is the smallest patch that solves both issues.
Prior to creating this patch, I have used the USB_QUIRK_RESET_RESUME via the kernel command line for over a year without noticing any side effect.
Thanks to Oliver Neukum @Suse for explanations of the operations of USB_QUIRK_RESET_RESUME, and requesting more testing.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -437,6 +437,10 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x1532, 0x0116), .driver_info = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + /* Lenovo ThinkPad OneLink+ Dock twin hub controllers (VIA Labs VL812) */ + { USB_DEVICE(0x17ef, 0x1018), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x17ef, 0x1019), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Lenovo USB-C to Ethernet Adapter RTL8153-04 */ { USB_DEVICE(0x17ef, 0x720c), .driver_info = USB_QUIRK_NO_LPM },
Greg Kroah-Hartman
maintainerPATCH 1/530 Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
In reply to Greg Kroah-HartmanThis reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6.
Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81.
The commit is missing dependencies and breaks NFS tests, remove it for now.
--- fs/splice.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/splice.c +6 -4
@@ -814,15 +814,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, {struct pipe_inode_info *pipe;long ret, bytes; +umode_t i_mode;size_t len;int i, flags, more;/* -* We require the input to be seekable, as we don't want to randomly -* drop data for eg socket -> socket splicing. Use the piped splicing -* for that! +* We require the input being a regular file, as we don't want to +* randomly drop data for eg socket -> socket splicing. Use the +* piped splicing for that! */ -if (unlikely (!(in->f_mode &FMODE_LSEEK ))) + i_mode =file_inode (in)->i_mode; +if (unlikely (!S_ISREG (i_mode) && !S_ISBLK (i_mode)))return -EINVAL ;/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 10/530 mtd: rawnand: atmel: Unmap streaming DMA mappings
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 1161703c9bd664da5e3b2eb1a3bb40c210e026ea upstream.
Every dma_map_single() call should have its dma_unmap_single() counterpart, because the DMA address space is a shared resource and one could render the machine unusable by consuming all DMA addresses.
--- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -0
@@ -405,6 +405,7 @@ static int atmel_nand_dma_transfer(strucdma_async_issue_pending (nc->dmac);wait_for_completion (&finished); +dma_unmap_single (nc->dev, buf_dma, len, dir);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 28/530 fs: dlm: fix race between test_bit() and queue_work()
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit eef6ec9bf390e836a6c4029f3620fe49528aa1fe upstream.
This patch fixes a race by using ls_cb_mutex around the bit operations and conditional code blocks for LSFL_CB_DELAY.
The function dlm_callback_stop() expects to stop all callbacks and flush all currently queued onces. The set_bit() is not enough because there can still be queue_work() after the workqueue was flushed. To avoid queue_work() after set_bit(), surround both by ls_cb_mutex.
--- fs/dlm/ast.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/dlm/ast.c +4 -2
@@ -198,13 +198,13 @@ void dlm_add_cb(struct dlm_lkb *lkb, uinif (!prev_seq) {kref_get (&lkb->lkb_ref); +mutex_lock (&ls->ls_cb_mutex);if (test_bit (LSFL_CB_DELAY , &ls->ls_flags)) { -mutex_lock (&ls->ls_cb_mutex);list_add (&lkb->lkb_cb_list, &ls->ls_cb_delay); -mutex_unlock (&ls->ls_cb_mutex); }else {queue_work (ls->ls_callback_wq, &lkb->lkb_cb_work); } +mutex_unlock (&ls->ls_cb_mutex); } out:mutex_unlock (&lkb->lkb_cb_mutex);
@@ -284,7 +284,9 @@ void dlm_callback_stop(struct dlm_ls *lsvoid dlm_callback_suspend (struct dlm_ls *ls) { +mutex_lock (&ls->ls_cb_mutex);set_bit (LSFL_CB_DELAY , &ls->ls_flags); +mutex_unlock (&ls->ls_cb_mutex);if (ls->ls_callback_wq)flush_workqueue (ls->ls_callback_wq);
Greg Kroah-Hartman
maintainerPATCH 6/530 ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
In reply to Greg Kroah-HartmanFrom: Callum Osmotherly <[email protected]>
commit 417b9c51f59734d852e47252476fadc293ad994a upstream.
After some feedback from users with Dell Precision 5530 machines, this patch reverts the previous change to add ALC289_FIXUP_DUAL_SPK. While it improved the speaker output quality, it caused the headphone jack to have an audible "pop" sound when power saving was toggled.
--- sound/pci/hda/patch_realtek.c | 1 - 1 file changed, 1 deletion(-)
sound/pci/hda/patch_realtek.c +0 -1
@@ -8847,7 +8847,6 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1028 ,0x0871 ,"Dell Precision 3630" ,ALC255_FIXUP_DELL_HEADSET_MIC ),SND_PCI_QUIRK (0x1028 ,0x0872 ,"Dell Precision 3630" ,ALC255_FIXUP_DELL_HEADSET_MIC ),SND_PCI_QUIRK (0x1028 ,0x0873 ,"Dell Precision 3930" ,ALC255_FIXUP_DUMMY_LINEOUT_VERB ), -SND_PCI_QUIRK (0x1028 ,0x087d ,"Dell Precision 5530" ,ALC289_FIXUP_DUAL_SPK ),SND_PCI_QUIRK (0x1028 ,0x08ad ,"Dell WYSE AIO" ,ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x08ae ,"Dell WYSE NB" ,ALC225_FIXUP_DELL1_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
Greg Kroah-Hartman
maintainerPATCH 17/530 iio: adc: ad7923: fix channel readings for some variants
In reply to Greg Kroah-HartmanFrom: Nuno Sá <[email protected]>
commit f4f43f01cff2f29779343ade755191afd2581c77 upstream.
Some of the supported devices have 4 or 2 LSB trailing bits that should not be taken into account. Hence we need to shift these bits out which fits perfectly on the scan type shift property. This change fixes both raw and buffered reads.
--- drivers/iio/adc/ad7923.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/ad7923.c +3 -1
@@ -93,6 +93,7 @@ enum ad7923_id { .sign = 'u', \ .realbits = (bits), \ .storagebits = 16, \ + .shift = 12 - (bits), \ .endianness = IIO_BE, \ }, \ }
@@ -268,7 +269,8 @@ static int ad7923_read_raw(struct iio_dereturn ret;if (chan->address ==EXTRACT (ret,12 ,4 )) - *val =EXTRACT (ret,0 ,12 ); + *val =EXTRACT (ret, chan->scan_type.shift, + chan->scan_type.realbits);else return -EIO ;
Greg Kroah-Hartman
maintainerPATCH 42/530 riscv: Allow PROT_WRITE-only mmap()
In reply to Greg Kroah-HartmanFrom: Andrew Bresticker <[email protected]>
commit 9e2e6042a7ec6504fe8e366717afa2f40cf16488 upstream.
Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout PROT_READ with the justification that a write-only PTE is considered a reserved PTE permission bit pattern in the privileged spec. This check is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is inconsistent with other architectures that don't support write-only PTEs, creating a potential software portability issue. Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures.
Note that this also allows PROT_WRITE|PROT_EXEC mappings which were disallowed prior to the aforementioned commit; PROT_READ is implied in such mappings as well.
--- arch/riscv/kernel/sys_riscv.c | 3 --- 1 file changed, 3 deletions(-)
arch/riscv/kernel/sys_riscv.c +0 -3
@@ -18,9 +18,6 @@ static long riscv_sys_mmap(unsigned longif (unlikely (offset & (~PAGE_MASK >> page_shift_offset)))return -EINVAL ; -if (unlikely ((prot &PROT_WRITE ) && !(prot &PROT_READ ))) -return -EINVAL ; -return ksys_mmap_pgoff (addr, len, prot, flags, fd, offset >> (PAGE_SHIFT - page_shift_offset)); }
Greg Kroah-Hartman
maintainerPATCH 31/530 quota: Check next/prev free block number after reading from quota file
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 6c8ea8b8cd4722efd419f91ca46a2dc81b7d89a3 upstream.
Following process:
Init: v2_read_file_info: <3> dqi_free_blk 0 dqi_free_entry 5 dqi_blks 6
Step 1. chown bin f_a -> dquot_acquire -> v2_write_dquot:
qtree_write_dquot
do_insert_tree
find_free_dqentry
get_free_dqblk
write_blk(info->dqi_blocks) // info->dqi_blocks = 6, failure. The
content in physical block (corresponding to blk 6) is random.
Step 2. chown root f_a -> dquot_transfer -> dqput_all -> dqput ->
ext4_release_dquot -> v2_release_dquot -> qtree_delete_dquot:
dquot_release
remove_tree
free_dqentry
put_free_dqblk(6)
info->dqi_free_blk = blk // info->dqi_free_blk = 6Step 3. drop cache (buffer head for block 6 is released)
Step 4. chown bin f_b -> dquot_acquire -> commit_dqblk -> v2_write_dquot:
qtree_write_dquot
do_insert_tree
find_free_dqentry
get_free_dqblk
dh = (struct qt_disk_dqdbheader *)buf
blk = info->dqi_free_blk // 6
ret = read_blk(info, blk, buf) // The content of buf is random info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free) // random blk
Step 5. chown bin f_c -> notify_change -> ext4_setattr -> dquot_transfer:
dquot = dqget -> acquire_dquot -> ext4_acquire_dquot -> dquot_acquire ->
commit_dqblk -> v2_write_dquot -> dq_insert_tree:
do_insert_tree
find_free_dqentry
get_free_dqblk
blk = info->dqi_free_blk // If blk < 0 and blk is not an error
code, it will be returned as dquot
transfer_to[USRQUOTA] = dquot // A random negative value __dquot_transfer(transfer_to)
dquot_add_inodes(transfer_to[cnt])
spin_lock(&dquot->dq_dqb_lock) // page fault
, which will lead to kernel page fault:
Quota error (device sda): qtree_write_dquot: Error -8000 occurred while creating quota
BUG: unable to handle page fault for address: ffffffffffffe120 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 5974 Comm: chown Not tainted 6.0.0-rc1-00004 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:_raw_spin_lock+0x3a/0x90 Call Trace: dquot_add_inodes+0x28/0x270 __dquot_transfer+0x377/0x840 dquot_transfer+0xde/0x540 ext4_setattr+0x405/0x14d0 notify_change+0x68e/0x9f0 chown_common+0x300/0x430 __x64_sys_fchownat+0x29/0x40
In order to avoid accessing invalid quota memory address, this patch adds block number checking of next/prev free block read from quota file.
Fetch a reproducer in [Link].
--- fs/quota/quota_tree.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
fs/quota/quota_tree.c +38 -0
@@ -71,6 +71,35 @@ static ssize_t write_blk(struct qtree_mereturn ret; } +static inline int do_check_range (struct super_block *sb,const char *val_name, +uint val,uint min_val,uint max_val) +{ +if (val < min_val || val > max_val) { +quota_error (sb,"Getting %s %u out of range %u-%u" , + val_name, val, min_val, max_val); +return -EUCLEAN ; + } + +return 0 ; +} + +static int check_dquot_block_header (struct qtree_mem_dqinfo *info, +struct qt_disk_dqdbheader *dh) +{ +int err =0 ; + + err =do_check_range (info->dqi_sb,"dqdh_next_free" , +le32_to_cpu (dh->dqdh_next_free),0 , + info->dqi_blocks -1 ); +if (err) +return err; + err =do_check_range (info->dqi_sb,"dqdh_prev_free" , +le32_to_cpu (dh->dqdh_prev_free),0 , + info->dqi_blocks -1 ); + +return err; +} +/* Remove empty block from list and return it */ static int get_free_dqblk (struct qtree_mem_dqinfo *info) {
@@ -85,6 +114,9 @@ static int get_free_dqblk(struct qtree_m ret =read_blk (info, blk, buf);if (ret <0 ) goto out_buf; + ret =check_dquot_block_header (info, dh); +if (ret) + goto out_buf; info->dqi_free_blk =le32_to_cpu (dh->dqdh_next_free); }else {
@@ -232,6 +264,9 @@ static uint find_free_dqentry(struct qtr *err =read_blk (info, blk, buf);if (*err <0 ) goto out_buf; + *err =check_dquot_block_header (info, dh); +if (*err) + goto out_buf; }else { blk =get_free_dqblk (info);if ((int )blk <0 ) {
@@ -424,6 +459,9 @@ static int free_dqentry(struct qtree_mem goto out_buf; } dh = (struct qt_disk_dqdbheader *)buf; + ret =check_dquot_block_header (info, dh); +if (ret) + goto out_buf;le16_add_cpu (&dh->dqdh_entries,-1 );if (!le16_to_cpu (dh->dqdh_entries)) {/* Block got free? */ ret =remove_free_dqentry (info, buf, blk);
Greg Kroah-Hartman
maintainerPATCH 40/530 RISC-V: Make port I/O string accessors actually work
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
commit 9cc205e3c17d5716da7ebb7fa0c985555e95d009 upstream.
Fix port I/O string accessors such as insb', outsb', etc. which use the physical PCI port I/O address rather than the corresponding memory mapping to get at the requested location, which in turn breaks at least accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008 Oops [#1] Modules linked in: CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23 Hardware name: SiFive HiFive Unmatched A00 (DT) epc : parport_pc_fifo_write_block_pio+0x266/0x416 ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000 t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0 s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000 a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000 s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50 s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000 s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930 t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200 [<ffffffff8053bbc0>] parport_write+0x46/0xf8 [<ffffffff8050530e>] lp_write+0x158/0x2d2 [<ffffffff80185716>] vfs_write+0x8e/0x2c2 [<ffffffff80185a74>] ksys_write+0x52/0xc2 [<ffffffff80185af2>] sys_write+0xe/0x16 [<ffffffff80003770>] ret_from_syscall+0x0/0x2 ---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical address requested in the respective wrapper macros only, observing that the raw accessors such as __insb', __outsb', etc. are not supposed to be used other than by said macros. Remove the cast to long' that is no longer needed on addr' now that it is used as an offset from PCI_IOBASE and add parentheses around `addr' needed for predictable evaluation in macro expansion. No need to make said adjustments in separate changes given that current code is gravely broken and does not ever work.
--- arch/riscv/include/asm/io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/riscv/include/asm/io.h +8 -8
@@ -101,9 +101,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr)) __io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr)) __io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr)) -#define insb (addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count) -#define insw (addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count) -#define insl (addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count) +#define insb (addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count) +#define insw (addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) +#define insl (addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) __io_writes_outs(writes, u8, b, __io_bw(), __io_aw())__io_writes_outs (writes, u16, w,__io_bw (),__io_aw ())
@@ -115,22 +115,22 @@ __io_writes_outs(writes, u32, l, __io_bw __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) -#define outsb (addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count) -#define outsw (addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count) -#define outsl (addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count) +#define outsb (addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) +#define outsw (addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) +#define outsl (addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)#ifdef CONFIG_64BIT __io_reads_ins(reads, u64, q, __io_br(), __io_ar(addr))#define readsq (addr, buffer, count) __readsq(addr, buffer, count) __io_reads_ins(ins, u64, q, __io_pbr(), __io_par(addr)) -#define insq (addr, buffer, count) __insq((void __iomem *)addr, buffer, count) +#define insq (addr, buffer, count) __insq(PCI_IOBASE + (addr), buffer, count) __io_writes_outs(writes, u64, q, __io_bw(), __io_aw())#define writesq (addr, buffer, count) __writesq(addr, buffer, count) __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw()) -#define outsq (addr, buffer, count) __outsq((void __iomem *)addr, buffer, count) +#define outsq (addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)#endif #include <asm-generic/io.h>
Greg Kroah-Hartman
maintainerPATCH 7/530 ALSA: hda/realtek: Correct pin configs for ASUS G533Z
In reply to Greg Kroah-HartmanFrom: Luke D. Jones <[email protected]>
commit 66ba7c88507344dee68ad1acbdb630473ab36114 upstream.
The initial fix for ASUS G533Z was based on faulty information. This fixes the pincfg to values that have been verified with no existing module options or other hacks enabled.
Enables headphone jack, and 5.1 surround.
[ corrected the indent level by tiwai ]
--- sound/pci/hda/patch_realtek.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
sound/pci/hda/patch_realtek.c +5 -3
@@ -8221,11 +8221,13 @@ static const struct hda_fixup alc269_fix [ALC285_FIXUP_ASUS_G533Z_PINS] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) { - {0x14 ,0x90170120 }, + {0x14 ,0x90170152 },/* Speaker Surround Playback Switch */ + {0x19 ,0x03a19020 },/* Mic Boost Volume */ + {0x1a ,0x03a11c30 },/* Mic Boost Volume */ + {0x1e ,0x90170151 },/* Rear jack, IN OUT EAPD Detect */ + {0x21 ,0x03211420 }, { } }, - .chained = true, - .chain_id = ALC294_FIXUP_ASUS_G513_PINS, }, [ALC294_FIXUP_ASUS_COEF_1B] = { .type = HDA_FIXUP_VERBS,
Greg Kroah-Hartman
maintainerPATCH 46/530 UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
In reply to Greg Kroah-HartmanFrom: Huacai Chen <[email protected]>
commit 16c546e148fa6d14a019431436a6f7b4087dbccd upstream.
When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, cpu_max_bits_warn() generates a runtime warning similar as below while we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit) instead of NR_CPUS to iterate CPUs.
[ 3.052463] ------------[ cut here ]------------ [ 3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0 [ 3.070072] Modules linked in: efivarfs autofs4 [ 3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052 [ 3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000 [ 3.109127] 9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430 [ 3.118774] 90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff [ 3.128412] 0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890 [ 3.138056] 0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa [ 3.147711] ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000 [ 3.157364] 900000000101c998 0000000000000004 9000000000ef7430 0000000000000000 [ 3.167012] 0000000000000009 000000000000006c 0000000000000000 0000000000000000 [ 3.176641] 9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286 [ 3.186260] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c [ 3.195868] ... [ 3.199917] Call Trace: [ 3.203941] [<90000000002086d8>] show_stack+0x38/0x14c [ 3.210666] [<9000000000cf846c>] dump_stack_lvl+0x60/0x88 [ 3.217625] [<900000000023d268>] __warn+0xd0/0x100 [ 3.223958] [<9000000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc [ 3.231150] [<9000000000210220>] show_cpuinfo+0x5e8/0x5f0 [ 3.238080] [<90000000004f578c>] seq_read_iter+0x354/0x4b4 [ 3.245098] [<90000000004c2e90>] new_sync_read+0x17c/0x1c4 [ 3.252114] [<90000000004c5174>] vfs_read+0x138/0x1d0 [ 3.258694] [<90000000004c55f8>] ksys_read+0x70/0x100 [ 3.265265] [<9000000000cfde9c>] do_syscall+0x7c/0x94 [ 3.271820] [<9000000000202fe4>] handle_syscall+0xc4/0x160 [ 3.281824] ---[ end trace 8b484262b4b8c24c ]---
--- arch/um/kernel/um_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/um_arch.c +1 -1
@@ -94,7 +94,7 @@ static int show_cpuinfo(struct seq_filestatic void *c_start (struct seq_file *m,loff_t *pos) { -return *pos <NR_CPUS ? cpu_data + *pos :NULL ; +return *pos < nr_cpu_ids ? cpu_data + *pos :NULL ; }static void *c_next (struct seq_file *m,void *v,loff_t *pos)
Greg Kroah-Hartman
maintainerPATCH 44/530 riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb
In reply to Greg Kroah-HartmanFrom: Wenting Zhang <[email protected]>
commit 10f6913c548b32ecb73801a16b120e761c6957ea upstream.
When CONFIG_CMDLINE_FORCE is enabled, cmdline provided by CONFIG_CMDLINE are always used. This allows CONFIG_CMDLINE to be used regardless of the result of device tree scanning.
This especially fixes the case where a device tree without the chosen node is supplied to the kernel. In such cases, early_init_dt_scan would return true. But inside early_init_dt_scan_chosen, the cmdline won't be updated as there is no chosen node in the device tree. As a result, CONFIG_CMDLINE is not copied into boot_command_line even if CONFIG_CMDLINE_FORCE is enabled. This commit allows properly update boot_command_line in this situation.
--- arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/setup.c +2 -2
@@ -260,10 +260,10 @@ static void __init parse_dtb(void)pr_info ("Machine model: %s\n" , name);dump_stack_set_arch_desc ("%s (DT)" , name); } -return ; + }else { +pr_err ("No DTB passed to the kernel\n" ); } -pr_err ("No DTB passed to the kernel\n" );#ifdef CONFIG_CMDLINE_FORCE strscpy (boot_command_line,CONFIG_CMDLINE ,COMMAND_LINE_SIZE );pr_info ("Forcing kernel command line to: %s\n" , boot_command_line);
Greg Kroah-Hartman
maintainercover 5.15.75-rc1 review
This is the start of the stable review cycle for the 5.15.75 release. There are 530 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Oct 2022 11:29:24 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.75-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.15.75-rc1
Rafael Mendonca <[email protected]>
io-wq: Fix memory leak in worker creation
Martin Liska <[email protected]>
gcov: support GCC 12.1 and newer compilers
Rafael J. Wysocki <[email protected]>
thermal: intel_powerclamp: Use first online CPU as control_cpu
Jerry Lee 李修賢 <[email protected]>
ext4: continue to expand file system when the target size doesn't reach
Nathan Chancellor <[email protected]>
lib/Kconfig.debug: Add check for non-constant .{s,u}leb128 support to DWARF5
Masahiro Yamada <[email protected]>
Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
Masahiro Yamada <[email protected]>
Kconfig.debug: simplify the dependency of DEBUG_INFO_DWARF4/5
Nathan Chancellor <[email protected]>
drm/amd/display: Fix build breakage with CONFIG_DEBUG_FS=n
Tetsuo Handa <[email protected]>
net/ieee802154: don't warn zero-sized raw_sendmsg()
Alexander Aring <[email protected]>
Revert "net/ieee802154: reject zero-sized raw_sendmsg()"
Randy Dunlap <[email protected]>
net: ethernet: ti: davinci_mdio: fix build for mdio bitbang uses
Yu Kuai <[email protected]>
blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init()
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix last interface check for registration
Alexander Aring <[email protected]>
net: ieee802154: return -EINVAL for unknown addr type
Liu Shixin <[email protected]>
mm: hugetlb: fix UAF in hugetlb_handle_userfault
Pavel Begunkov <[email protected]>
io_uring/rw: fix unexpected link breakage
Pavel Begunkov <[email protected]>
io_uring/rw: fix error'ed retry return values
Pavel Begunkov <[email protected]>
io_uring/rw: fix short rw error handling
Pavel Begunkov <[email protected]>
io_uring: correct pinned_vm accounting
Pavel Begunkov <[email protected]>
io_uring/af_unix: defer registered files gc to io_uring release
Adrian Hunter <[email protected]>
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
Ivan T. Ivanov <[email protected]>
clk: bcm2835: Round UART input clock up
Maxime Ripard <[email protected]>
clk: bcm2835: Make peripheral PLLC critical
Dongliang Mu <[email protected]>
usb: idmouse: fix an uninit-value in idmouse_open
Varun Prakash <[email protected]>
nvmet-tcp: add bounds check on Transfer Tag
Keith Busch <[email protected]>
nvme: copy firmware_rev on each init
Jan Kara <[email protected]>
ext2: Use kvmalloc() for group descriptor array
Arun Easi <[email protected]>
scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled
Xiaoke Wang <[email protected]>
staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
Xiaoke Wang <[email protected]>
staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()
sunghwan jung <[email protected]>
Revert "usb: storage: Add quirk for Samsung Fit flash"
Piyush Mehta <[email protected]>
usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug
Alexander Stein <[email protected]>
arm64: dts: imx8mp: Add snps,gfladj-refclk-lpm-sel quirk to USB nodes
Robin Guo <[email protected]>
usb: musb: Fix musb_gadget.c rxstate overflow bug
Jianglei Nie <[email protected]>
usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info()
Logan Gunthorpe <[email protected]>
md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d
Dylan Yudaken <[email protected]>
eventfd: guard wake_up in eventfd fs calls as well
Hyunwoo Kim <[email protected]>
HID: roccat: Fix use-after-free in roccat_read()
Pierre-Louis Bossart <[email protected]>
soundwire: intel: fix error handling on dai registration issues
Richard Fitzgerald <[email protected]>
soundwire: cadence: Don't overwrite msg->buf during write commands
Coly Li <[email protected]>
bcache: fix set_at_max_writeback_rate() for multiple attached devices
Serge Semin <[email protected]>
ata: libahci_platform: Sanity check the DT child nodes number
Yu Kuai <[email protected]>
blk-throttle: prevent overflow while calculating wait time
Nam Cao <[email protected]>
staging: vt6655: fix potential memory leak
Wei Yongjun <[email protected]>
power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type()
Yicong Yang <[email protected]>
iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity
Shigeru Yoshida <[email protected]>
nbd: Fix hung when signal interrupts nbd_start_device_ioctl()
Letu Ren <[email protected]>
scsi: 3w-9xxx: Avoid disabling device if failing to enable it
Vaishnav Achath <[email protected]>
dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow
Justin Chen <[email protected]>
usb: host: xhci-plat: suspend/resume clks for brcm
Justin Chen <[email protected]>
usb: host: xhci-plat: suspend and resume clocks
Quanyang Wang <[email protected]>
clk: zynqmp: pll: rectify rate rounding in zynqmp_pll_round_rate
Hangyu Hua <[email protected]>
media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc
Zheyu Ma <[email protected]>
media: cx88: Fix a null-ptr-deref bug in buffer_prepare()
Ian Nam <[email protected]>
clk: zynqmp: Fix stack-out-of-bounds in strncpy`
Alex Sverdlin <[email protected]>
ARM: 9242/1: kasan: Only map modules if CONFIG_KASAN_VMALLOC=n
Maciej S. Szmigiero <[email protected]>
btrfs: don't print information about space cache or tree every remount
Qu Wenruo <[email protected]>
btrfs: scrub: try to fix super block errors
Qu Wenruo <[email protected]>
btrfs: dump extra info if one free space cache has more bitmaps than it should
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq-librem5: Add bq25895 as max17055's power supply
Mark Brown <[email protected]>
kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT
Alexander Stein <[email protected]>
ARM: dts: imx6sx: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6sll: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6sl: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6qp: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6dl: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6q: add missing properties for sram
Haibo Chen <[email protected]>
ARM: dts: imx7d-sdb: config the max pressure for tsc2046
Aric Cyr <[email protected]>
drm/amd/display: Remove interface for periodic interrupt 1
Khaled Almahallawy <[email protected]>
drm/dp: Don't rewrite link config when setting phy test pattern
Richard Acayan <[email protected]>
mmc: sdhci-msm: add compatible string check for sdm670
Adrián Larumbe <[email protected]>
drm/meson: explicitly remove aggregate driver at module unload time
Adrián Larumbe <[email protected]>
drm/meson: reorder driver deinit sequence to fix use-after-free bug
hongao <[email protected]>
drm/amdgpu: fix initial connector audio value
Jairaj Arava <[email protected]>
ASoC: SOF: pci: Change DMI match info to support all Chrome platforms
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading
Jameson Thies <[email protected]>
platform/chrome: cros_ec: Notify the PM of wake events during resume
Maya Matuszczyk <[email protected]>
drm: panel-orientation-quirks: Add quirk for Anbernic Win600
Mateusz Kwiatkowski <[email protected]>
drm/vc4: vec: Fix timings for VEC modes
Takashi Iwai <[email protected]>
ALSA: usb-audio: Register card at the last interface
Lucas Stach <[email protected]>
drm: bridge: dw_hdmi: only trigger hotplug event on link change
Vivek Kasireddy <[email protected]>
udmabuf: Set ubuf->sg = NULL if the creation of sg table fails
David Gow <[email protected]>
drm/amd/display: fix overflow on MIN_I64 definition
Zeng Jingxiang <[email protected]>
gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init()
Liviu Dudau <[email protected]>
drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook
Javier Martinez Canillas <[email protected]>
drm: Prevent drm_copy_field() to attempt copying a NULL pointer
Javier Martinez Canillas <[email protected]>
drm: Use size_t type for len variable in drm_copy_field()
Jianglei Nie <[email protected]>
drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()
Andrew Gaul <[email protected]>
r8152: Rate limit overflow messages
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix user-after-free
Liu Jian <[email protected]>
net: If sock is dead don't access sock's sk_wq in sk_stream_wait_memory
Jason A. Donenfeld <[email protected]>
hwmon: (sht4x) do not overflow clamping operation on 32-bit platforms
Daniel Golle <[email protected]>
wifi: rt2x00: correctly set BBP register 86 for MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: set SoC wmac clock register
Daniel Golle <[email protected]>
wifi: rt2x00: set VGC gain for both chains of MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: set correct TX_SW_CFG1 MAC register for MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620
Ziyang Xuan <[email protected]>
can: bcm: check the result of can_send() in bcm_can_tx()
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times
Tetsuo Handa <[email protected]>
Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create()
Sean Wang <[email protected]>
wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value
Patrick Rudolph <[email protected]>
regulator: core: Prevent integer underflow
Kiran K <[email protected]>
Bluetooth: btintel: Mark Intel controller to support LE_STATES quirk
Alexander Coffin <[email protected]>
wifi: brcmfmac: fix use-after-free bug in brcmf_netdev_start_xmit()
Michal Jaron <[email protected]>
iavf: Fix race between iavf_close and iavf_reset_task
Khalid Masum <[email protected]>
xfrm: Update ipcomp_scratches with NULL when freed
Mika Westerberg <[email protected]>
thunderbolt: Add back Intel Falcon Ridge end-to-end flow control workaround
Tetsuo Handa <[email protected]>
wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg()
Jane Chu <[email protected]>
x86/mce: Retrieve poison range from hardware
Eric Dumazet <[email protected]>
tcp: annotate data-race around tcp_md5sig_pool_populated
Mike Pattrick <[email protected]>
openvswitch: Fix overreporting of drops in dropwatch
Mike Pattrick <[email protected]>
openvswitch: Fix double reporting of drops in dropwatch
Ravi Gunasekaran <[email protected]>
net: ethernet: ti: davinci_mdio: Add workaround for errata i2329
Jacob Keller <[email protected]>
ice: set tx_tstamps when creating new Tx rings via ethtool
Quentin Monnet <[email protected]>
bpftool: Clear errno after libcap's checks
Wright Feng <[email protected]>
wifi: brcmfmac: fix invalid address access when enabling SCAN log level
Dai Ngo <[email protected]>
NFSD: fix use-after-free on source server when doing inter-server copy
Anna Schumaker <[email protected]>
NFSD: Return nfserr_serverfault if splice_ok but buf->pages have data
Kees Cook <[email protected]>
x86/entry: Work around Clang __bdos() bug
Mario Limonciello <[email protected]>
ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
Kees Cook <[email protected]>
ARM: decompressor: Include .data.rel.ro.local
Srinivas Pandruvada <[email protected]>
thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash
Chao Qin <[email protected]>
powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue
Kees Cook <[email protected]>
MIPS: BCM47XX: Cast memcmp() of function to (void *)
Doug Smythies <[email protected]>
cpufreq: intel_pstate: Add Tigerlake support in no-HWP mode
Hans de Goede <[email protected]>
ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address
Arvid Norlander <[email protected]>
ACPI: video: Add Toshiba Satellite/Portege Z830 quirk
Zqiang <[email protected]>
rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
Michal Hocko <[email protected]>
rcu: Back off upon fill_page_cache_func() allocation failure
Zqiang <[email protected]>
rcu: Avoid triggering strict-GP irq-work when RCU is idle
Alexander Aring <[email protected]>
fs: dlm: fix race in lowcomms
Stefan Berger <[email protected]>
selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle
Chao Yu <[email protected]>
f2fs: fix to account FS_CP_DATA_IO correctly
Zhang Qilong <[email protected]>
f2fs: fix race condition on setting FI_NO_EXTENT flag
Shuai Xue <[email protected]>
ACPI: APEI: do not add task_work to kernel thread to avoid memory leak
Vincent Knecht <[email protected]>
thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id
Dan Carpenter <[email protected]>
crypto: cavium - prevent integer overflow loading firmware
Dan Carpenter <[email protected]>
crypto: marvell/octeontx - prevent integer overflows
Janis Schoetterl-Glausch <[email protected]>
kbuild: rpm-pkg: fix breakage when V=1 is used
Masahiro Yamada <[email protected]>
kbuild: remove the target in signal traps when interrupted
Nico Pache <[email protected]>
tracing/osnoise: Fix possible recursive locking in stop_per_cpu_kthreads
Yipeng Zou <[email protected]>
tracing: kprobe: Make gen test module work in arm and riscv
Yipeng Zou <[email protected]>
tracing: kprobe: Fix kprobe event gen test module on exit
Robin Murphy <[email protected]>
iommu/iova: Fix module config properly
Enzo Matsumiya <[email protected]>
cifs: return correct error in ->calc_signature()
Damian Muszynski <[email protected]>
crypto: qat - fix DMA transfer direction
Peter Harliman Liem <[email protected]>
crypto: inside-secure - Change swab to swab32
Koba Ko <[email protected]>
crypto: ccp - Release dma channels before dmaengine unrgister
Ignat Korchagin <[email protected]>
crypto: akcipher - default implementation for setting a private key
Dan Carpenter <[email protected]>
iommu/omap: Fix buffer overflow in debugfs
Waiman Long <[email protected]>
cgroup/cpuset: Enable update_tasks_cpumask() on top_cpuset
Weili Qian <[email protected]>
crypto: hisilicon/qm - fix missing put dfx access
Lucas Segarra Fernandez <[email protected]>
crypto: qat - fix default value of WDT timer
Kshitiz Varshney <[email protected]>
hwrng: imx-rngc - Moving IRQ handler registering after imx_rngc_irq_mask_clear()
Michal Koutný <[email protected]>
cgroup: Honor caller's cgroup NS when resolving path
James Cowgill <[email protected]>
hwrng: arm-smccc-trng - fix NO_ENTROPY handling
Ye Weihua <[email protected]>
crypto: hisilicon/zip - fix mismatch in get/set sgl_sge_nr
Zhengchao Shao <[email protected]>
crypto: sahara - don't sleep when in softirq
Haren Myneni <[email protected]>
powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL
Li Huafei <[email protected]>
powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()
Pali Rohár <[email protected]>
powerpc: Fix SPE Power ISA properties for e500v1 platforms
Nicholas Piggin <[email protected]>
powerpc/64s: Fix GENERIC_CPU build flags for PPC970 / G5
Vitaly Kuznetsov <[email protected]>
x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition
Rohan McLure <[email protected]>
powerpc: Fix fallocate and fadvise64_64 compat parameter combination
Zheng Yongjun <[email protected]>
powerpc/powernv: add missing of_node_put() in opal_export_attrs()
Liang He <[email protected]>
powerpc/pci_dn: Add missing of_node_put()
Liang He <[email protected]>
powerpc/sysdev/fsl_msi: Add missing of_node_put()
Nathan Chancellor <[email protected]>
powerpc/math_emu/efp: Include module.h
Michael Ellerman <[email protected]>
powerpc/configs: Properly enable PAPR_SCM in pseries_defconfig
Jack Wang <[email protected]>
mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg
Conor Dooley <[email protected]>
mailbox: mpfs: account for mbox offsets while sending
Conor Dooley <[email protected]>
mailbox: mpfs: fix handling of the reg property
Joel Stanley <[email protected]>
clk: ast2600: BCLK comes from EPLL
Miaoqian Lin <[email protected]>
clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe
Lin Yujun <[email protected]>
clk: imx: scu: fix memleak on platform_device_add() fails
Stefan Wahren <[email protected]>
clk: bcm2835: fix bcm2835_clock_rate_from_divisor declaration
Serge Semin <[email protected]>
clk: baikal-t1: Add SATA internal ref clock buffer
Serge Semin <[email protected]>
clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent
Serge Semin <[email protected]>
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
Serge Semin <[email protected]>
clk: vc5: Fix 5P49V6901 outputs disabling when enabling FOD
David Collins <[email protected]>
spmi: pmic-arb: correct duplicate APID to PPID mapping logic
Chunfeng Yun <[email protected]>
usb: mtu3: fix failed runtime suspend in host only mode
Dave Jiang <[email protected]>
dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup()
Chen-Yu Tsai <[email protected]>
clk: mediatek: mt8183: mfgcfg: Propagate rate changes to parent
Jiasheng Jiang <[email protected]>
mfd: sm501: Add check for platform_driver_register()
Dan Carpenter <[email protected]>
mfd: fsl-imx25: Fix check for platform_get_irq() errors
Christophe JAILLET <[email protected]>
mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()
Christophe JAILLET <[email protected]>
mfd: lp8788: Fix an error handling path in lp8788_probe()
Christophe JAILLET <[email protected]>
mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()
Christophe JAILLET <[email protected]>
mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
Jiasheng Jiang <[email protected]>
fsi: core: Check error number after calling ida_simple_get
Bob Pearson <[email protected]>
RDMA/rxe: Fix resize_finish() in rxe_queue.c
Adam Skladowski <[email protected]>
clk: qcom: gcc-sm6115: Override default Alpha PLL regs
Robert Marko <[email protected]>
clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical
Mike Christie <[email protected]>
scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()
Mike Christie <[email protected]>
scsi: iscsi: Run recv path from workqueue
Mike Christie <[email protected]>
scsi: iscsi: Add recv workqueue helpers
Mike Christie <[email protected]>
scsi: iscsi: Rename iscsi_conn_queue_work()
Duoming Zhou <[email protected]>
scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
Pali Rohár <[email protected]>
serial: 8250: Fix restoring termios speed after suspend
Guilherme G. Piccoli <[email protected]>
firmware: google: Test spinlock on panic path to avoid lockups
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd-ctrl: allow compile testing without QCOM_RPROC_COMMON
Nam Cao <[email protected]>
staging: vt6655: fix some erroneous memory clean-up loops
Dongliang Mu <[email protected]>
phy: qualcomm: call clk_disable_unprepare in the error handling
Sherry Sun <[email protected]>
tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown
Ilpo Järvinen <[email protected]>
serial: 8250: Toggle IER bits on only after irq has been set up
Dan Carpenter <[email protected]>
drivers: serial: jsm: fix some leaks in probe
Albert Briscoe <[email protected]>
usb: gadget: function: fix dangling pnp_string in f_printer.c
Mario Limonciello <[email protected]>
xhci: Don't show warning for reinit on known broken suspend
Daisuke Matsuda <[email protected]>
IB: Set IOVA/LENGTH on IB_MR in core/uverbs layers
Mark Zhang <[email protected]>
RDMA/cm: Use SLID in the work completion as the DLID in responder side
David Sloan <[email protected]>
md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk()
Logan Gunthorpe <[email protected]>
md/raid5: Ensure stripe_fill happens on non-read IO with journal
Saurabh Sengar <[email protected]>
md: Replace snprintf with scnprintf
Dan Carpenter <[email protected]>
mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_dipm()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_ncq_autosense()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_devslp()
Niklas Cassel <[email protected]>
ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting()
Bernard Metzler <[email protected]>
RDMA/siw: Fix QP destroy to wait for all references dropped.
Bernard Metzler <[email protected]>
RDMA/siw: Always consume all skbuf data in sk_data_ready() upcall.
Bart Van Assche <[email protected]>
RDMA/srp: Fix srp_abort()
Sindhu-Devale <[email protected]>
RDMA/irdma: Align AE id codes to correct flush code and event
Pali Rohár <[email protected]>
mtd: rawnand: fsl_elbc: Fix none ECC mode
Martin Blumenstingl <[email protected]>
mtd: rawnand: intel: Remove undocumented compatible string
Martin Blumenstingl <[email protected]>
mtd: rawnand: intel: Read the chip-select line from the correct OF node
Chunfeng Yun <[email protected]>
phy: phy-mtk-tphy: fix the phy type setting issue
Liang He <[email protected]>
phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()
William Dean <[email protected]>
mtd: devices: docg3: check the return value of devm_ioremap() in the probe
Dang Huynh <[email protected]>
clk: qcom: sm6115: Select QCOM_GDSC
Jim Cromie <[email protected]>
dyndbg: drop EXPORTed dynamic_debug_exec_queries
Jim Cromie <[email protected]>
dyndbg: let query-modname override actual module name
Jim Cromie <[email protected]>
dyndbg: fix module.dyndbg handling
Jim Cromie <[email protected]>
dyndbg: fix static_branch manipulation
Jie Hai <[email protected]>
dmaengine: hisilicon: Add multi-thread support for a DMA channel
Jie Hai <[email protected]>
dmaengine: hisilicon: Fix CQ head update
Jie Hai <[email protected]>
dmaengine: hisilicon: Disable channels when unregister hisi_dma
Dan Carpenter <[email protected]>
fpga: prevent integer overflow in dfl_feature_ioctl_set_irq()
Hangyu Hua <[email protected]>
misc: ocxl: fix possible refcount leak in afu_ioctl()
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix the error caused by qp->sk
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix "kernel NULL pointer dereference" error
Miaoqian Lin <[email protected]>
media: xilinx: vipp: Fix refcount leak in xvip_graph_dma_init
Yunke Cao <[email protected]>
media: uvcvideo: Use entity get_cur in uvc_ctrl_set
José Expósito <[email protected]>
media: uvcvideo: Fix memory leak in uvc_gpio_parse
Xu Qiang <[email protected]>
media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start()
Shubhrajyoti Datta <[email protected]>
tty: xilinx_uartps: Fix the ignore_status
Liang He <[email protected]>
media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop
Jack Wang <[email protected]>
HSI: omap_ssi_port: Fix dma_map_sg error check
Miaoqian Lin <[email protected]>
HSI: omap_ssi: Fix refcount leak in ssi_probe
Miaoqian Lin <[email protected]>
clk: tegra20: Fix refcount leak in tegra20_clock_init
Miaoqian Lin <[email protected]>
clk: tegra: Fix refcount leak in tegra114_clock_init
Miaoqian Lin <[email protected]>
clk: tegra: Fix refcount leak in tegra210_clock_init
Liang He <[email protected]>
clk: sprd: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: berlin: Add of_node_put() for of_get_parent()
Liang He <[email protected]>
clk: qoriq: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: oxnas: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: meson: Hold reference returned by of_get_parent()
Thinh Nguyen <[email protected]>
usb: common: debug: Check non-standard control requests
Aharon Landau <[email protected]>
RDMA/mlx5: Don't compare mkey tags in DEVX indirect mkey
Jakob Hauser <[email protected]>
iio: magnetometer: yas530: Change data type of hard_offsets to signed
Jonathan Cameron <[email protected]>
iio: ABI: Fix wrong format of differential capacitance channel ABI.
Nuno Sá <[email protected]>
iio: inkern: fix return value in devm_of_iio_channel_get_by_name()
Nuno Sá <[email protected]>
iio: inkern: only release the device node when done with it
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: disable/prepare buffer on suspend/resume
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: lock around oversampling and sample freq
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: check return status for pressure and touch
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: fix AT91_SAMA5D2_MR_TRACKTIM_MAX
Dmitry Torokhov <[email protected]>
ARM: dts: exynos: fix polarity of VBUS GPIO of Origen
Mark Rutland <[email protected]>
arm64: ftrace: fix module PLTs with mcount
Josh Triplett <[email protected]>
ext4: don't run ext4lazyinit for read-only filesystems
Geert Uytterhoeven <[email protected]>
ARM: Drop CMDLINE_* dependency on ATAGS
Dmitry Torokhov <[email protected]>
ARM: dts: exynos: correct s5k6a3 reset polarity on Midas family
Matt Ranostay <[email protected]>
arm64: dts: ti: k3-j7200: fix main pinmux range
Dmitry Osipenko <[email protected]>
soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA
Randy Dunlap <[email protected]>
ia64: export memory_add_physaddr_to_nid to fix cxl build error
Michael Walle <[email protected]>
ARM: dts: kirkwood: lsxl: remove first ethernet port
Michael Walle <[email protected]>
ARM: dts: kirkwood: lsxl: fix serial line
Marek Behún <[email protected]>
ARM: dts: turris-omnia: Fix mpp26 pin name and comment
Lucas Stach <[email protected]>
ARM: dts: imx6qdl-kontron-samx6i: hook up DDC i2c bus
Liang He <[email protected]>
soc: qcom: smem_state: Add refcounting for the 'state->of_node'
Liang He <[email protected]>
soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe()
Amir Goldstein <[email protected]>
locks: fix TOCTOU race when granting write lease
Liang He <[email protected]>
memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings()
Liang He <[email protected]>
memory: of: Fix refcount leak bug in of_get_ddr_timings()
Liang He <[email protected]>
memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe()
Takashi Iwai <[email protected]>
ALSA: hda/hdmi: Don't skip notification handling during PM operation
Zhang Qilong <[email protected]>
ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe
Zhang Qilong <[email protected]>
ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
Zhang Qilong <[email protected]>
ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
Zhang Qilong <[email protected]>
ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe
Christophe JAILLET <[email protected]>
mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe()
Andreas Pape <[email protected]>
ALSA: dmaengine: increment buffer pointer atomically
Christophe JAILLET <[email protected]>
ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()
Srinivas Kandagatla <[email protected]>
ASoC: codecs: tx-macro: fix kcontrol put
Rafael Mendonca <[email protected]>
drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()
Kuogee Hsieh <[email protected]>
drm/msm/dp: correct 1.62G link rate at dp_catalog_ctrl_config_msa()
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: index dpu_kms->hw_vbif using vbif_idx
Liang He <[email protected]>
ASoC: eureka-tlv320: Hold reference returned from of_find_xxx API
Christophe JAILLET <[email protected]>
mmc: au1xmmc: Fix an error handling path in au1xmmc_probe()
Rafael Mendonca <[email protected]>
drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue()
Liang He <[email protected]>
drm/omap: dss: Fix refcount leak bugs
Gerd Hoffmann <[email protected]>
drm/bochs: fix blanking
Takashi Iwai <[email protected]>
ALSA: hda: beep: Simplify keep-power-at-enable behavior
Jiasheng Jiang <[email protected]>
ASoC: rsnd: Add check for rsnd_mod_power_on
Zheyu Ma <[email protected]>
drm/bridge: megachips: Fix a null pointer dereference bug
Yang Yingliang <[email protected]>
drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume()
Prashant Malani <[email protected]>
platform/chrome: cros_ec_typec: Correct alt mode index
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Fix resource cleanup
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Fix old-ec check for backlight registering
Martin Povišer <[email protected]>
ASoC: tas2764: Fix mute/unmute
Martin Povišer <[email protected]>
ASoC: tas2764: Drop conflicting set_bias_level power setting
Martin Povišer <[email protected]>
ASoC: tas2764: Allow mono streams
Dan Carpenter <[email protected]>
platform/chrome: fix memory corruption in ioctl
Rustam Subkhankulov <[email protected]>
platform/chrome: fix double-free in chromeos_laptop_prepare()
Dan Carpenter <[email protected]>
ASoC: mt6359: fix tests for platform_get_irq() failure
Liang He <[email protected]>
drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node()
Simon Ser <[email protected]>
drm/dp_mst: fix drm_dp_dpcd_read return value checks
Chen-Yu Tsai <[email protected]>
drm/bridge: parade-ps8640: Fix regulator supply order
Dmitry Osipenko <[email protected]>
drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
Maxime Ripard <[email protected]>
drm/mipi-dsi: Detach devices when removing the host
Dan Carpenter <[email protected]>
drm/bridge: Avoid uninitialized variable warning
Alvin Šipraga <[email protected]>
drm: bridge: adv7511: unregister cec i2c device after cec adapter
Alvin Šipraga <[email protected]>
drm: bridge: adv7511: fix CEC power down control register offset
Russell King (Oracle) <[email protected]>
net: mvpp2: fix mvpp2 debugfs leak
Eric Dumazet <[email protected]>
once: add DO_ONCE_SLOW() for sleepable contexts
Tetsuo Handa <[email protected]>
net/ieee802154: reject zero-sized raw_sendmsg()
Maxim Mikityanskiy <[email protected]>
net: wwan: iosm: Call mutex_init before locking it
Jianglei Nie <[email protected]>
bnx2x: fix potential memory leak in bnx2x_tpa_stop()
Tetsuo Handa <[email protected]>
net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
Oleksandr Shamray <[email protected]>
hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller
Marek Szyprowski <[email protected]>
spi: Ensure that sg_table won't be used after being freed
Neal Cardwell <[email protected]>
tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited
Xin Long <[email protected]>
sctp: handle the error returned from sctp_auth_asoc_init_active_key
Duoming Zhou <[email protected]>
mISDN: fix use-after-free bugs in l1oip timer handlers
Jakub Kicinski <[email protected]>
eth: alx: take rtnl_lock on resume
Junichi Uekawa <[email protected]>
vhost/vsock: Use kvmalloc/kvfree for larger packets.
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM
Vincent Whitchurch <[email protected]>
spi: s3c64xx: Fix large transfers with DMA
Phil Sutter <[email protected]>
netfilter: nft_fib: Fix for rpath check with VRF devices
Liu Jian <[email protected]>
xfrm: Reinject transport-mode packets through workqueue
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Fix not handling link timeouts propertly
Asmaa Mnebhi <[email protected]>
i2c: mlxbf: support lock mechanism
Liu Jian <[email protected]>
skmsg: Schedule psock work if the cached skb exists on the psock
Zhang Qilong <[email protected]>
spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe
Zhang Qilong <[email protected]>
spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
Luciano Leão <[email protected]>
x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype
Kees Cook <[email protected]>
x86/microcode/AMD: Track patch allocation size explicitly
Jesus Fernandez Manzano <[email protected]>
wifi: ath11k: fix number of VHT beamformee spatial streams
Antoine Tenart <[email protected]>
netfilter: conntrack: revisit the gc initial rescheduling bias
Antoine Tenart <[email protected]>
netfilter: conntrack: fix the gc rescheduling delay
Tetsuo Handa <[email protected]>
Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure
Lee Jones <[email protected]>
bpf: Ensure correct locking around vulnerable function find_vpid()
Zheng Yongjun <[email protected]>
net: fs_enet: Fix wrong check in do_pd_setup
Luiz Augusto von Dentz <[email protected]>
Bluetooth: RFCOMM: Fix possible deadlock on socket shutdown/release
Howard Hsu <[email protected]>
wifi: mt76: mt7915: do not check state before configuring implicit beamform
Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7615: add mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload
YN Chen <[email protected]>
wifi: mt76: sdio: fix transmitting packet hangs
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Remove copy-paste leftover in gen2_update_rate_mask
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: gen2: Fix mistake in path B IQ calibration
Lorenz Bauer <[email protected]>
bpf: btf: fix truncated last_member_type_id in btf_struct_resolve
Neil Armstrong <[email protected]>
spi: meson-spicc: do not rely on busy flag in pow2 clk ops
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix skb misuse in TX queue selection
Xu Qiang <[email protected]>
spi: qup: add missing clk_disable_unprepare on error in spi_qup_pm_resume_runtime()
Xu Qiang <[email protected]>
spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume()
Ian Rogers <[email protected]>
selftests/xsk: Avoid use-after-free on ctx
Yang Yingliang <[email protected]>
wifi: rtw88: add missing destroy_workqueue() on error path in rtw_core_init()
Dan Carpenter <[email protected]>
wifi: rtl8xxxu: tighten bounds checking in rtl8xxxu_read_efuse()
Sean Wang <[email protected]>
Bluetooth: btusb: mediatek: fix WMT failure during runtime suspend
Hou Tao <[email protected]>
bpf: Use this_cpu_{inc|dec|inc_return} for bpf_task_storage_busy
Hou Tao <[email protected]>
bpf: Propagate error from htab_lock_bucket() to userspace
Hou Tao <[email protected]>
bpf: Disable preemption when increasing per-cpu map_locked
Maciej Fijalkowski <[email protected]>
xsk: Fix backpressure mechanism on Tx
Kohei Tarumizu <[email protected]>
x86/resctrl: Fix to restore to original value when re-enabling hardware prefetch register
Christophe JAILLET <[email protected]>
spi: mt7621: Fix an error message in mt7621_spi_probe()
Lam Thai <[email protected]>
bpftool: Fix a wrong type cast in btf_dumper_int
Hari Chandrakanthan <[email protected]>
wifi: mac80211: allow bw change during channel switch in mesh
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Fix reference state management for synchronous callbacks
Uwe Kleine-König <[email protected]>
leds: lm3601x: Don't use mutex after it was destroyed
Wen Gong <[email protected]>
wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
Ping-Ke Shih <[email protected]>
wifi: rtlwifi: 8192de: correct checking of IQK reload
Chuck Lever <[email protected]>
NFSD: Fix handling of oversized NFSv4 COMPOUND requests
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv2 READDIR
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_encode's buflen calculation
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation
Christophe JAILLET <[email protected]>
nfsd: Fix a memory leak in an error handling path
Sami Tolvanen <[email protected]>
objtool: Preserve special st_shndx indexes in elf_update_symbol
Wang Kefeng <[email protected]>
ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE
Wang Kefeng <[email protected]>
ARM: 9244/1: dump: Fix wrong pg_level in walk_pmd()
Lin Yujun <[email protected]>
MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create()
Christophe JAILLET <[email protected]>
MIPS: SGI-IP27: Free some unused memory
Kees Cook <[email protected]>
sh: machvec: Use char[] for section boundaries
Xuewen Yan <[email protected]>
thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()
Christian Brauner <[email protected]>
ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers
Ondrej Mosnacek <[email protected]>
userfaultfd: open userfaultfds with O_RDONLY
Mimi Zohar <[email protected]>
ima: fix blocking of security.ima xattrs of unsupported algorithms
Greg Kroah-Hartman <[email protected]>
selinux: use "grep -E" instead of "egrep"
Steve French <[email protected]>
smb3: must initialize two ACL struct fields to zero
Yunxiang Li <[email protected]>
drm/amd/display: Fix vblank refcount in vrr transition
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ MC CCS modifier
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ RC CCS modifier
Jianglei Nie <[email protected]>
drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()
Lyude Paul <[email protected]>
drm/nouveau/kms/nv140-: Disable interlacing
Greg Kroah-Hartman <[email protected]>
staging: greybus: audio_helper: remove unused and wrong debugfs usage
Sean Christopherson <[email protected]>
KVM: VMX: Drop bits 31:16 when shoving exception error code into VMCS
Sean Christopherson <[email protected]>
KVM: nVMX: Don't propagate vmcs12's PERF_GLOBAL_CTRL settings to vmcs02
Sean Christopherson <[email protected]>
KVM: nVMX: Unconditionally purge queued/injected events on nested "exit"
Michal Luczaj <[email protected]>
KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility
Yu Kuai <[email protected]>
blk-wbt: call rq_qos_add() after wb_normal is initialized
Dmitry Osipenko <[email protected]>
media: cedrus: Fix endless loop in cedrus_h265_skip_bits()
Dmitry Osipenko <[email protected]>
media: cedrus: Set the platform driver data earlier
Ard Biesheuvel <[email protected]>
efi: libstub: drop pointless get_memory_map() call
Mario Limonciello <[email protected]>
thunderbolt: Explicitly enable lane adapter hotplug events at startup
Steven Rostedt (Google) <[email protected]>
tracing: Fix reading strings from synthetic events
Steven Rostedt (Google) <[email protected]>
tracing: Add "(fault)" name injection to kernel probes
Steven Rostedt (Google) <[email protected]>
tracing: Move duplicate code of trace_kprobe/eprobe.c into header
Steven Rostedt (Google) <[email protected]>
tracing: Add ioctl() to force ring buffer waiters to wake up
Steven Rostedt (Google) <[email protected]>
tracing: Wake up waiters when tracing is disabled
Steven Rostedt (Google) <[email protected]>
tracing: Wake up ring buffer waiters on closing of the file
Waiman Long <[email protected]>
tracing: Disable interrupt or preemption before acquiring arch_spinlock_t
Steven Rostedt (Google) <[email protected]>
ring-buffer: Fix race between reset page and reading page
Steven Rostedt (Google) <[email protected]>
ring-buffer: Add ring_buffer_wake_waiters()
Steven Rostedt (Google) <[email protected]>
ring-buffer: Check pending waiters when doing wake ups as well
Steven Rostedt (Google) <[email protected]>
ring-buffer: Have the shortest_full queue be the shortest not longest
Steven Rostedt (Google) <[email protected]>
ring-buffer: Allow splice to read previous partially read pages
Zheng Yejian <[email protected]>
ftrace: Properly unset FTRACE_HASH_FL_MOD
Rik van Riel <[email protected]>
livepatch: fix race between fork and KLP transition
Ye Bin <[email protected]>
ext4: update 'state->fc_regions_size' after successful memory allocation
Ye Bin <[email protected]>
ext4: fix potential memory leak in ext4_fc_record_regions()
Ye Bin <[email protected]>
ext4: fix potential memory leak in ext4_fc_record_modified_inode()
Ye Bin <[email protected]>
ext4: fix miss release buffer head in ext4_fc_write_inode
Zhihao Cheng <[email protected]>
ext4: fix dir corruption when ext4_dx_add_entry() fails
Jinke Han <[email protected]>
ext4: place buffer head allocation before handle start
Zhang Yi <[email protected]>
ext4: ext4_read_bh_lock() should submit IO if the buffer isn't uptodate
Lukas Czerner <[email protected]>
ext4: don't increase iversion counter for ea_inodes
Jan Kara <[email protected]>
ext4: fix check for block being out of directory size
Lalith Rajendran <[email protected]>
ext4: make ext4_lazyinit_thread freezable
Baokun Li <[email protected]>
ext4: fix null-ptr-deref in ext4_write_info
Jan Kara <[email protected]>
ext4: avoid crash when inline data creation follows DIO write
Ye Bin <[email protected]>
jbd2: add miss release buffer head in fc_do_one_pass()
Ye Bin <[email protected]>
jbd2: fix potential use-after-free in jbd2_fc_wait_bufs
Ye Bin <[email protected]>
jbd2: fix potential buffer head reference count leak
Andrew Perepechko <[email protected]>
jbd2: wake up journal waiters in FIFO order, not LIFO
Kees Cook <[email protected]>
hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero
Kees Cook <[email protected]>
hardening: Avoid harmless Clang option under CONFIG_INIT_STACK_ALL_ZERO
Chao Yu <[email protected]>
f2fs: fix to do sanity check on summary info
Chao Yu <[email protected]>
f2fs: fix to do sanity check on destination blkaddr during recovery
Jaegeuk Kim <[email protected]>
f2fs: increase the limit for reserve_root
Jaegeuk Kim <[email protected]>
f2fs: flush pending checkpoints when freezing super
Jaegeuk Kim <[email protected]>
f2fs: complete checkpoints during remount
Tetsuo Handa <[email protected]>
btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer
Filipe Manana <[email protected]>
btrfs: fix race between quota enable and quota rescan ioctl
Lukas Czerner <[email protected]>
fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE
Mickaël Salaün <[email protected]>
ksmbd: Fix user namespace mapping
Zhang Xiaoxu <[email protected]>
ksmbd: Fix wrong return value and message length check in smb2_ioctl()
Namjae Jeon <[email protected]>
ksmbd: fix endless loop when encryption for response fails
Hyunwoo Kim <[email protected]>
fbdev: smscufx: Fix use-after-free in ufx_ops_open()
Quentin Schulz <[email protected]>
pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback
Quentin Schulz <[email protected]>
gpio: rockchip: request GPIO mux to pinctrl when setting direction
Saurav Kashyap <[email protected]>
scsi: qedf: Populate sysfs attributes for vport
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd: cleanup in probe error path
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd: use correct error in message of pdr_add_lookup() failure
Pali Rohár <[email protected]>
powerpc/boot: Explicitly disable usage of SPE instructions
Zhang Rui <[email protected]>
powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv3 READ
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv2 READ
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv3 READDIR
Maciej W. Rozycki <[email protected]>
serial: 8250: Request full 16550A feature probing for OxSemi PCIe devices
Maciej W. Rozycki <[email protected]>
serial: 8250: Let drivers request full 16550A feature probing
Maciej W. Rozycki <[email protected]>
PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge
M. Vefa Bicakci <[email protected]>
xen/gntdev: Accommodate VMA splitting
M. Vefa Bicakci <[email protected]>
xen/gntdev: Prevent leaking grants
Carlos Llamas <[email protected]>
mm/mmap: undo ->mmap() when arch_validate_flags() fails
Baolin Wang <[email protected]>
mm/damon: validate if the pmd entry is present before accessing
James Morse <[email protected]>
arm64: errata: Add Cortex-A55 to the repeat tlbi list
Takashi Iwai <[email protected]>
drm/udl: Restore display mode on resume
Dmitry Osipenko <[email protected]>
drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()
Dmitry Osipenko <[email protected]>
drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error
Dmitry Osipenko <[email protected]>
drm/virtio: Check whether transferred 2D BO is shmem
Dario Binacchi <[email protected]>
dmaengine: mxs: use platform_driver_register
Hamza Mahfooz <[email protected]>
Revert "drm/amdgpu: use dirty framebuffer helper"
Rishabh Bhatnagar <[email protected]>
nvme-pci: set min_align_mask before calculating max_hw_sectors
Sagi Grimberg <[email protected]>
nvme-multipath: fix possible hang in live ns resize with ANA access
Gaosheng Cui <[email protected]>
nvmem: core: Fix memleak in nvmem_register()
Huacai Chen <[email protected]>
UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
Fangrui Song <[email protected]>
riscv: Pass -mno-relax only on lld < 15.0.0
Wenting Zhang <[email protected]>
riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb
Andrew Bresticker <[email protected]>
riscv: Make VM_WRITE imply VM_READ
Andrew Bresticker <[email protected]>
riscv: Allow PROT_WRITE-only mmap()
Helge Deller <[email protected]>
parisc: fbdev/stifb: Align graphics memory size to 4MB
Maciej W. Rozycki <[email protected]>
RISC-V: Make port I/O string accessors actually work
Conor Dooley <[email protected]>
riscv: topology: fix default topology reporting
Conor Dooley <[email protected]>
arm64: topology: move store_cpu_topology() to shared code
Linus Walleij <[email protected]>
regulator: qcom_rpm: Fix circular deferral regression
Mika Westerberg <[email protected]>
net: thunderbolt: Enable DMA paths only after rings are enabled
Liang He <[email protected]>
hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
Krzysztof Kozlowski <[email protected]>
ASoC: wcd934x: fix order of Slimbus unprepare/disable
Krzysztof Kozlowski <[email protected]>
ASoC: wcd9335: fix order of Slimbus unprepare/disable
Patryk Duda <[email protected]>
platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure
Zhihao Cheng <[email protected]>
quota: Check next/prev free block number after reading from quota file
Andri Yngvason <[email protected]>
HID: multitouch: Add memory barriers
Alexander Aring <[email protected]>
fs: dlm: handle -EBUSY first in lock arg validation
Alexander Aring <[email protected]>
fs: dlm: fix race between test_bit() and queue_work()
Jarkko Nikula <[email protected]>
i2c: designware: Fix handling of real but unexpected device interrupts
Wenchao Chen <[email protected]>
mmc: sdhci-sprd: Fix minimum clock limit
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix CAN state after restart
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix TX queue out of sync after restart
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix overread with an invalid command
Anssi Hannula <[email protected]>
can: kvaser_usb: Fix use of uninitialized completion
Jean-Francois Le Fillatre <[email protected]>
usb: add quirks for Lenovo OneLink+ Dock
Rafael Mendonca <[email protected]>
xhci: dbc: Fix memory leak in xhci_alloc_dbc()
Eddie James <[email protected]>
iio: pressure: dps310: Reset chip after timeout
Eddie James <[email protected]>
iio: pressure: dps310: Refactor startup procedure
Nuno Sá <[email protected]>
iio: adc: ad7923: fix channel readings for some variants
Uwe Kleine-König <[email protected]>
iio: ltc2497: Fix reading conversion results
Michael Hennerich <[email protected]>
iio: dac: ad5593r: Fix i2c read protocol requirements
Zhang Xiaoxu <[email protected]>
cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message
Ronnie Sahlberg <[email protected]>
cifs: destage dirty pages before re-reading them for cache=none
Gaurav Kohli <[email protected]>
hv_netvsc: Fix race between VF offering and VF association message from host
Pavel Begunkov <[email protected]>
io_uring/net: don't update msg_name if not provided
Tudor Ambarus <[email protected]>
mtd: rawnand: atmel: Unmap streaming DMA mappings
Saranya Gopal <[email protected]>
ALSA: hda/realtek: Add Intel Reference SSID to support headset keys
Luke D. Jones <[email protected]>
ALSA: hda/realtek: Add quirk for ASUS GV601R laptop
Luke D. Jones <[email protected]>
ALSA: hda/realtek: Correct pin configs for ASUS G533Z
Callum Osmotherly <[email protected]>
ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix NULL dererence at error path
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix potential memory leaks
Takashi Iwai <[email protected]>
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
Takashi Iwai <[email protected]>
ALSA: oss: Fix potential deadlock at unregistration
Sasha Levin <[email protected]>
Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
-------------
Diffstat:
Documentation/ABI/testing/sysfs-bus-iio | 2 +- Documentation/arm64/silicon-errata.rst | 2 + Documentation/filesystems/vfs.rst | 3 + Makefile | 10 +- arch/arm/Kconfig | 1 - arch/arm/boot/compressed/vmlinux.lds.S | 2 + arch/arm/boot/dts/armada-385-turris-omnia.dts | 4 +- arch/arm/boot/dts/exynos4412-midas.dtsi | 2 +- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- arch/arm/boot/dts/imx6dl.dtsi | 3 + arch/arm/boot/dts/imx6q.dtsi | 3 + arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi | 6 +- arch/arm/boot/dts/imx6qp.dtsi | 6 + arch/arm/boot/dts/imx6sl.dtsi | 3 + arch/arm/boot/dts/imx6sll.dtsi | 3 + arch/arm/boot/dts/imx6sx.dtsi | 6 + arch/arm/boot/dts/imx7d-sdb.dts | 7 +- arch/arm/boot/dts/kirkwood-lsxl.dtsi | 16 +- arch/arm/mm/dump.c | 2 +- arch/arm/mm/kasan_init.c | 9 +- arch/arm/mm/mmu.c | 4 + arch/arm64/Kconfig | 17 ++ arch/arm64/boot/dts/freescale/imx8mp.dtsi | 4 +- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 1 + .../boot/dts/ti/k3-j7200-common-proc-board.dts | 10 +- arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 11 +- arch/arm64/kernel/cpu_errata.c | 5 + arch/arm64/kernel/ftrace.c | 17 +- arch/arm64/kernel/topology.c | 40 ---- arch/ia64/mm/numa.c | 1 + arch/mips/bcm47xx/prom.c | 4 +- arch/mips/sgi-ip27/ip27-xtalk.c | 74 ++++-- arch/powerpc/Makefile | 2 +- arch/powerpc/boot/Makefile | 1 + arch/powerpc/boot/dts/fsl/e500v1_power_isa.dtsi | 51 ++++ arch/powerpc/boot/dts/fsl/mpc8540ads.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8541cds.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8555cds.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8560ads.dts | 2 +- arch/powerpc/configs/pseries_defconfig | 1 + arch/powerpc/include/asm/syscalls.h | 12 + arch/powerpc/kernel/kprobes.c | 8 +- arch/powerpc/kernel/pci_dn.c | 1 + arch/powerpc/kernel/sys_ppc32.c | 14 +- arch/powerpc/kernel/syscalls.c | 4 +- arch/powerpc/math-emu/math_efp.c | 1 + arch/powerpc/platforms/powernv/opal.c | 1 + arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/sysdev/fsl_msi.c | 2 + arch/riscv/Kconfig | 2 +- arch/riscv/Makefile | 2 + arch/riscv/include/asm/io.h | 16 +- arch/riscv/kernel/setup.c | 4 +- arch/riscv/kernel/smpboot.c | 3 +- arch/riscv/kernel/sys_riscv.c | 3 - arch/riscv/mm/fault.c | 3 +- arch/sh/include/asm/sections.h | 2 +- arch/sh/kernel/machvec.c | 10 +- arch/um/kernel/um_arch.c | 2 +- arch/x86/include/asm/hyperv-tlfs.h | 4 +- arch/x86/include/asm/microcode.h | 1 + arch/x86/kernel/cpu/feat_ctl.c | 2 +- arch/x86/kernel/cpu/mce/apei.c | 13 +- arch/x86/kernel/cpu/microcode/amd.c | 3 +- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 12 +- arch/x86/kvm/emulate.c | 2 +- arch/x86/kvm/vmx/nested.c | 37 ++- arch/x86/kvm/vmx/vmx.c | 12 +- arch/x86/xen/enlighten_pv.c | 3 +- block/blk-throttle.c | 8 +- block/blk-wbt.c | 10 +- crypto/akcipher.c | 8 + drivers/acpi/acpi_fpdt.c | 22 ++ drivers/acpi/acpi_video.c | 16 ++ drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/x86/utils.c | 19 +- drivers/ata/libahci_platform.c | 14 +- drivers/base/arch_topology.c | 19 ++ drivers/block/nbd.c | 6 +- drivers/bluetooth/btintel.c | 17 +- drivers/bluetooth/btusb.c | 14 ++ drivers/bluetooth/hci_ldisc.c | 7 +- drivers/bluetooth/hci_serdev.c | 10 +- drivers/char/hw_random/arm_smccc_trng.c | 4 +- drivers/char/hw_random/imx-rngc.c | 14 +- drivers/clk/baikal-t1/ccu-div.c | 65 +++++ drivers/clk/baikal-t1/ccu-div.h | 10 + drivers/clk/baikal-t1/clk-ccu-div.c | 26 +- drivers/clk/bcm/clk-bcm2835.c | 43 +++- drivers/clk/berlin/bg2.c | 5 +- drivers/clk/berlin/bg2q.c | 6 +- drivers/clk/clk-ast2600.c | 2 +- drivers/clk/clk-oxnas.c | 6 +- drivers/clk/clk-qoriq.c | 10 +- drivers/clk/clk-versaclock5.c | 2 +- drivers/clk/imx/clk-scu.c | 6 +- drivers/clk/mediatek/clk-mt8183-mfgcfg.c | 6 +- drivers/clk/meson/meson-aoclk.c | 5 +- drivers/clk/meson/meson-eeclk.c | 5 +- drivers/clk/meson/meson8b.c | 5 +- drivers/clk/qcom/Kconfig | 1 + drivers/clk/qcom/apss-ipq6018.c | 2 +- drivers/clk/qcom/gcc-sm6115.c | 46 ++-- drivers/clk/sprd/common.c | 9 +- drivers/clk/tegra/clk-tegra114.c | 1 + drivers/clk/tegra/clk-tegra20.c | 1 + drivers/clk/tegra/clk-tegra210.c | 1 + drivers/clk/ti/clk-dra7-atl.c | 9 +- drivers/clk/zynqmp/clkc.c | 7 + drivers/clk/zynqmp/pll.c | 31 ++- drivers/cpufreq/intel_pstate.c | 1 + drivers/crypto/cavium/cpt/cptpf_main.c | 6 +- drivers/crypto/ccp/ccp-dmaengine.c | 6 +- drivers/crypto/hisilicon/qm.c | 6 +- drivers/crypto/hisilicon/zip/zip_crypto.c | 4 +- drivers/crypto/inside-secure/safexcel_hash.c | 8 +- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 18 +- drivers/crypto/qat/qat_common/adf_gen4_hw_data.h | 2 +- drivers/crypto/qat/qat_common/qat_algs.c | 18 +- drivers/crypto/sahara.c | 18 +- drivers/dma-buf/udmabuf.c | 9 +- drivers/dma/hisi_dma.c | 28 +-- drivers/dma/ioat/dma.c | 6 +- drivers/dma/mxs-dma.c | 11 +- drivers/dma/ti/k3-udma.c | 25 +- drivers/firmware/efi/libstub/fdt.c | 8 - drivers/firmware/google/gsmi.c | 9 + drivers/fpga/dfl.c | 2 +- drivers/fsi/fsi-core.c | 3 + drivers/gpio/gpio-rockchip.c | 7 + drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 67 +++--- drivers/gpu/drm/amd/display/dc/calcs/bw_fixed.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 16 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 6 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 35 +-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 3 +- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 8 +- drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 4 +- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 21 +- drivers/gpu/drm/arm/display/komeda/komeda_kms.h | 2 + drivers/gpu/drm/bridge/adv7511/adv7511.h | 5 +- drivers/gpu/drm/bridge/adv7511/adv7511_cec.c | 4 +- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 4 +- drivers/gpu/drm/bridge/lontium-lt9611.c | 3 +- .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 4 +- drivers/gpu/drm/bridge/parade-ps8640.c | 4 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 13 +- drivers/gpu/drm/drm_bridge.c | 4 +- drivers/gpu/drm/drm_dp_helper.c | 9 - drivers/gpu/drm/drm_dp_mst_topology.c | 6 +- drivers/gpu/drm/drm_ioctl.c | 8 +- drivers/gpu/drm/drm_mipi_dsi.c | 1 + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/gpu/drm/i915/intel_pm.c | 10 +- drivers/gpu/drm/meson/meson_drv.c | 10 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 12 +- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 29 +-- drivers/gpu/drm/msm/dp/dp_catalog.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 1 - drivers/gpu/drm/omapdrm/dss/dss.c | 3 + drivers/gpu/drm/pl111/pl111_versatile.c | 1 + drivers/gpu/drm/tiny/bochs.c | 2 + drivers/gpu/drm/udl/udl_modeset.c | 3 - drivers/gpu/drm/vc4/vc4_vec.c | 4 +- drivers/gpu/drm/virtio/virtgpu_object.c | 3 + drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 1 + drivers/hid/hid-multitouch.c | 8 +- drivers/hid/hid-roccat.c | 4 + drivers/hsi/controllers/omap_ssi_core.c | 1 + drivers/hsi/controllers/omap_ssi_port.c | 8 +- drivers/hwmon/gsc-hwmon.c | 1 + drivers/hwmon/pmbus/mp2888.c | 13 +- drivers/hwmon/sht4x.c | 2 +- drivers/i2c/busses/i2c-designware-core.h | 7 +- drivers/i2c/busses/i2c-designware-master.c | 13 + drivers/i2c/busses/i2c-mlxbf.c | 44 +++- drivers/iio/adc/ad7923.c | 4 +- drivers/iio/adc/at91-sama5d2_adc.c | 28 ++- drivers/iio/adc/ltc2497.c | 13 + drivers/iio/dac/ad5593r.c | 46 ++-- drivers/iio/inkern.c | 8 +- drivers/iio/magnetometer/yamaha-yas530.c | 2 +- drivers/iio/pressure/dps310.c | 262 +++++++++++++-------- drivers/infiniband/core/cm.c | 14 +- drivers/infiniband/core/uverbs_cmd.c | 5 +- drivers/infiniband/core/verbs.c | 2 + drivers/infiniband/hw/hns/hns_roce_mr.c | 1 - drivers/infiniband/hw/irdma/defs.h | 1 + drivers/infiniband/hw/irdma/hw.c | 51 ++-- drivers/infiniband/hw/irdma/type.h | 1 + drivers/infiniband/hw/irdma/user.h | 1 + drivers/infiniband/hw/irdma/utils.c | 3 + drivers/infiniband/hw/irdma/verbs.c | 2 + drivers/infiniband/hw/mlx4/mr.c | 1 - drivers/infiniband/hw/mlx5/main.c | 3 + drivers/infiniband/hw/mlx5/odp.c | 3 +- drivers/infiniband/sw/rxe/rxe_qp.c | 10 +- drivers/infiniband/sw/rxe/rxe_queue.c | 12 +- drivers/infiniband/sw/siw/siw.h | 1 + drivers/infiniband/sw/siw/siw_qp.c | 2 +- drivers/infiniband/sw/siw/siw_qp_rx.c | 27 ++- drivers/infiniband/sw/siw/siw_verbs.c | 3 + drivers/infiniband/ulp/srp/ib_srp.c | 4 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 21 ++ drivers/iommu/omap-iommu-debug.c | 6 +- drivers/isdn/mISDN/l1oip.h | 1 + drivers/isdn/mISDN/l1oip_core.c | 13 +- drivers/leds/flash/leds-lm3601x.c | 2 - drivers/mailbox/bcm-flexrm-mailbox.c | 8 +- drivers/mailbox/mailbox-mpfs.c | 25 +- drivers/md/bcache/writeback.c | 73 ++++-- drivers/md/raid0.c | 2 +- drivers/md/raid5.c | 15 +- drivers/media/pci/cx88/cx88-vbi.c | 9 +- drivers/media/pci/cx88/cx88-video.c | 43 ++-- drivers/media/platform/exynos4-is/fimc-is.c | 1 + drivers/media/platform/meson/ge2d/ge2d.c | 1 - drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 - drivers/media/platform/s5p-mfc/s5p_mfc.c | 3 +- drivers/media/platform/xilinx/xilinx-vipp.c | 9 +- drivers/media/usb/uvc/uvc_ctrl.c | 83 ++++--- drivers/media/usb/uvc/uvc_driver.c | 8 +- drivers/memory/of_memory.c | 2 + drivers/memory/pl353-smc.c | 1 + drivers/mfd/fsl-imx25-tsadc.c | 34 ++- drivers/mfd/intel_soc_pmic_core.c | 1 + drivers/mfd/lp8788-irq.c | 3 + drivers/mfd/lp8788.c | 12 +- drivers/mfd/sm501.c | 7 +- drivers/misc/ocxl/file.c | 2 + drivers/mmc/host/au1xmmc.c | 3 +- drivers/mmc/host/sdhci-msm.c | 1 + drivers/mmc/host/sdhci-sprd.c | 2 +- drivers/mmc/host/wmt-sdmmc.c | 5 +- drivers/mtd/devices/docg3.c | 7 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + drivers/mtd/nand/raw/fsl_elbc_nand.c | 28 ++- drivers/mtd/nand/raw/intel-nand-controller.c | 12 +- drivers/mtd/nand/raw/meson_nand.c | 4 +- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 2 + drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 3 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 2 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 79 +++++++ drivers/net/ethernet/atheros/alx/main.c | 5 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 + drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 177 +++++++++++--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 + drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 1 + drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 10 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 13 +- drivers/net/ethernet/ti/Kconfig | 1 + drivers/net/ethernet/ti/davinci_mdio.c | 242 ++++++++++++++++++- drivers/net/hyperv/hyperv_net.h | 3 +- drivers/net/hyperv/netvsc.c | 4 + drivers/net/hyperv/netvsc_drv.c | 19 ++ drivers/net/thunderbolt.c | 28 ++- drivers/net/usb/r8152.c | 4 +- drivers/net/wireless/ath/ath10k/mac.c | 54 +++-- drivers/net/wireless/ath/ath11k/mac.c | 25 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 43 ++-- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 3 +- .../net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 12 +- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 4 + .../net/wireless/mediatek/mt76/mt7915/debugfs.c | 6 +- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 1 + drivers/net/wireless/mediatek/mt76/sdio.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 34 ++- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 75 +++++- .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 9 +- drivers/net/wireless/realtek/rtw88/main.c | 8 +- drivers/net/wwan/iosm/iosm_ipc_wwan.c | 5 +- drivers/nvme/host/core.c | 3 +- drivers/nvme/host/multipath.c | 1 + drivers/nvme/host/pci.c | 3 +- drivers/nvme/target/tcp.c | 11 +- drivers/nvmem/core.c | 15 +- drivers/pci/setup-res.c | 11 + .../phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 6 +- drivers/phy/mediatek/phy-mtk-tphy.c | 7 +- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 +- drivers/pinctrl/pinctrl-rockchip.c | 13 + drivers/platform/chrome/chromeos_laptop.c | 24 +- drivers/platform/chrome/cros_ec.c | 8 +- drivers/platform/chrome/cros_ec_chardev.c | 3 + drivers/platform/chrome/cros_ec_proto.c | 32 +++ drivers/platform/chrome/cros_ec_typec.c | 2 +- drivers/platform/x86/msi-laptop.c | 14 +- drivers/power/supply/adp5061.c | 6 +- drivers/powercap/intel_rapl_common.c | 4 +- drivers/regulator/core.c | 2 +- drivers/regulator/qcom_rpm-regulator.c | 24 +- drivers/scsi/3w-9xxx.c | 2 +- drivers/scsi/cxgbi/libcxgbi.c | 2 +- drivers/scsi/iscsi_tcp.c | 140 ++++++++--- drivers/scsi/iscsi_tcp.h | 5 + drivers/scsi/libiscsi.c | 41 +++- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/qedf/qedf_main.c | 21 ++ drivers/slimbus/Kconfig | 3 +- drivers/slimbus/qcom-ngd-ctrl.c | 14 +- drivers/soc/qcom/smem_state.c | 3 +- drivers/soc/qcom/smsm.c | 20 +- drivers/soc/tegra/Kconfig | 1 - drivers/soundwire/cadence_master.c | 9 +- drivers/soundwire/intel.c | 1 - drivers/spi/spi-dw-bt1.c | 4 +- drivers/spi/spi-meson-spicc.c | 6 +- drivers/spi/spi-mt7621.c | 8 +- drivers/spi/spi-omap-100k.c | 1 + drivers/spi/spi-qup.c | 21 +- drivers/spi/spi-s3c64xx.c | 9 + drivers/spi/spi.c | 2 + drivers/spmi/spmi-pmic-arb.c | 13 +- drivers/staging/greybus/audio_helper.c | 11 - drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +- drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 5 +- drivers/staging/rtl8723bs/core/rtw_cmd.c | 16 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 60 ++--- drivers/staging/vt6655/device_main.c | 8 +- drivers/thermal/cpufreq_cooling.c | 10 +- drivers/thermal/intel/intel_powerclamp.c | 4 +- drivers/thermal/qcom/tsens-v0_1.c | 2 +- drivers/thunderbolt/nhi.c | 49 +++- drivers/thunderbolt/switch.c | 24 ++ drivers/thunderbolt/tb.h | 1 + drivers/thunderbolt/tb_regs.h | 1 + drivers/thunderbolt/usb4.c | 20 ++ drivers/tty/serial/8250/8250_core.c | 16 +- drivers/tty/serial/8250/8250_pci.c | 5 + drivers/tty/serial/8250/8250_port.c | 18 +- drivers/tty/serial/fsl_lpuart.c | 2 + drivers/tty/serial/jsm/jsm_driver.c | 3 +- drivers/tty/serial/xilinx_uartps.c | 2 + drivers/usb/common/debug.c | 96 +++++--- drivers/usb/core/quirks.c | 4 + drivers/usb/dwc3/core.c | 17 ++ drivers/usb/dwc3/core.h | 4 + drivers/usb/gadget/function/f_printer.c | 12 +- drivers/usb/host/xhci-dbgcap.c | 2 +- drivers/usb/host/xhci-mem.c | 7 +- drivers/usb/host/xhci-plat.c | 18 +- drivers/usb/host/xhci.c | 3 +- drivers/usb/host/xhci.h | 1 + drivers/usb/misc/idmouse.c | 8 +- drivers/usb/mtu3/mtu3_core.c | 2 - drivers/usb/mtu3/mtu3_plat.c | 2 + drivers/usb/musb/musb_gadget.c | 3 + drivers/usb/storage/unusual_devs.h | 6 - drivers/vhost/vsock.c | 2 +- drivers/video/fbdev/smscufx.c | 14 +- drivers/video/fbdev/stifb.c | 2 +- drivers/xen/gntdev-common.h | 3 +- drivers/xen/gntdev.c | 80 ++++--- fs/btrfs/extent-tree.c | 3 + fs/btrfs/free-space-cache.c | 6 + fs/btrfs/qgroup.c | 15 ++ fs/btrfs/scrub.c | 36 +++ fs/btrfs/super.c | 11 +- fs/cifs/file.c | 9 + fs/cifs/smb2pdu.c | 7 +- fs/cifs/smb2transport.c | 10 +- fs/dlm/ast.c | 6 +- fs/dlm/lock.c | 16 +- fs/dlm/lowcomms.c | 4 + fs/eventfd.c | 10 +- fs/ext2/super.c | 6 +- fs/ext4/fast_commit.c | 40 ++-- fs/ext4/file.c | 6 + fs/ext4/inode.c | 14 +- fs/ext4/namei.c | 17 +- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 25 +- fs/f2fs/checkpoint.c | 47 +++- fs/f2fs/data.c | 4 +- fs/f2fs/extent_cache.c | 3 +- fs/f2fs/f2fs.h | 9 +- fs/f2fs/gc.c | 10 +- fs/f2fs/recovery.c | 23 +- fs/f2fs/segment.c | 2 +- fs/f2fs/super.c | 15 +- fs/file_table.c | 7 +- fs/fs-writeback.c | 37 ++- fs/internal.h | 10 + fs/io-wq.c | 2 +- fs/io_uring.c | 43 ++-- fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 10 +- fs/jbd2/recovery.c | 1 + fs/jbd2/transaction.c | 6 +- fs/ksmbd/server.c | 4 +- fs/ksmbd/smb2pdu.c | 13 +- fs/ksmbd/smb_common.c | 6 +- fs/nfsd/nfs3proc.c | 11 +- fs/nfsd/nfs4proc.c | 19 +- fs/nfsd/nfs4recover.c | 4 +- fs/nfsd/nfs4state.c | 5 + fs/nfsd/nfs4xdr.c | 13 +- fs/nfsd/nfsproc.c | 6 +- fs/nfsd/xdr4.h | 3 +- fs/ntfs3/inode.c | 2 - fs/ntfs3/xattr.c | 102 +------- fs/open.c | 11 +- fs/quota/quota_tree.c | 38 +++ fs/splice.c | 10 +- fs/userfaultfd.c | 4 +- fs/xfs/xfs_super.c | 10 +- include/linux/ata.h | 39 +-- include/linux/bpf_verifier.h | 11 + include/linux/dynamic_debug.h | 11 +- include/linux/eventfd.h | 2 +- include/linux/fs.h | 9 +- include/linux/iova.h | 2 +- include/linux/once.h | 28 +++ include/linux/ring_buffer.h | 2 +- include/linux/sched.h | 2 +- include/linux/serial_8250.h | 1 + include/linux/serial_core.h | 3 +- include/linux/skbuff.h | 2 + include/linux/sunrpc/svc.h | 19 +- include/linux/tcp.h | 2 +- include/linux/trace.h | 36 ++- include/linux/trace_events.h | 1 + include/net/ieee802154_netdev.h | 12 +- include/net/tcp.h | 5 +- include/scsi/libiscsi.h | 6 +- include/uapi/rdma/mlx5-abi.h | 1 + kernel/bpf/bpf_local_storage.c | 4 +- kernel/bpf/bpf_task_storage.c | 8 +- kernel/bpf/btf.c | 2 +- kernel/bpf/hashtab.c | 30 ++- kernel/bpf/syscall.c | 2 + kernel/bpf/verifier.c | 42 +++- kernel/cgroup/cgroup.c | 6 +- kernel/cgroup/cpuset.c | 18 +- kernel/gcov/gcc_4_7.c | 18 +- kernel/livepatch/transition.c | 18 +- kernel/rcu/tasks.h | 2 +- kernel/rcu/tree.c | 17 +- kernel/rcu/tree_plugin.h | 3 +- kernel/trace/ftrace.c | 8 +- kernel/trace/kprobe_event_gen_test.c | 49 +++- kernel/trace/ring_buffer.c | 87 ++++++- kernel/trace/trace.c | 66 ++++++ kernel/trace/trace_eprobe.c | 60 +---- kernel/trace/trace_events_synth.c | 23 +- kernel/trace/trace_kprobe.c | 60 +---- kernel/trace/trace_osnoise.c | 3 +- kernel/trace/trace_probe_kernel.h | 115 +++++++++ lib/Kconfig.debug | 8 +- lib/dynamic_debug.c | 45 +--- lib/once.c | 30 +++ mm/damon/vaddr.c | 10 + mm/hugetlb.c | 37 ++- mm/mmap.c | 5 +- net/bluetooth/hci_core.c | 34 ++- net/bluetooth/hci_sysfs.c | 3 + net/bluetooth/l2cap_core.c | 17 +- net/bluetooth/rfcomm/sock.c | 3 + net/can/bcm.c | 7 +- net/core/skmsg.c | 12 +- net/core/stream.c | 3 +- net/ieee802154/socket.c | 4 + net/ipv4/inet_hashtables.c | 4 +- net/ipv4/netfilter/nft_fib_ipv4.c | 3 + net/ipv4/tcp.c | 16 +- net/ipv4/tcp_output.c | 19 +- net/ipv6/netfilter/nft_fib_ipv6.c | 6 +- net/mac80211/cfg.c | 3 - net/netfilter/nf_conntrack_core.c | 18 +- net/openvswitch/datapath.c | 18 +- net/rds/tcp.c | 2 +- net/sctp/auth.c | 18 +- net/unix/garbage.c | 20 ++ net/vmw_vsock/virtio_transport_common.c | 2 +- net/xdp/xsk.c | 22 +- net/xdp/xsk_queue.h | 22 +- net/xfrm/xfrm_input.c | 18 +- net/xfrm/xfrm_ipcomp.c | 1 + scripts/Kbuild.include | 23 +- scripts/package/mkspec | 4 +- scripts/selinux/install_policy.sh | 2 +- security/Kconfig.hardening | 13 +- security/integrity/ima/ima_appraise.c | 12 +- sound/core/pcm_dmaengine.c | 8 +- sound/core/rawmidi.c | 2 - sound/core/sound_oss.c | 13 +- sound/pci/hda/hda_beep.c | 15 +- sound/pci/hda/hda_beep.h | 1 + sound/pci/hda/patch_hdmi.c | 6 - sound/pci/hda/patch_realtek.c | 11 +- sound/pci/hda/patch_sigmatel.c | 25 +- sound/soc/codecs/da7219.c | 5 +- sound/soc/codecs/lpass-tx-macro.c | 13 +- sound/soc/codecs/mt6359-accdet.c | 6 +- sound/soc/codecs/mt6660.c | 8 +- sound/soc/codecs/tas2764.c | 78 ++---- sound/soc/codecs/wcd9335.c | 2 +- sound/soc/codecs/wcd934x.c | 2 +- sound/soc/codecs/wm5102.c | 6 +- sound/soc/codecs/wm5110.c | 6 +- sound/soc/codecs/wm8997.c | 6 +- sound/soc/fsl/eukrea-tlv320.c | 8 +- sound/soc/sh/rcar/ctu.c | 6 +- sound/soc/sh/rcar/dvc.c | 6 +- sound/soc/sh/rcar/mix.c | 6 +- sound/soc/sh/rcar/src.c | 5 +- sound/soc/sh/rcar/ssi.c | 4 +- sound/soc/sof/sof-pci-dev.c | 2 +- sound/usb/card.c | 32 ++- sound/usb/endpoint.c | 6 +- sound/usb/quirks.c | 42 ---- sound/usb/quirks.h | 2 - sound/usb/usbaudio.h | 1 + tools/bpf/bpftool/btf_dumper.c | 2 +- tools/bpf/bpftool/main.c | 10 + tools/lib/bpf/xsk.c | 6 +- tools/objtool/elf.c | 7 +- tools/perf/util/intel-pt.c | 9 +- .../selftests/arm64/signal/testcases/testcases.c | 2 +- tools/testing/selftests/tpm2/tpm2.py | 4 + 529 files changed, 4805 insertions(+), 2196 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 62/530 serial: 8250: Let drivers request full 16550A feature probing
From: Maciej W. Rozycki <[email protected]>
commit 9906890c89e4dbd900ed87ad3040080339a7f411 upstream.
A SERIAL_8250_16550A_VARIANTS configuration option has been recently defined that lets one request the 8250 driver not to probe for 16550A device features so as to reduce the driver's device startup time in virtual machines.
Some actual hardware devices require these features to have been fully determined however for their driver to work correctly, so define a flag to let drivers request full 16550A feature probing on a device-by-device basis if required regardless of the SERIAL_8250_16550A_VARIANTS option setting chosen.
--- drivers/tty/serial/8250/8250_port.c | 3 ++- include/linux/serial_core.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_port.c +2 -1
@@ -1029,7 +1029,8 @@ static void autoconfig_16550a(struct uar up->port.type =PORT_16550A ; up->capabilities |=UART_CAP_FIFO ; -if (!IS_ENABLED (CONFIG_SERIAL_8250_16550A_VARIANTS )) +if (!IS_ENABLED (CONFIG_SERIAL_8250_16550A_VARIANTS ) && + !(up->port.flags &UPF_FULL_PROBE ))return ;/*
include/linux/serial_core.h +2 -1
@@ -100,7 +100,7 @@ struct uart_icount {__u32 buf_overrun; }; -typedef unsigned int __bitwise upf_t ; +typedef u64 __bitwise upf_t ;typedef unsigned int __bitwise upstat_t ;struct uart_port {
@@ -207,6 +207,7 @@ struct uart_port {#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))#define UPF_DEAD ((__force upf_t) (1 << 30))#define UPF_IOREMAP ((__force upf_t) (1 << 31)) +#define UPF_FULL_PROBE ((__force upf_t) (1ULL << 32))#define __UPF_CHANGE_MASK 0x17fff#define UPF_CHANGE_MASK ((__force upf_t) __UPF_CHANGE_MASK)
Greg Kroah-Hartman
maintainerPATCH 37/530 regulator: qcom_rpm: Fix circular deferral regression
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
commit 8478ed5844588703a1a4c96a004b1525fbdbdd5e upstream.
On recent kernels, the PM8058 L16 (or any other PM8058 LDO-regulator) does not come up if they are supplied by an SMPS-regulator. This is not very strange since the regulators are registered in a long array and the L-regulators are registered before the S-regulators, and if an L-regulator defers, it will never get around to registering the S-regulator that it needs.
See arch/arm/boot/dts/qcom-apq8060-dragonboard.dts:
pm8058-regulators {
(...)
vdd_l13_l16-supply = <&pm8058_s4>;
(...)Ooops.
Fix this by moving the PM8058 S-regulators first in the array.
Do the same for the PM8901 S-regulators (though this is currently not causing any problems with out device trees) so that the pattern of registration order is the same on all PMnnnn chips.
--- drivers/regulator/qcom_rpm-regulator.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/regulator/qcom_rpm-regulator.c +12 -12
@@ -802,6 +802,12 @@ static const struct rpm_regulator_data r };static const struct rpm_regulator_data rpm_pm8058_regulators[] = { + {"s0" ,QCOM_RPM_PM8058_SMPS0 , &pm8058_smps,"vdd_s0" }, + {"s1" ,QCOM_RPM_PM8058_SMPS1 , &pm8058_smps,"vdd_s1" }, + {"s2" ,QCOM_RPM_PM8058_SMPS2 , &pm8058_smps,"vdd_s2" }, + {"s3" ,QCOM_RPM_PM8058_SMPS3 , &pm8058_smps,"vdd_s3" }, + {"s4" ,QCOM_RPM_PM8058_SMPS4 , &pm8058_smps,"vdd_s4" }, + {"l0" ,QCOM_RPM_PM8058_LDO0 , &pm8058_nldo,"vdd_l0_l1_lvs" }, {"l1" ,QCOM_RPM_PM8058_LDO1 , &pm8058_nldo,"vdd_l0_l1_lvs" }, {"l2" ,QCOM_RPM_PM8058_LDO2 , &pm8058_pldo,"vdd_l2_l11_l12" },
@@ -829,12 +835,6 @@ static const struct rpm_regulator_data r { "l24", QCOM_RPM_PM8058_LDO24, &pm8058_nldo, "vdd_l23_l24_l25" }, { "l25", QCOM_RPM_PM8058_LDO25, &pm8058_nldo, "vdd_l23_l24_l25" }, - { "s0", QCOM_RPM_PM8058_SMPS0, &pm8058_smps, "vdd_s0" }, - { "s1", QCOM_RPM_PM8058_SMPS1, &pm8058_smps, "vdd_s1" }, - { "s2", QCOM_RPM_PM8058_SMPS2, &pm8058_smps, "vdd_s2" }, - { "s3", QCOM_RPM_PM8058_SMPS3, &pm8058_smps, "vdd_s3" }, - { "s4", QCOM_RPM_PM8058_SMPS4, &pm8058_smps, "vdd_s4" }, - { "lvs0", QCOM_RPM_PM8058_LVS0, &pm8058_switch, "vdd_l0_l1_lvs" }, { "lvs1", QCOM_RPM_PM8058_LVS1, &pm8058_switch, "vdd_l0_l1_lvs" },
@@ -843,6 +843,12 @@ static const struct rpm_regulator_data r };static const struct rpm_regulator_data rpm_pm8901_regulators[] = { + {"s0" ,QCOM_RPM_PM8901_SMPS0 , &pm8901_ftsmps,"vdd_s0" }, + {"s1" ,QCOM_RPM_PM8901_SMPS1 , &pm8901_ftsmps,"vdd_s1" }, + {"s2" ,QCOM_RPM_PM8901_SMPS2 , &pm8901_ftsmps,"vdd_s2" }, + {"s3" ,QCOM_RPM_PM8901_SMPS3 , &pm8901_ftsmps,"vdd_s3" }, + {"s4" ,QCOM_RPM_PM8901_SMPS4 , &pm8901_ftsmps,"vdd_s4" }, + {"l0" ,QCOM_RPM_PM8901_LDO0 , &pm8901_nldo,"vdd_l0" }, {"l1" ,QCOM_RPM_PM8901_LDO1 , &pm8901_pldo,"vdd_l1" }, {"l2" ,QCOM_RPM_PM8901_LDO2 , &pm8901_pldo,"vdd_l2" },
@@ -851,12 +857,6 @@ static const struct rpm_regulator_data r { "l5", QCOM_RPM_PM8901_LDO5, &pm8901_pldo, "vdd_l5" }, { "l6", QCOM_RPM_PM8901_LDO6, &pm8901_pldo, "vdd_l6" }, - { "s0", QCOM_RPM_PM8901_SMPS0, &pm8901_ftsmps, "vdd_s0" }, - { "s1", QCOM_RPM_PM8901_SMPS1, &pm8901_ftsmps, "vdd_s1" }, - { "s2", QCOM_RPM_PM8901_SMPS2, &pm8901_ftsmps, "vdd_s2" }, - { "s3", QCOM_RPM_PM8901_SMPS3, &pm8901_ftsmps, "vdd_s3" }, - { "s4", QCOM_RPM_PM8901_SMPS4, &pm8901_ftsmps, "vdd_s4" }, - { "lvs0", QCOM_RPM_PM8901_LVS0, &pm8901_switch, "lvs0_in" }, { "lvs1", QCOM_RPM_PM8901_LVS1, &pm8901_switch, "lvs1_in" }, { "lvs2", QCOM_RPM_PM8901_LVS2, &pm8901_switch, "lvs2_in" },
Greg Kroah-Hartman
maintainerPATCH 67/530 powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain
In reply to Greg Kroah-HartmanFrom: Zhang Rui <[email protected]>
commit 4c081324df5608b73428662ca54d5221ea03a6bd upstream.
Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.
Remove the SPR dram_domain_energy_unit quirk.
--- drivers/powercap/intel_rapl_common.c | 1 - 1 file changed, 1 deletion(-)
drivers/powercap/intel_rapl_common.c +0 -1
@@ -979,7 +979,6 @@ static const struct rapl_defaults rapl_d .check_unit = rapl_check_unit_core, .set_floor_freq = set_floor_freq_default, .compute_time_window = rapl_compute_time_window_core, - .dram_domain_energy_unit = 15300, .psys_domain_energy_unit = 1000000000, };
Greg Kroah-Hartman
maintainerPATCH 33/530 ASoC: wcd9335: fix order of Slimbus unprepare/disable
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit ea8ef003aa53ad23e7705c5cab1c4e664faa6c79 upstream.
Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream.
--- sound/soc/codecs/wcd9335.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wcd9335.c +1 -1
@@ -1971,8 +1971,8 @@ static int wcd9335_trigger(struct snd_pccase SNDRV_PCM_TRIGGER_STOP :case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_PAUSE_PUSH : -slim_stream_unprepare (dai_data->sruntime);slim_stream_disable (dai_data->sruntime); +slim_stream_unprepare (dai_data->sruntime);break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 35/530 hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
commit 7f62cf781e6567d59c8935dc8c6068ce2bb904b7 upstream.
In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument.
--- drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwmon/gsc-hwmon.c +1 -0
@@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct devic pdata->nchannels = nchannels;/* fan controller base address */ +of_node_get (dev->parent->of_node); fan =of_find_compatible_node (dev->parent->of_node,NULL ,"gw,gsc-fan" );if (fan &&of_property_read_u32 (fan,"reg" , &pdata->fan_base)) {dev_err (dev,"fan node without base\n" );
Greg Kroah-Hartman
maintainerPATCH 70/530 slimbus: qcom-ngd: cleanup in probe error path
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 16f14551d0df9e7cd283545d7d748829594d912f upstream.
Add proper error path in probe() to cleanup resources previously acquired/allocated to fix warnings visible during probe deferral:
notifier callback qcom_slim_ngd_ssr_notify already registered
WARNING: CPU: 6 PID: 70 at kernel/notifier.c:28 notifier_chain_register+0x5c/0x90 Modules linked in: CPU: 6 PID: 70 Comm: kworker/u16:1 Not tainted 6.0.0-rc3-next-20220830 #380 Call trace: notifier_chain_register+0x5c/0x90 srcu_notifier_chain_register+0x44/0x90 qcom_register_ssr_notifier+0x38/0x4c qcom_slim_ngd_ctrl_probe+0xd8/0x400 platform_probe+0x6c/0xe0 really_probe+0xbc/0x2d4 __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x12c __device_attach_driver+0xb8/0x120 bus_for_each_drv+0x78/0xd0 __device_attach+0xa8/0x1c0 device_initial_probe+0x18/0x24 bus_probe_device+0xa0/0xac deferred_probe_work_func+0x88/0xc0 process_one_work+0x1d4/0x320 worker_thread+0x2cc/0x44c kthread+0x110/0x114 ret_from_fork+0x10/0x20
--- drivers/slimbus/qcom-ngd-ctrl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +11 -2
@@ -1567,18 +1567,27 @@ static int qcom_slim_ngd_ctrl_probe(stru ctrl->pdr =pdr_handle_alloc (slim_pd_status, ctrl);if (IS_ERR (ctrl->pdr)) {dev_err (dev,"Failed to init PDR handle\n" ); -return PTR_ERR (ctrl->pdr); + ret =PTR_ERR (ctrl->pdr); + goto err_pdr_alloc; } pds =pdr_add_lookup (ctrl->pdr,"avs/audio" ,"msm/adsp/audio_pd" );if (IS_ERR (pds) &&PTR_ERR (pds) != -EALREADY ) { ret =PTR_ERR (pds);dev_err (dev,"pdr add lookup failed: %d\n" , ret); -return ret; + goto err_pdr_lookup; }platform_driver_register (&qcom_slim_ngd_driver);return of_qcom_slim_ngd_register (dev, ctrl); + +err_pdr_alloc: +qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb); + +err_pdr_lookup: +pdr_handle_release (ctrl->pdr); + +return ret; }static int qcom_slim_ngd_ctrl_remove (struct platform_device *pdev)
Greg Kroah-Hartman
maintainerPATCH 4/530 ALSA: usb-audio: Fix potential memory leaks
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 6382da0828995af87aa8b8bef28cc61aceb4aff3 upstream.
When the driver hits -ENOMEM at allocating a URB or a buffer, it aborts and goes to the error path that releases the all previously allocated resources. However, when -ENOMEM hits at the middle of the sync EP URB allocation loop, the partially allocated URBs might be left without released, because ep->nurbs is still zero at that point.
Fix it by setting ep->nurbs at first, so that the error handler loops over the full URB list.
--- sound/usb/endpoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/usb/endpoint.c +1 -2
@@ -1223,6 +1223,7 @@ static int sync_ep_set_params(struct sndif (!ep->syncbuf)return -ENOMEM ; + ep->nurbs =SYNC_URBS ;for (i =0 ; i <SYNC_URBS ; i++) {struct snd_urb_ctx *u = &ep->urb[i]; u->index = i;
@@ -1242,8 +1243,6 @@ static int sync_ep_set_params(struct snd u->urb->complete = snd_complete_urb; } - ep->nurbs =SYNC_URBS ; -return 0 ; out_of_memory:
Greg Kroah-Hartman
maintainerPATCH 96/530 ext4: dont increase iversion counter for ea_inodes
In reply to Greg Kroah-HartmanFrom: Lukas Czerner <[email protected]>
commit 50f094a5580e6297bf10a807d16f0ee23fa576cf upstream.
ea_inodes are using i_version for storing part of the reference count so we really need to leave it alone.
The problem can be reproduced by xfstest ext4/026 when iversion is enabled. Fix it by not calling inode_inc_iversion() for EXT4_EA_INODE_FL inodes in ext4_mark_iloc_dirty().
--- fs/ext4/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/ext4/inode.c +6 -1
@@ -5701,7 +5701,12 @@ int ext4_mark_iloc_dirty(handle_t *handl }ext4_fc_track_inode (handle, inode); -if (IS_I_VERSION (inode)) +/* +* ea_inodes are using i_version for storing reference count, don't +* mess with it +*/ +if (IS_I_VERSION (inode) && + !(EXT4_I (inode)->i_flags &EXT4_EA_INODE_FL ))inode_inc_iversion (inode);/* the do_update_inode consumes one bh->b_count */
Greg Kroah-Hartman
maintainerPATCH 50/530 Revert "drm/amdgpu: use dirty framebuffer helper"
In reply to Greg Kroah-HartmanFrom: Hamza Mahfooz <[email protected]>
commit 17d819e2828cacca2e4c909044eb9798ed379cd2 upstream.
This reverts commit 66f99628eb24409cb8feb5061f78283c8b65f820.
Unfortunately, that commit causes performance regressions on non-PSR setups. So, just revert it until FB_DAMAGE_CLIPS support can be added.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -12
@@ -35,8 +35,6 @@#include <linux/pci.h> #include <linux/pm_runtime.h> #include <drm/drm_crtc_helper.h> -#include <drm/drm_damage_helper.h> -#include <drm/drm_drv.h> #include <drm/drm_edid.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_helper.h>
@@ -494,12 +492,6 @@ static const struct drm_framebuffer_func .create_handle = drm_gem_fb_create_handle, }; -static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = { - .destroy = drm_gem_fb_destroy, - .create_handle = drm_gem_fb_create_handle, - .dirty = drm_atomic_helper_dirtyfb, -}; -uint32_t amdgpu_display_supported_domains (struct amdgpu_device *adev,uint64_t bo_flags) {
@@ -1117,10 +1109,8 @@ int amdgpu_display_gem_fb_verify_and_iniif (ret) goto err; -if (drm_drv_uses_atomic_modeset (dev)) - ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs_atomic); -else - ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs); + ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs); +if (ret) goto err;
Greg Kroah-Hartman
maintainerPATCH 90/530 jbd2: fix potential use-after-free in jbd2_fc_wait_bufs
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 243d1a5d505d0b0460c9af0ad56ed4a56ef0bebd upstream.
In 'jbd2_fc_wait_bufs' use 'bh' after put buffer head reference count which may lead to use-after-free.
So judge buffer if uptodate before put buffer head reference count.
--- fs/jbd2/journal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/jbd2/journal.c +3 -3
@@ -924,16 +924,16 @@ int jbd2_fc_wait_bufs(journal_t *journalfor (i = j_fc_off -1 ; i >= j_fc_off - num_blks; i--) { bh = journal->j_fc_wbuf[i];wait_on_buffer (bh); -put_bh (bh); - journal->j_fc_wbuf[i] =NULL ;/* * Update j_fc_off so jbd2_fc_release_bufs can release remain * buffer head. */ if (unlikely (!buffer_uptodate (bh))) { - journal->j_fc_off = i; + journal->j_fc_off = i +1 ;return -EIO ; } +put_bh (bh); + journal->j_fc_wbuf[i] =NULL ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 78/530 fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE
In reply to Greg Kroah-HartmanFrom: Lukas Czerner <[email protected]>
commit cbfecb927f429a6fa613d74b998496bd71e4438a upstream.
Currently the I_DIRTY_TIME will never get set if the inode already has I_DIRTY_INODE with assumption that it supersedes I_DIRTY_TIME. That's true, however ext4 will only update the on-disk inode in ->dirty_inode(), not on actual writeback. As a result if the inode already has I_DIRTY_INODE state by the time we get to __mark_inode_dirty() only with I_DIRTY_TIME, the time was already filled into on-disk inode and will not get updated until the next I_DIRTY_INODE update, which might never come if we crash or get a power failure.
The problem can be reproduced on ext4 by running xfstest generic/622 with -o iversion mount option.
Fix it by allowing I_DIRTY_TIME to be set even if the inode already has I_DIRTY_INODE. Also make sure that the case is properly handled in writeback_single_inode() as well. Additionally changes in xfs_fs_dirty_inode() was made to accommodate for I_DIRTY_TIME in flag.
Thanks Jan Kara for suggestions on how to make this work properly.
--- Documentation/filesystems/vfs.rst | 3 +++ fs/fs-writeback.c | 37 +++++++++++++++++++++++++------------ fs/xfs/xfs_super.c | 10 ++++++++-- include/linux/fs.h | 9 +++++---- 4 files changed, 41 insertions(+), 18 deletions(-)
Documentation/filesystems/vfs.rst +3 -0
@@ -274,6 +274,9 @@ or bottom half). This is specifically for the inode itself being marked dirty, not its data. If the update needs to be persisted by fdatasync(), then I_DIRTY_DATASYNC will be set in the flags argument. + I_DIRTY_TIME will be set in the flags in case lazytime is enabled + and struct inode has times updated since the last ->dirty_inode + call. ``write_inode`` this method is called when the VFS needs to write an inode to
fs/fs-writeback.c +25 -12
@@ -1745,9 +1745,14 @@ static int writeback_single_inode(struct*/ if (!(inode->i_state &I_DIRTY_ALL ))inode_cgwb_move_to_attached (inode, wb); -else if (!(inode->i_state &I_SYNC_QUEUED ) && - (inode->i_state &I_DIRTY )) -redirty_tail_locked (inode, wb); +else if (!(inode->i_state &I_SYNC_QUEUED )) { +if ((inode->i_state &I_DIRTY )) +redirty_tail_locked (inode, wb); +else if (inode->i_state &I_DIRTY_TIME ) { + inode->dirtied_when = jiffies; +inode_io_list_move_locked (inode, wb, &wb->b_dirty_time); + } + }spin_unlock (&wb->list_lock);inode_sync_complete (inode);
@@ -2401,6 +2406,20 @@ void __mark_inode_dirty(struct inode *inif (flags &I_DIRTY_INODE ) {/* +* Inode timestamp update will piggback on this dirtying. +* We tell ->dirty_inode callback that timestamps need to +* be updated by setting I_DIRTY_TIME in flags. +*/ +if (inode->i_state &I_DIRTY_TIME ) { +spin_lock (&inode->i_lock); +if (inode->i_state &I_DIRTY_TIME ) { + inode->i_state &= ~I_DIRTY_TIME ; + flags |=I_DIRTY_TIME ; + } +spin_unlock (&inode->i_lock); + } + +/* * Notify the filesystem about the inode being dirtied, so that * (if needed) it can update on-disk fields and journal the * inode. This is only needed when the inode itself is being
@@ -2409,7 +2428,8 @@ void __mark_inode_dirty(struct inode *in*/ trace_writeback_dirty_inode_start (inode, flags);if (sb->s_op->dirty_inode) - sb->s_op->dirty_inode (inode, flags &I_DIRTY_INODE ); + sb->s_op->dirty_inode (inode, + flags & (I_DIRTY_INODE |I_DIRTY_TIME ));trace_writeback_dirty_inode (inode, flags);/* I_DIRTY_INODE supersedes I_DIRTY_TIME. */
@@ -2430,21 +2450,15 @@ void __mark_inode_dirty(struct inode *in*/ smp_mb (); -if (((inode->i_state & flags) == flags) || - (dirtytime && (inode->i_state &I_DIRTY_INODE ))) +if ((inode->i_state & flags) == flags)return ;spin_lock (&inode->i_lock); -if (dirtytime && (inode->i_state &I_DIRTY_INODE )) - goto out_unlock_inode;if ((inode->i_state & flags) != flags) {const int was_dirty = inode->i_state &I_DIRTY ;inode_attach_wb (inode,NULL ); -/* I_DIRTY_INODE supersedes I_DIRTY_TIME. */ -if (flags &I_DIRTY_INODE ) - inode->i_state &= ~I_DIRTY_TIME ; inode->i_state |= flags;/*
@@ -2517,7 +2531,6 @@ void __mark_inode_dirty(struct inode *in out_unlock:if (wb)spin_unlock (&wb->list_lock); -out_unlock_inode:spin_unlock (&inode->i_lock); }EXPORT_SYMBOL (__mark_inode_dirty);
fs/xfs/xfs_super.c +8 -2
@@ -642,7 +642,7 @@ xfs_fs_destroy_inode(static void xfs_fs_dirty_inode (struct inode *inode, -int flag) +int flags) {struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount;
@@ -650,7 +650,13 @@ xfs_fs_dirty_inode(if (!(inode->i_sb->s_flags &SB_LAZYTIME ))return ; -if (flag !=I_DIRTY_SYNC || !(inode->i_state &I_DIRTY_TIME )) + +/* +* Only do the timestamp update if the inode is dirty (I_DIRTY_SYNC) +* and has dirty timestamp (I_DIRTY_TIME). I_DIRTY_TIME can be passed +* in flags possibly together with I_DIRTY_SYNC. +*/ +if ((flags & ~I_DIRTY_TIME ) !=I_DIRTY_SYNC || !(flags &I_DIRTY_TIME ))return ;if (xfs_trans_alloc (mp, &M_RES (mp)->tr_fsyncts,0 ,0 ,0 , &tp))
include/linux/fs.h +5 -4
@@ -2288,13 +2288,14 @@ static inline void kiocb_clone(struct ki* don't have to write inode on fdatasync() when only * e.g. the timestamps have changed. * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. -* I_DIRTY_TIME The inode itself only has dirty timestamps, and the +* I_DIRTY_TIME The inode itself has dirty timestamps, and the * lazytime mount option is enabled. We keep track of this * separately from I_DIRTY_SYNC in order to implement * lazytime. This gets cleared if I_DIRTY_INODE -* (I_DIRTY_SYNC and/or I_DIRTY_DATASYNC) gets set. I.e. -* either I_DIRTY_TIME *or* I_DIRTY_INODE can be set in -* i_state, but not both. I_DIRTY_PAGES may still be set. +* (I_DIRTY_SYNC and/or I_DIRTY_DATASYNC) gets set. But +* I_DIRTY_TIME can still be set if I_DIRTY_SYNC is already +* in place because writeback might already be in progress +* and we don't want to lose the time update * I_NEW Serves as both a mutex and completion notification. * New inodes set I_NEW. If two processes both create * the same inode, one of them will release its inode and
Greg Kroah-Hartman
maintainerPATCH 71/530 scsi: qedf: Populate sysfs attributes for vport
In reply to Greg Kroah-HartmanFrom: Saurav Kashyap <[email protected]>
commit 592642e6b11e620e4b43189f8072752429fc8dc3 upstream.
Few vport parameters were displayed by systool as 'Unknown' or 'NULL'. Copy speed, supported_speed, frame_size and update port_type for NPIV port.
--- drivers/scsi/qedf/qedf_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/scsi/qedf/qedf_main.c +21 -0
@@ -1921,6 +1921,27 @@ static int qedf_vport_create(struct fc_vfc_vport_setlink (vn_port); } +/* Set symbolic node name */ +if (base_qedf->pdev->device == QL45xxx) +snprintf (fc_host_symbolic_name (vn_port->host),256 , +"Marvell FastLinQ 45xxx FCoE v%s" ,QEDF_VERSION ); + +if (base_qedf->pdev->device == QL41xxx) +snprintf (fc_host_symbolic_name (vn_port->host),256 , +"Marvell FastLinQ 41xxx FCoE v%s" ,QEDF_VERSION ); + +/* Set supported speed */ +fc_host_supported_speeds (vn_port->host) = n_port->link_supported_speeds; + +/* Set speed */ + vn_port->link_speed = n_port->link_speed; + +/* Set port type */ +fc_host_port_type (vn_port->host) =FC_PORTTYPE_NPIV ; + +/* Set maxframe size */ +fc_host_maxframe_size (vn_port->host) = n_port->mfs; +QEDF_INFO (&(base_qedf->dbg_ctx),QEDF_LOG_NPIV ,"vn_port=%p.\n" , vn_port);
Greg Kroah-Hartman
maintainerPATCH 77/530 ksmbd: Fix user namespace mapping
In reply to Greg Kroah-HartmanFrom: Mickaël Salaün <[email protected]>
commit 7c88c1e0ab1704bacb751341ee6431c3be34b834 upstream.
A kernel daemon should not rely on the current thread, which is unknown and might be malicious. Before this security fix, ksmbd_override_fsids() didn't correctly override FS UID/GID which means that arbitrary user space threads could trick the kernel to impersonate arbitrary users or groups for file system access checks, leading to file system access bypass.
This was found while investigating truncate support for Landlock:
https://lore.kernel.org/r/CAKYAXd8fpMJ7guizOjHgxEyyjoUwPsx3jLOPZP=wPYcbhkVXqA@mail.gmail.com
--- fs/ksmbd/smb_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ksmbd/smb_common.c +4 -2
@@ -4,6 +4,8 @@* Copyright (C) 2018 Namjae Jeon <[email protected]> */ +#include <linux/user_namespace.h> +#include "smb_common.h" #include "server.h" #include "misc.h"
@@ -624,8 +626,8 @@ int ksmbd_override_fsids(struct ksmbd_woif (!cred)return -ENOMEM ; - cred->fsuid =make_kuid (current_user_ns (), uid); - cred->fsgid =make_kgid (current_user_ns (), gid); + cred->fsuid =make_kuid (&init_user_ns, uid); + cred->fsgid =make_kgid (&init_user_ns, gid); gi =groups_alloc (0 );if (!gi) {
Greg Kroah-Hartman
maintainerPATCH 73/530 pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback
In reply to Greg Kroah-HartmanFrom: Quentin Schulz <[email protected]>
commit 4635c0e2a7f7f3568cbfccae70121f9835efa62c upstream.
Before the split of gpio and pinctrl sections in their own driver, rockchip_set_mux was called in pinmux_ops.gpio_set_direction for configuring a pin in its GPIO function.
This is essential for cases where pinctrl is "bypassed" by gpio consumers otherwise the GPIO function is not configured for the pin and it does not work. Such was the case for the sysfs/libgpiod userspace GPIO handling.
Let's re-implement the pinmux_ops.gpio_set_direction callback so that the gpio subsystem can request from the pinctrl driver to put the pin in its GPIO function.
--- drivers/pinctrl/pinctrl-rockchip.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/pinctrl/pinctrl-rockchip.c +13 -0
@@ -2072,11 +2072,24 @@ static int rockchip_pmx_set(struct pinctreturn 0 ; } +static int rockchip_pmx_gpio_set_direction (struct pinctrl_dev *pctldev, +struct pinctrl_gpio_range *range, +unsigned offset, +bool input) +{ +struct rockchip_pinctrl *info =pinctrl_dev_get_drvdata (pctldev); +struct rockchip_pin_bank *bank; + + bank =pin_to_bank (info, offset); +return rockchip_set_mux (bank, offset - bank->pin_base,RK_FUNC_GPIO ); +} +static const struct pinmux_ops rockchip_pmx_ops = { .get_functions_count = rockchip_pmx_get_funcs_count, .get_function_name = rockchip_pmx_get_func_name, .get_function_groups = rockchip_pmx_get_groups, .set_mux = rockchip_pmx_set, + .gpio_set_direction = rockchip_pmx_gpio_set_direction, };/*
Greg Kroah-Hartman
maintainerPATCH 109/530 ring-buffer: Add ring_buffer_wake_waiters()
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 7e9fbbb1b776d8d7969551565bc246f74ec53b27 upstream.
On closing of a file that represents a ring buffer or flushing the file, there may be waiters on the ring buffer that needs to be woken up and exit the ring_buffer_wait() function.
Add ring_buffer_wake_waiters() to wake up the waiters on the ring buffer and allow them to exit the wait loop.
--- include/linux/ring_buffer.h | 2 +- kernel/trace/ring_buffer.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-)
include/linux/ring_buffer.h +1 -1
@@ -101,7 +101,7 @@ __ring_buffer_alloc(unsigned long size,int ring_buffer_wait (struct trace_buffer *buffer,int cpu,int full);__poll_t ring_buffer_poll_wait (struct trace_buffer *buffer,int cpu,struct file *filp,poll_table *poll_table); - +void ring_buffer_wake_waiters (struct trace_buffer *buffer,int cpu);#define RING_BUFFER_ALL_CPUS -1
kernel/trace/ring_buffer.c +39 -0
@@ -405,6 +405,7 @@ struct rb_irq_work {struct irq_work work;wait_queue_head_t waiters;wait_queue_head_t full_waiters; +long wait_index;bool waiters_pending;bool full_waiters_pending;bool wakeup_full;
@@ -889,6 +890,37 @@ static void rb_wake_up_waiters(struct ir }/** +* ring_buffer_wake_waiters - wake up any waiters on this ring buffer +* @buffer: The ring buffer to wake waiters on +* +* In the case of a file that represents a ring buffer is closing, +* it is prudent to wake up any waiters that are on this. +*/ +void ring_buffer_wake_waiters (struct trace_buffer *buffer,int cpu) +{ +struct ring_buffer_per_cpu *cpu_buffer; +struct rb_irq_work *rbwork; + +if (cpu ==RING_BUFFER_ALL_CPUS ) { + +/* Wake up individual ones too. One level recursion */ +for_each_buffer_cpu (buffer, cpu) +ring_buffer_wake_waiters (buffer, cpu); + + rbwork = &buffer->irq_work; + }else { + cpu_buffer = buffer->buffers[cpu]; + rbwork = &cpu_buffer->irq_work; + } + + rbwork->wait_index++; +/* make sure the waiters see the new index */ +smp_wmb (); + +rb_wake_up_waiters (&rbwork->work); +} + +/** * ring_buffer_wait - wait for input to the ring buffer * @buffer: buffer to wait on * @cpu: the cpu buffer to wait on
@@ -903,6 +935,7 @@ int ring_buffer_wait(struct trace_bufferstruct ring_buffer_per_cpu *cpu_buffer;DEFINE_WAIT (wait);struct rb_irq_work *work; +long wait_index;int ret =0 ;/*
@@ -921,6 +954,7 @@ int ring_buffer_wait(struct trace_buffer work = &cpu_buffer->irq_work; } + wait_index =READ_ONCE (work->wait_index);while (true) {if (full)
@@ -985,6 +1019,11 @@ int ring_buffer_wait(struct trace_buffer }schedule (); + +/* Make sure to see the new wait index */ +smp_rmb (); +if (wait_index != work->wait_index) +break ; }if (full)
Greg Kroah-Hartman
maintainerPATCH 38/530 arm64: topology: move store_cpu_topology() to shared code
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
commit 456797da792fa7cbf6698febf275fe9b36691f78 upstream.
arm64's method of defining a default cpu topology requires only minimal changes to apply to RISC-V also. The current arm64 implementation exits early in a uniprocessor configuration by reading MPIDR & claiming that uniprocessor can rely on the default values.
This is appears to be a hangover from prior to '3102bc0e6ac7 ("arm64:
topology: Stop using MPIDR for topology information")', because the current code just assigns default values for multiprocessor systems.
With the MPIDR references removed, store_cpu_topolgy() can be moved to the common arch_topology code.
--- arch/arm64/kernel/topology.c | 40 ---------------------------------------- drivers/base/arch_topology.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 40 deletions(-)
arch/arm64/kernel/topology.c +0 -40
@@ -22,46 +22,6 @@#include <asm/cputype.h> #include <asm/topology.h> -void store_cpu_topology (unsigned int cpuid) -{ -struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; -u64 mpidr; - -if (cpuid_topo->package_id !=-1 ) - goto topology_populated; - - mpidr =read_cpuid_mpidr (); - -/* Uniprocessor systems can rely on default topology values */ -if (mpidr &MPIDR_UP_BITMASK ) -return ; - -/* -* This would be the place to create cpu topology based on MPIDR. -* -* However, it cannot be trusted to depict the actual topology; some -* pieces of the architecture enforce an artificial cap on Aff0 values -* (e.g. GICv3's ICC_SGI1R_EL1 limits it to 15), leading to an -* artificial cycling of Aff1, Aff2 and Aff3 values. IOW, these end up -* having absolutely no relationship to the actual underlying system -* topology, and cannot be reasonably used as core / package ID. -* -* If the MT bit is set, Aff0 *could* be used to define a thread ID, but -* we still wouldn't be able to obtain a sane core ID. This means we -* need to entirely ignore MPIDR for any topology deduction. -*/ - cpuid_topo->thread_id =-1 ; - cpuid_topo->core_id = cpuid; - cpuid_topo->package_id =cpu_to_node (cpuid); - -pr_debug ("CPU%u: cluster %d core %d thread %d mpidr %#016llx\n" , - cpuid, cpuid_topo->package_id, cpuid_topo->core_id, - cpuid_topo->thread_id, mpidr); - -topology_populated: -update_siblings_masks (cpuid); -} -#ifdef CONFIG_ACPI static bool __init acpi_cpu_is_threaded (int cpu) {
drivers/base/arch_topology.c +19 -0
@@ -690,4 +690,23 @@ void __init init_cpu_topology(void) else if (of_have_populated_dt() && parse_dt_topology()) reset_cpu_topology(); } + +void store_cpu_topology (unsigned int cpuid) +{ +struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; + +if (cpuid_topo->package_id !=-1 ) + goto topology_populated; + + cpuid_topo->thread_id =-1 ; + cpuid_topo->core_id = cpuid; + cpuid_topo->package_id =cpu_to_node (cpuid); + +pr_debug ("CPU%u: package %d core %d thread %d\n" , + cpuid, cpuid_topo->package_id, cpuid_topo->core_id, + cpuid_topo->thread_id); + +topology_populated: +update_siblings_masks (cpuid); +}#endif
Greg Kroah-Hartman
maintainerPATCH 41/530 parisc: fbdev/stifb: Align graphics memory size to 4MB
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit aca7c13d3bee81a968337a5515411409ae9d095d upstream.
Independend of the current graphics resolution, adjust the reported graphics card memory size to the next 4MB boundary.
This fixes the fbtest program which expects a naturally aligned size.
--- drivers/video/fbdev/stifb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/stifb.c +1 -1
@@ -1257,7 +1257,7 @@ static int __init stifb_init_fb(struct s/* limit fbsize to max visible screen size */ if (fix->smem_len > yres*fix->line_length) - fix->smem_len = yres*fix->line_length; + fix->smem_len =ALIGN (yres*fix->line_length,4 *1024 *1024 ); fix->accel =FB_ACCEL_NONE ;
Greg Kroah-Hartman
maintainerPATCH 30/530 HID: multitouch: Add memory barriers
In reply to Greg Kroah-HartmanFrom: Andri Yngvason <[email protected]>
commit be6e2b5734a425941fcdcdbd2a9337be498ce2cf upstream.
This fixes broken atomic checks which cause a race between the release-timer and processing of hid input.
I noticed that contacts were sometimes sticking, even with the "sticky fingers" quirk enabled. This fixes that problem.
--- drivers/hid/hid-multitouch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hid/hid-multitouch.c +4 -4
@@ -1186,7 +1186,7 @@ static void mt_touch_report(struct hid_dint contact_count =-1 ;/* sticky fingers release in progress, abort */ -if (test_and_set_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags)) +if (test_and_set_bit_lock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags))return ; scantime = *app->scantime;
@@ -1267,7 +1267,7 @@ static void mt_touch_report(struct hid_ddel_timer (&td->release_timer); } -clear_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); +clear_bit_unlock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); } static int mt_touch_input_configured(struct hid_device *hdev,
@@ -1702,11 +1702,11 @@ static void mt_expired_timeout(struct ti* An input report came in just before we release the sticky fingers, * it will take care of the sticky fingers. */ -if (test_and_set_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags)) +if (test_and_set_bit_lock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags))return ;if (test_bit (MT_IO_FLAGS_PENDING_SLOTS , &td->mt_io_flags))mt_release_contacts (hdev); -clear_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); +clear_bit_unlock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); }static int mt_probe (struct hid_device *hdev,const struct hid_device_id *id)
Greg Kroah-Hartman
maintainerPATCH 110/530 ring-buffer: Fix race between reset page and reading page
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit a0fcaaed0c46cf9399d3a2d6e0c87ddb3df0e044 upstream.
The ring buffer is broken up into sub buffers (currently of page size). Each sub buffer has a pointer to its "tail" (the last event written to the sub buffer). When a new event is requested, the tail is locally incremented to cover the size of the new event. This is done in a way that there is no need for locking.
If the tail goes past the end of the sub buffer, the process of moving to the next sub buffer takes place. After setting the current sub buffer to the next one, the previous one that had the tail go passed the end of the sub buffer needs to be reset back to the original tail location (before the new event was requested) and the rest of the sub buffer needs to be "padded".
The race happens when a reader takes control of the sub buffer. As readers do a "swap" of sub buffers from the ring buffer to get exclusive access to the sub buffer, it replaces the "head" sub buffer with an empty sub buffer that goes back into the writable portion of the ring buffer. This swap can happen as soon as the writer moves to the next sub buffer and before it updates the last sub buffer with padding.
Because the sub buffer can be released to the reader while the writer is still updating the padding, it is possible for the reader to see the event that goes past the end of the sub buffer. This can cause obvious issues.
To fix this, add a few memory barriers so that the reader definitely sees the updates to the sub buffer, and also waits until the writer has put back the "tail" of the sub buffer back to the last event that was written on it.
To be paranoid, it will only spin for 1 second, otherwise it will warn and shutdown the ring buffer code. 1 second should be enough as the writer does have preemption disabled. If the writer doesn't move within 1 second (with preemption disabled) something is horribly wrong. No interrupt should last 1 second!
--- kernel/trace/ring_buffer.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
kernel/trace/ring_buffer.c +33 -0
@@ -2612,6 +2612,9 @@ rb_reset_tail(struct ring_buffer_per_cpu/* Mark the rest of the page with padding */ rb_event_set_padding (event); +/* Make sure the padding is visible before the write update */ +smp_wmb (); +/* Set the write back to the previous setting */ local_sub (length, &tail_page->write);return ;
@@ -2623,6 +2626,9 @@ rb_reset_tail(struct ring_buffer_per_cpu/* time delta must be non zero */ event->time_delta =1 ; +/* Make sure the padding is visible before the tail_page->write update */ +smp_wmb (); +/* Set write to end of buffer */ length = (tail + length) -BUF_PAGE_SIZE ;local_sub (length, &tail_page->write);
@@ -4587,6 +4593,33 @@ rb_get_reader_page(struct ring_buffer_pearch_spin_unlock (&cpu_buffer->lock);local_irq_restore (flags); +/* +* The writer has preempt disable, wait for it. But not forever +* Although, 1 second is pretty much "forever" +*/ +#define USECS_WAIT 1000000 +for (nr_loops =0 ; nr_loops <USECS_WAIT ; nr_loops++) { +/* If the write is past the end of page, a writer is still updating it */ +if (likely (!reader ||rb_page_write (reader) <=BUF_PAGE_SIZE )) +break ; + +udelay (1 ); + +/* Get the latest version of the reader write value */ +smp_rmb (); + } + +/* The writer is not moving forward? Something is wrong */ +if (RB_WARN_ON (cpu_buffer, nr_loops ==USECS_WAIT )) + reader =NULL ; + +/* +* Make sure we see any padding after the write update +* (see rb_reset_tail()) +*/ +smp_rmb (); + +return reader; }
Greg Kroah-Hartman
maintainerPATCH 121/530 media: cedrus: Fix endless loop in cedrus_h265_skip_bits()
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit 91db7a3fc7fe670cf1770a398a43bb4a1f776bf1 upstream.
The busy status bit may never de-assert if number of programmed skip bits is incorrect, resulting in a kernel hang because the bit is polled endlessly in the code. Fix it by adding timeout for the bit-polling. This problem is reproducible by setting the data_bit_offset field of the HEVC slice params to a wrong value by userspace.
--- drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/media/sunxi/cedrus/cedrus_h265.c +3 -2
@@ -234,8 +234,9 @@ static void cedrus_h265_skip_bits(structcedrus_write (dev,VE_DEC_H265_TRIGGER ,VE_DEC_H265_TRIGGER_FLUSH_BITS |VE_DEC_H265_TRIGGER_TYPE_N_BITS (tmp)); -while (cedrus_read (dev,VE_DEC_H265_STATUS ) &VE_DEC_H265_STATUS_VLD_BUSY ) -udelay (1 ); + +if (cedrus_wait_for (dev,VE_DEC_H265_STATUS ,VE_DEC_H265_STATUS_VLD_BUSY )) +dev_err_ratelimited (dev->dev,"timed out waiting to skip bits\n" ); count += tmp; }
Greg Kroah-Hartman
maintainerPATCH 111/530 tracing: Disable interrupt or preemption before acquiring arch_spinlock_t
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
commit c0a581d7126c0bbc96163276f585fd7b4e4d8d0e upstream.
It was found that some tracing functions in kernel/trace/trace.c acquire an arch_spinlock_t with preemption and irqs enabled. An example is the tracing_saved_cmdlines_size_read() function which intermittently causes a "BUG: using smp_processor_id() in preemptible" warning when the LTP read_all_proc test is run.
That can be problematic in case preemption happens after acquiring the lock. Add the necessary preemption or interrupt disabling code in the appropriate places before acquiring an arch_spinlock_t.
The convention here is to disable preemption for trace_cmdline_lock and interupt for max_lock.
--- kernel/trace/trace.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
kernel/trace/trace.c +23 -0
@@ -1181,12 +1181,14 @@ void *tracing_cond_snapshot_data(struct {void *cond_data =NULL ; +local_irq_disable ();arch_spin_lock (&tr->max_lock);if (tr->cond_snapshot) cond_data = tr->cond_snapshot->cond_data;arch_spin_unlock (&tr->max_lock); +local_irq_enable ();return cond_data; }
@@ -1322,9 +1324,11 @@ int tracing_snapshot_cond_enable(struct goto fail_unlock; } +local_irq_disable ();arch_spin_lock (&tr->max_lock); tr->cond_snapshot = cond_snapshot;arch_spin_unlock (&tr->max_lock); +local_irq_enable ();mutex_unlock (&trace_types_lock);
@@ -1351,6 +1355,7 @@ int tracing_snapshot_cond_disable(struct {int ret =0 ; +local_irq_disable ();arch_spin_lock (&tr->max_lock);if (!tr->cond_snapshot)
@@ -1361,6 +1366,7 @@ int tracing_snapshot_cond_disable(struct }arch_spin_unlock (&tr->max_lock); +local_irq_enable ();return ret; }
@@ -2187,6 +2193,11 @@ static size_t tgid_map_max;#define SAVED_CMDLINES_DEFAULT 128#define NO_CMDLINE_MAP UINT_MAX +/* +* Preemption must be disabled before acquiring trace_cmdline_lock. +* The various trace_arrays' max_lock must be acquired in a context +* where interrupt is disabled. +*/ static arch_spinlock_t trace_cmdline_lock = __ARCH_SPIN_LOCK_UNLOCKED;struct saved_cmdlines_buffer {unsigned map_pid_to_cmdline[PID_MAX_DEFAULT +1 ];
@@ -2399,7 +2410,11 @@ static int trace_save_cmdline(struct tas* the lock, but we also don't want to spin * nor do we want to disable interrupts, * so if we miss here, then better luck next time. +* +* This is called within the scheduler and wake up, so interrupts +* had better been disabled and run queue lock been held. */ +lockdep_assert_preemption_disabled ();if (!arch_spin_trylock (&trace_cmdline_lock))return 0 ;
@@ -5861,9 +5876,11 @@ tracing_saved_cmdlines_size_read(structchar buf[64 ];int r; +preempt_disable ();arch_spin_lock (&trace_cmdline_lock); r =scnprintf (buf,sizeof (buf),"%u\n" , savedcmd->cmdline_num);arch_spin_unlock (&trace_cmdline_lock); +preempt_enable ();return simple_read_from_buffer (ubuf, cnt, ppos, buf, r); }
@@ -5888,10 +5905,12 @@ static int tracing_resize_saved_cmdlinesreturn -ENOMEM ; } +preempt_disable ();arch_spin_lock (&trace_cmdline_lock); savedcmd_temp = savedcmd; savedcmd = s;arch_spin_unlock (&trace_cmdline_lock); +preempt_enable ();free_saved_cmdlines_buffer (savedcmd_temp);return 0 ;
@@ -6344,10 +6363,12 @@ int tracing_set_tracer(struct trace_arra#ifdef CONFIG_TRACER_SNAPSHOT if (t->use_max_tr) { +local_irq_disable ();arch_spin_lock (&tr->max_lock);if (tr->cond_snapshot) ret = -EBUSY ;arch_spin_unlock (&tr->max_lock); +local_irq_enable ();if (ret) goto out; }
@@ -7420,10 +7441,12 @@ tracing_snapshot_write(struct file *filp goto out; } +local_irq_disable ();arch_spin_lock (&tr->max_lock);if (tr->cond_snapshot) ret = -EBUSY ;arch_spin_unlock (&tr->max_lock); +local_irq_enable ();if (ret) goto out;
Greg Kroah-Hartman
maintainerPATCH 100/530 ext4: fix miss release buffer head in ext4_fc_write_inode
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit ccbf8eeb39f2ff00b54726a2b20b35d788c4ecb5 upstream.
In 'ext4_fc_write_inode' function first call 'ext4_get_inode_loc' get 'iloc', after use it miss release 'iloc.bh'.
So just release 'iloc.bh' before 'ext4_fc_write_inode' return.
--- fs/ext4/fast_commit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
fs/ext4/fast_commit.c +9 -6
@@ -794,22 +794,25 @@ static int ext4_fc_write_inode(struct in tl.fc_tag =cpu_to_le16 (EXT4_FC_TAG_INODE ); tl.fc_len =cpu_to_le16 (inode_len +sizeof (fc_inode.fc_ino)); + ret = -ECANCELED ; dst =ext4_fc_reserve_space (inode->i_sb,sizeof (tl) + inode_len +sizeof (fc_inode.fc_ino), crc);if (!dst) -return -ECANCELED ; + goto err;if (!ext4_fc_memcpy (inode->i_sb, dst, &tl,sizeof (tl), crc)) -return -ECANCELED ; + goto err; dst +=sizeof (tl);if (!ext4_fc_memcpy (inode->i_sb, dst, &fc_inode,sizeof (fc_inode), crc)) -return -ECANCELED ; + goto err; dst +=sizeof (fc_inode);if (!ext4_fc_memcpy (inode->i_sb, dst, (u8 *)ext4_raw_inode (&iloc), inode_len, crc)) -return -ECANCELED ; - -return 0 ; + goto err; + ret =0 ; +err: +brelse (iloc.bh); +return ret; }/*
Greg Kroah-Hartman
maintainerPATCH 97/530 ext4: ext4_read_bh_lock() should submit IO if the buffer isnt uptodate
In reply to Greg Kroah-HartmanFrom: Zhang Yi <[email protected]>
commit 0b73284c564d3ae4feef4bc920292f004acf4980 upstream.
Recently we notice that ext4 filesystem would occasionally fail to read metadata from disk and report error message, but the disk and block layer looks fine. After analyse, we lockon commit 88dbcbb3a484 ("blkdev: avoid migration stalls for blkdev pages"). It provide a migration method for the bdev, we could move page that has buffers without extra users now, but it lock the buffers on the page, which breaks the fragile metadata read operation on ext4 filesystem, ext4_read_bh_lock() was copied from ll_rw_block(), it depends on the assumption of that locked buffer means it is under IO. So it just trylock the buffer and skip submit IO if it lock failed, after wait_on_buffer() we conclude IO error because the buffer is not uptodate.
This issue could be easily reproduced by add some delay just after buffer_migrate_lock_buffers() in __buffer_migrate_folio() and do fsstress on ext4 filesystem.
EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #73193:
comm fsstress: reading directory lblock 0
EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #75334:
comm fsstress: reading directory lblock 0
Fix it by removing the trylock logic in ext4_read_bh_lock(), just lock the buffer and submit IO if it's not uptodate, and also leave over readahead helper.
--- fs/ext4/super.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
fs/ext4/super.c +5 -11
@@ -186,19 +186,12 @@ int ext4_read_bh(struct buffer_head *bh,int ext4_read_bh_lock (struct buffer_head *bh,int op_flags,bool wait) { -if (trylock_buffer (bh)) { -if (wait) -return ext4_read_bh (bh, op_flags,NULL ); +lock_buffer (bh); +if (!wait) {ext4_read_bh_nowait (bh, op_flags,NULL );return 0 ; } -if (wait) { -wait_on_buffer (bh); -if (buffer_uptodate (bh)) -return 0 ; -return -EIO ; - } -return 0 ; +return ext4_read_bh (bh, op_flags,NULL ); }/*
@@ -245,7 +238,8 @@ void ext4_sb_breadahead_unmovable(structstruct buffer_head *bh =sb_getblk_gfp (sb, block,0 );if (likely (bh)) { -ext4_read_bh_lock (bh,REQ_RAHEAD , false); +if (trylock_buffer (bh)) +ext4_read_bh_nowait (bh,REQ_RAHEAD ,NULL );brelse (bh); } }
Greg Kroah-Hartman
maintainerPATCH 115/530 tracing: Move duplicate code of trace_kprobe/eprobe.c into header
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit f1d3cbfaafc10464550c6d3a125f4fc802bbaed5 upstream.
The functions:
fetch_store_strlen_user()
fetch_store_strlen()
fetch_store_string_user()
fetch_store_string()
are identical in both trace_kprobe.c and trace_eprobe.c. Move them into a new header file trace_probe_kernel.h to share it. This code will later be used by the synthetic events as well.
Marked for stable as a fix for a crash in synthetic events requires it.
--- kernel/trace/trace_eprobe.c | 60 +---------------------- kernel/trace/trace_kprobe.c | 60 +---------------------- kernel/trace/trace_probe_kernel.h | 96 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 110 deletions(-) create mode 100644 kernel/trace/trace_probe_kernel.h
kernel/trace/trace_eprobe.c +5 -55
@@ -16,6 +16,7 @@#include "trace_dynevent.h" #include "trace_probe.h" #include "trace_probe_tmpl.h" +#include "trace_probe_kernel.h" #define EPROBE_EVENT_SYSTEM "eprobes"
@@ -447,29 +448,14 @@ NOKPROBE_SYMBOL(process_fetch_insn) static nokprobe_inline intfetch_store_strlen_user (unsigned long addr) { -const void __user *uaddr = (__force const void __user *)addr; - -return strnlen_user_nofault (uaddr,MAX_STRING_SIZE ); +return kern_fetch_store_strlen_user (addr); }/* Return the length of string -- including null terminal byte */ static nokprobe_inline intfetch_store_strlen (unsigned long addr) { -int ret, len =0 ; -u8 c; - -#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE -if (addr <TASK_SIZE ) -return fetch_store_strlen_user (addr); -#endif - -do { - ret =copy_from_kernel_nofault (&c, (u8 *)addr + len,1 ); - len++; - }while (c && ret ==0 && len <MAX_STRING_SIZE ); - -return (ret <0 ) ? ret : len; +return kern_fetch_store_strlen (addr); }/*
@@ -479,21 +465,7 @@ fetch_store_strlen(unsigned long addr) static nokprobe_inline intfetch_store_string_user (unsigned long addr,void *dest,void *base) { -const void __user *uaddr = (__force const void __user *)addr; -int maxlen =get_loc_len (*(u32 *)dest); -void *__dest; -long ret; - -if (unlikely (!maxlen)) -return -ENOMEM ; - - __dest =get_loc_data (dest, base); - - ret =strncpy_from_user_nofault (__dest, uaddr, maxlen); -if (ret >=0 ) - *(u32 *)dest =make_data_loc (ret, __dest - base); - -return ret; +return kern_fetch_store_string_user (addr, dest, base); }/*
@@ -503,29 +475,7 @@ fetch_store_string_user(unsigned long ad static nokprobe_inline intfetch_store_string (unsigned long addr,void *dest,void *base) { -int maxlen =get_loc_len (*(u32 *)dest); -void *__dest; -long ret; - -#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE -if ((unsigned long )addr <TASK_SIZE ) -return fetch_store_string_user (addr, dest, base); -#endif - -if (unlikely (!maxlen)) -return -ENOMEM ; - - __dest =get_loc_data (dest, base); - -/* -* Try to get string again, since the string can be changed while -* probing. -*/ - ret =strncpy_from_kernel_nofault (__dest, (void *)addr, maxlen); -if (ret >=0 ) - *(u32 *)dest =make_data_loc (ret, __dest - base); - -return ret; +return kern_fetch_store_string (addr, dest, base); }static nokprobe_inline int
kernel/trace/trace_kprobe.c +5 -55
90 lines not on this page · raw message
kernel/trace/trace_probe_kernel.h new file +96 -0
96 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 118/530 thunderbolt: Explicitly enable lane adapter hotplug events at startup
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
commit 5d2569cb4a65c373896ec0217febdf88739ed295 upstream.
Software that has run before the USB4 CM in Linux runs may have disabled hotplug events for a given lane adapter.
Other CMs such as that one distributed with Windows 11 will enable hotplug events. Do the same thing in the Linux CM which fixes hotplug events on "AMD Pink Sardine".
--- drivers/thunderbolt/switch.c | 24 ++++++++++++++++++++++++ drivers/thunderbolt/tb.h | 1 + drivers/thunderbolt/tb_regs.h | 1 + drivers/thunderbolt/usb4.c | 20 ++++++++++++++++++++ 4 files changed, 46 insertions(+)
drivers/thunderbolt/switch.c +24 -0
@@ -2690,6 +2690,26 @@ static void tb_switch_credits_init(structb_sw_info (sw,"failed to determine preferred buffer allocation, using defaults\n" ); } +static int tb_switch_port_hotplug_enable (struct tb_switch *sw) +{ +struct tb_port *port; + +if (tb_switch_is_icm (sw)) +return 0 ; + +tb_switch_for_each_port (sw, port) { +int res; + +if (!port->cap_usb4) +continue ; + + res =usb4_port_hotplug_enable (port); +if (res) +return res; + } +return 0 ; +} +/** * tb_switch_add() - Add a switch to the domain * @sw: Switch to add
@@ -2761,6 +2781,10 @@ int tb_switch_add(struct tb_switch *sw)return ret; } + ret =tb_switch_port_hotplug_enable (sw); +if (ret) +return ret; + ret =device_add (&sw->dev);if (ret) {dev_err (&sw->dev,"failed to add device: %d\n" , ret);
drivers/thunderbolt/tb.h +1 -0
@@ -1067,6 +1067,7 @@ int usb4_switch_add_ports(struct tb_switvoid usb4_switch_remove_ports (struct tb_switch *sw);int usb4_port_unlock (struct tb_port *port); +int usb4_port_hotplug_enable (struct tb_port *port);int usb4_port_configure (struct tb_port *port);void usb4_port_unconfigure (struct tb_port *port);int usb4_port_configure_xdomain (struct tb_port *port);
drivers/thunderbolt/tb_regs.h +1 -0
@@ -301,6 +301,7 @@ struct tb_regs_port_header {#define ADP_CS_5 0x05#define ADP_CS_5_LCA_MASK GENMASK(28, 22)#define ADP_CS_5_LCA_SHIFT 22 +#define ADP_CS_5_DHP BIT(31)/* TMU adapter registers */ #define TMU_ADP_CS_3 0x03
drivers/thunderbolt/usb4.c +20 -0
@@ -1068,6 +1068,26 @@ int usb4_port_unlock(struct tb_port *porreturn tb_port_write (port, &val,TB_CFG_PORT ,ADP_CS_4 ,1 ); } +/** +* usb4_port_hotplug_enable() - Enables hotplug for a port +* @port: USB4 port to operate on +* +* Enables hot plug events on a given port. This is only intended +* to be used on lane, DP-IN, and DP-OUT adapters. +*/ +int usb4_port_hotplug_enable (struct tb_port *port) +{ +int ret; +u32 val; + + ret =tb_port_read (port, &val,TB_CFG_PORT ,ADP_CS_5 ,1 ); +if (ret) +return ret; + + val &= ~ADP_CS_5_DHP ; +return tb_port_write (port, &val,TB_CFG_PORT ,ADP_CS_5 ,1 ); +} +static int usb4_port_set_configured (struct tb_port *port,bool configured) {int ret;
Greg Kroah-Hartman
maintainerPATCH 127/530 staging: greybus: audio_helper: remove unused and wrong debugfs usage
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
commit d517cdeb904ddc0cbebcc959d43596426cac40b0 upstream.
In the greybus audio_helper code, the debugfs file for the dapm has the potential to be removed and memory will be leaked. There is also the very real potential for this code to remove ALL debugfs entries from the system, and it seems like this is what will really happen if this code ever runs. This all is very wrong as the greybus audio driver did not create this debugfs file, the sound core did and controls the lifespan of it.
So remove all of the debugfs logic from the audio_helper code as there's no way it could be correct. If this really is needed, it can come back with a fixup for the incorrect usage of the debugfs_lookup() call which is what caused this to be noticed at all.
--- drivers/staging/greybus/audio_helper.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/staging/greybus/audio_helper.c +0 -11
@@ -3,7 +3,6 @@* Greybus Audio Sound SoC helper APIs */ -#include <linux/debugfs.h> #include <sound/core.h> #include <sound/soc.h> #include <sound/soc-dapm.h>
@@ -116,10 +115,6 @@ int gbaudio_dapm_free_controls(struct sn {int i;struct snd_soc_dapm_widget *w, *next_w; -#ifdef CONFIG_DEBUG_FS -struct dentry *parent = dapm->debugfs_dapm; -struct dentry *debugfs_w =NULL ; -#endif mutex_lock (&dapm->card->dapm_mutex);for (i =0 ; i < num; i++) {
@@ -139,12 +134,6 @@ int gbaudio_dapm_free_controls(struct sncontinue ; } widget++; -#ifdef CONFIG_DEBUG_FS -if (!parent) - debugfs_w =debugfs_lookup (w->name, parent); -debugfs_remove (debugfs_w); - debugfs_w =NULL ; -#endif gbaudio_dapm_free_widget (w); }mutex_unlock (&dapm->card->dapm_mutex);
Greg Kroah-Hartman
maintainerPATCH 101/530 ext4: fix potential memory leak in ext4_fc_record_modified_inode()
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 9305721a309fa1bd7c194e0d4a2335bf3b29dca4 upstream.
As krealloc may return NULL, in this case 'state->fc_modified_inodes' may not be freed by krealloc, but 'state->fc_modified_inodes' already set NULL. Then will lead to 'state->fc_modified_inodes' memory leak.
--- fs/ext4/fast_commit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/ext4/fast_commit.c +5 -3
@@ -1414,13 +1414,15 @@ static int ext4_fc_record_modified_inodeif (state->fc_modified_inodes[i] == ino)return 0 ;if (state->fc_modified_inodes_used == state->fc_modified_inodes_size) { - state->fc_modified_inodes =krealloc ( - state->fc_modified_inodes, +int *fc_modified_inodes; + + fc_modified_inodes =krealloc (state->fc_modified_inodes,sizeof (int ) * (state->fc_modified_inodes_size +EXT4_FC_REPLAY_REALLOC_INCREMENT ),GFP_KERNEL ); -if (!state->fc_modified_inodes) +if (!fc_modified_inodes)return -ENOMEM ; + state->fc_modified_inodes = fc_modified_inodes; state->fc_modified_inodes_size +=EXT4_FC_REPLAY_REALLOC_INCREMENT ; }
Greg Kroah-Hartman
maintainerPATCH 122/530 blk-wbt: call rq_qos_add() after wb_normal is initialized
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
commit 8c5035dfbb9475b67c82b3fdb7351236525bf52b upstream.
Our test found a problem that wbt inflight counter is negative, which will cause io hang(noted that this problem doesn't exist in mainline):
t1: device create t2: issue ioadd_disk
blk_register_queue
wbt_enable_default
wbt_init
rq_qos_add
// wb_normal is still 0
/*
* in mainline, disk can't be opened before
* bdev_add(), however, in old kernels, disk
* can be opened before blk_register_queue().
*/
blkdev_issue_flush
// disk size is 0, however, it's not checked
submit_bio_wait
submit_bio
blk_mq_submit_bio
rq_qos_throttle
wbt_wait
bio_to_wbt_flags
rwb_enabled
// wb_normal is 0, inflight is not increased
wbt_queue_depth_changed(&rwb->rqos);
wbt_update_limits
// wb_normal is initialized
rq_qos_track
wbt_track
rq->wbt_flags |= bio_to_wbt_flags(rwb, bio);
// wb_normal is not 0,wbt_flags will be sett3: io completionblk_mq_free_request
rq_qos_done
wbt_done
wbt_is_tracked
// return true
__wbt_done
wbt_rqw_done
atomic_dec_return(&rqw->inflight);
// inflight is decreasedcommit 8235b5c1e8c1 ("block: call bdev_add later in device_add_disk") can avoid this problem, however it's better to fix this problem in wbt:
1) Lower kernel can't backport this patch due to lots of refactor.
2) Root cause is that wbt call rq_qos_add() before wb_normal is initialized.
--- block/blk-wbt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
block/blk-wbt.c +4 -5
@@ -843,6 +843,10 @@ int wbt_init(struct request_queue *q) rwb->enable_state =WBT_STATE_ON_DEFAULT ; rwb->wc =1 ; rwb->rq_depth.default_depth =RWB_DEF_DEPTH ; + rwb->min_lat_nsec =wbt_default_latency_nsec (q); + +wbt_queue_depth_changed (&rwb->rqos); +wbt_set_write_cache (q,test_bit (QUEUE_FLAG_WC , &q->queue_flags));/* * Assign rwb and add the stats callback.
@@ -853,11 +857,6 @@ int wbt_init(struct request_queue *q)blk_stat_add_callback (q, rwb->cb); - rwb->min_lat_nsec =wbt_default_latency_nsec (q); - -wbt_queue_depth_changed (&rwb->rqos); -wbt_set_write_cache (q,test_bit (QUEUE_FLAG_WC , &q->queue_flags)); -return 0 ; err_free:
Greg Kroah-Hartman
maintainerPATCH 104/530 livepatch: fix race between fork and KLP transition
In reply to Greg Kroah-HartmanFrom: Rik van Riel <[email protected]>
commit 747f7a2901174c9afa805dddfb7b24db6f65e985 upstream.
The KLP transition code depends on the TIF_PATCH_PENDING and the task->patch_state to stay in sync. On a normal (forward) transition, TIF_PATCH_PENDING will be set on every task in the system, while on a reverse transition (after a failed forward one) first TIF_PATCH_PENDING will be cleared from every task, followed by it being set on tasks that need to be transitioned back to the original code.
However, the fork code copies over the TIF_PATCH_PENDING flag from the parent to the child early on, in dup_task_struct and setup_thread_stack. Much later, klp_copy_process will set child->patch_state to match that of the parent.
However, the parent's patch_state may have been changed by KLP loading or unloading since it was initially copied over into the child.
This results in the KLP code occasionally hitting this warning in klp_complete_transition:
for_each_process_thread(g, task) {
WARN_ON_ONCE(test_tsk_thread_flag(task, TIF_PATCH_PENDING));
task->patch_state = KLP_UNDEFINED;
}Set, or clear, the TIF_PATCH_PENDING flag in the child task depending on whether or not it is needed at the time klp_copy_process is called, at a point in copy_process where the tasklist_lock is held exclusively, preventing races with the KLP code.
The KLP code does have a few places where the state is changed without the tasklist_lock held, but those should not cause problems because klp_update_patch_state(current) cannot be called while the current task is in the middle of fork, klp_check_and_switch_task() which is called under the pi_lock, which prevents rescheduling, and manipulation of the patch state of idle tasks, which do not fork.
This should prevent this warning from triggering again in the future, and close the race for both normal and reverse transitions.
--- kernel/livepatch/transition.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
kernel/livepatch/transition.c +16 -2
@@ -610,9 +610,23 @@ void klp_reverse_transition(void)/* Called from copy_process() during fork */ void klp_copy_process (struct task_struct *child) { - child->patch_state = current->patch_state; -/* TIF_PATCH_PENDING gets copied in setup_thread_stack() */ +/* +* The parent process may have gone through a KLP transition since +* the thread flag was copied in setup_thread_stack earlier. Bring +* the task flag up to date with the parent here. +* +* The operation is serialized against all klp_*_transition() +* operations by the tasklist_lock. The only exception is +* klp_update_patch_state(current), but we cannot race with +* that because we are current. +*/ +if (test_tsk_thread_flag (current,TIF_PATCH_PENDING )) +set_tsk_thread_flag (child,TIF_PATCH_PENDING ); +else +clear_tsk_thread_flag (child,TIF_PATCH_PENDING ); + + child->patch_state = current->patch_state; }/*
Greg Kroah-Hartman
maintainerPATCH 95/530 ext4: fix check for block being out of directory size
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 61a1d87a324ad5e3ed27c6699dfc93218fcf3201 upstream.
The check in __ext4_read_dirblock() for block being outside of directory size was wrong because it compared block number against directory size in bytes. Fix it.
CVE: CVE-2022-1184
--- fs/ext4/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/namei.c +1 -1
@@ -126,7 +126,7 @@ static struct buffer_head *__ext4_read_dstruct ext4_dir_entry *dirent;int is_dx_block =0 ; -if (block >= inode->i_size) { +if (block >= inode->i_size >> inode->i_blkbits) {ext4_error_inode (inode, func, line, block,"Attempting to read directory block (%u) that is past i_size (%llu)" , block, inode->i_size);
Greg Kroah-Hartman
maintainerPATCH 145/530 objtool: Preserve special st_shndx indexes in elf_update_symbol
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
[ Upstream commit 5141d3a06b2da1731ac82091298b766a1f95d3d8 ]
elf_update_symbol fails to preserve the special st_shndx values between [SHN_LORESERVE, SHN_HIRESERVE], which results in it converting SHN_ABS entries into SHN_UNDEF, for example. Explicitly check for the special indexes and ensure these symbols are not marked undefined.
--- tools/objtool/elf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/objtool/elf.c +6 -1
@@ -555,6 +555,11 @@ static int elf_update_symbol(struct elf *elf, struct section *symtab,Elf64_Xword entsize = symtab->sh.sh_entsize;int max_idx, idx = sym->idx;Elf_Scn *s, *t =NULL ; +bool is_special_shndx = sym->sym.st_shndx >=SHN_LORESERVE && + sym->sym.st_shndx !=SHN_XINDEX ; + +if (is_special_shndx) + shndx = sym->sym.st_shndx; s =elf_getscn (elf->elf, symtab->idx);if (!s) {
@@ -640,7 +645,7 @@ static int elf_update_symbol(struct elf *elf, struct section *symtab, }/* setup extended section index magic and write the symbol */ -if (shndx >=SHN_UNDEF && shndx <SHN_LORESERVE ) { +if ((shndx >=SHN_UNDEF && shndx <SHN_LORESERVE ) || is_special_shndx) { sym->sym.st_shndx = shndx;if (!shndx_data) shndx =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/530 wifi: rtlwifi: 8192de: correct checking of IQK reload
In reply to Greg Kroah-HartmanFrom: Ping-Ke Shih <[email protected]>
[ Upstream commit 93fbc1ebd978cf408ef5765e9c1630fce9a8621b ]
Since IQK could spend time, we make a cache of IQK result matrix that looks like iqk_matrix[channel_idx].val[x][y], and we can reload the matrix if we have made a cache. To determine a cache is made, we check iqk_matrix[channel_idx].val[0][0].
The initial commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") make a mistake that checks incorrect iqk_matrix[channel_idx].val[0] that is always true, and this mistake is found by commit ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12"), so I recall the vendor driver to find fix and apply the correctness.
--- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +4 -5
@@ -2386,11 +2386,10 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)rtl_dbg (rtlpriv,COMP_SCAN ,DBG_LOUD ,"Just Read IQK Matrix reg for channel:%d....\n" , channel); -_rtl92d_phy_patha_fill_iqk_matrix (hw, true, - rtlphy->iqk_matrix[ - indexforchannel].value,0 , - (rtlphy->iqk_matrix[ - indexforchannel].value[0 ][2 ] ==0 )); +if (rtlphy->iqk_matrix[indexforchannel].value[0 ][0 ] !=0 ) +_rtl92d_phy_patha_fill_iqk_matrix (hw, true, + rtlphy->iqk_matrix[indexforchannel].value,0 , + rtlphy->iqk_matrix[indexforchannel].value[0 ][2 ] ==0 );if (IS_92D_SINGLEPHY (rtlhal->version)) {if ((rtlphy->iqk_matrix[ indexforchannel].value[0][4] != 0)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 152/530 wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
In reply to Greg Kroah-HartmanFrom: Wen Gong <[email protected]>
[ Upstream commit f020d9570a04df0762a2ac5c50cf1d8c511c9164 ]
When peer delete failed in a disconnect operation, use-after-free detected by KFENCE in below log. It is because for each vdev_id and address, it has only one struct ath10k_peer, it is allocated in ath10k_peer_map_event(). When connected to an AP, it has more than one HTT_T2H_MSG_TYPE_PEER_MAP reported from firmware, then the array peer_map of struct ath10k will be set muti-elements to the same ath10k_peer in ath10k_peer_map_event(). When peer delete failed in ath10k_sta_state(), the ath10k_peer will be free for the 1st peer id in array peer_map of struct ath10k, and then use-after-free happened for the 2nd peer id because they map to the same ath10k_peer.
And clean up all peers in array peer_map for the ath10k_peer, then user-after-free disappeared
peer map event log:
[ 306.911021] wlan0: authenticate with b0:2a:43:e6:75:0e [ 306.957187] ath10k_pci 0000:01:00.0: mac vdev 0 peer create b0:2a:43:e6:75:0e (new sta) sta 1 / 32 peer 1 / 33 [ 306.957395] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 306.957404] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 306.986924] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 166
peer unmap event log:
[ 435.715691] wlan0: deauthenticating from b0:2a:43:e6:75:0e by local choice (Reason: 3=DEAUTH_LEAVING) [ 435.716802] ath10k_pci 0000:01:00.0: mac vdev 0 peer delete b0:2a:43:e6:75:0e sta ffff990e0e9c2b50 (sta gone) [ 435.717177] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 435.717186] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 435.717193] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 166
use-after-free log:
[21705.888627] wlan0: deauthenticating from d0:76:8f:82:be:75 by local choice (Reason: 3=DEAUTH_LEAVING) [21713.799910] ath10k_pci 0000:01:00.0: failed to delete peer d0:76:8f:82:be:75 for vdev 0: -110 [21713.799925] ath10k_pci 0000:01:00.0: found sta peer d0:76:8f:82:be:75 (ptr 0000000000000000 id 102) entry on vdev 0 after it was supposedly removed [21713.799968] ================================================================== [21713.799991] BUG: KFENCE: use-after-free read in ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.799991] [21713.799997] Use-after-free read at 0x00000000abe1c75e (in kfence-#69): [21713.800010] ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.800041] drv_sta_state+0x115/0x677 [mac80211] [21713.800059] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800076] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800093] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800110] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800137] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800153] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800161] genl_rcv_msg+0x38e/0x3be [21713.800166] netlink_rcv_skb+0x89/0xf7 [21713.800171] genl_rcv+0x28/0x36 [21713.800176] netlink_unicast+0x179/0x24b [21713.800181] netlink_sendmsg+0x3a0/0x40e [21713.800187] sock_sendmsg+0x72/0x76 [21713.800192] ____sys_sendmsg+0x16d/0x1e3 [21713.800196] ___sys_sendmsg+0x95/0xd1 [21713.800200] __sys_sendmsg+0x85/0xbf [21713.800205] do_syscall_64+0x43/0x55 [21713.800210] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [21713.800213] [21713.800219] kfence-#69: 0x000000009149b0d5-0x000000004c0697fb, size=1064, cache=kmalloc-2k [21713.800219] [21713.800224] allocated by task 13 on cpu 0 at 21705.501373s: [21713.800241] ath10k_peer_map_event+0x7e/0x154 [ath10k_core] [21713.800254] ath10k_htt_t2h_msg_handler+0x586/0x1039 [ath10k_core] [21713.800265] ath10k_htt_htc_t2h_msg_handler+0x12/0x28 [ath10k_core] [21713.800277] ath10k_htc_rx_completion_handler+0x14c/0x1b5 [ath10k_core] [21713.800283] ath10k_pci_process_rx_cb+0x195/0x1df [ath10k_pci] [21713.800294] ath10k_ce_per_engine_service+0x55/0x74 [ath10k_core] [21713.800305] ath10k_ce_per_engine_service_any+0x76/0x84 [ath10k_core] [21713.800310] ath10k_pci_napi_poll+0x49/0x144 [ath10k_pci] [21713.800316] net_rx_action+0xdc/0x361 [21713.800320] __do_softirq+0x163/0x29a [21713.800325] asm_call_irq_on_stack+0x12/0x20 [21713.800331] do_softirq_own_stack+0x3c/0x48 [21713.800337] __irq_exit_rcu+0x9b/0x9d [21713.800342] common_interrupt+0xc9/0x14d [21713.800346] asm_common_interrupt+0x1e/0x40 [21713.800351] ksoftirqd_should_run+0x5/0x16 [21713.800357] smpboot_thread_fn+0x148/0x211 [21713.800362] kthread+0x150/0x15f [21713.800367] ret_from_fork+0x22/0x30 [21713.800370] [21713.800374] freed by task 708 on cpu 1 at 21713.799953s: [21713.800498] ath10k_sta_state+0x2c6/0xb8a [ath10k_core] [21713.800515] drv_sta_state+0x115/0x677 [mac80211] [21713.800532] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800548] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800565] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800581] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800598] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800614] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800619] genl_rcv_msg+0x38e/0x3be [21713.800623] netlink_rcv_skb+0x89/0xf7 [21713.800628] genl_rcv+0x28/0x36 [21713.800632] netlink_unicast+0x179/0x24b [21713.800637] netlink_sendmsg+0x3a0/0x40e [21713.800642] sock_sendmsg+0x72/0x76 [21713.800646] ____sys_sendmsg+0x16d/0x1e3 [21713.800651] ___sys_sendmsg+0x95/0xd1 [21713.800655] __sys_sendmsg+0x85/0xbf [21713.800659] do_syscall_64+0x43/0x55 [21713.800663] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1
--- drivers/net/wireless/ath/ath10k/mac.c | 54 ++++++++++++++------------- 1 file changed, 29 insertions(+), 25 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +29 -25
@@ -864,11 +864,36 @@ static int ath10k_peer_delete(struct ath10k *ar, u32 vdev_id, const u8 *addr)return 0 ; } +static void ath10k_peer_map_cleanup (struct ath10k *ar,struct ath10k_peer *peer) +{ +int peer_id, i; + +lockdep_assert_held (&ar->conf_mutex); + +for_each_set_bit (peer_id, peer->peer_ids, +ATH10K_MAX_NUM_PEER_IDS ) { + ar->peer_map[peer_id] =NULL ; + } + +/* Double check that peer is properly un-referenced from +* the peer_map +*/ +for (i =0 ; i <ARRAY_SIZE (ar->peer_map); i++) { +if (ar->peer_map[i] == peer) { +ath10k_warn (ar,"removing stale peer_map entry for %pM (ptr %pK idx %d)\n" , + peer->addr, peer, i); + ar->peer_map[i] =NULL ; + } + } + +list_del (&peer->list); +kfree (peer); + ar->num_peers--; +} +static void ath10k_peer_cleanup (struct ath10k *ar,u32 vdev_id) {struct ath10k_peer *peer, *tmp; -int peer_id; -int i;lockdep_assert_held (&ar->conf_mutex);
@@ -880,25 +905,7 @@ static void ath10k_peer_cleanup(struct ath10k *ar, u32 vdev_id)ath10k_warn (ar,"removing stale peer %pM from vdev_id %d\n" , peer->addr, vdev_id); -for_each_set_bit (peer_id, peer->peer_ids, -ATH10K_MAX_NUM_PEER_IDS ) { - ar->peer_map[peer_id] =NULL ; - } - -/* Double check that peer is properly un-referenced from -* the peer_map -*/ -for (i =0 ; i <ARRAY_SIZE (ar->peer_map); i++) { -if (ar->peer_map[i] == peer) { -ath10k_warn (ar,"removing stale peer_map entry for %pM (ptr %pK idx %d)\n" , - peer->addr, peer, i); - ar->peer_map[i] =NULL ; - } - } - -list_del (&peer->list); -kfree (peer); - ar->num_peers--; +ath10k_peer_map_cleanup (ar, peer); }spin_unlock_bh (&ar->data_lock); }
@@ -7580,10 +7587,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,/* Clean up the peer object as well since we * must have failed to do this above. */ -list_del (&peer->list); - ar->peer_map[i] =NULL ; -kfree (peer); - ar->num_peers--; +ath10k_peer_map_cleanup (ar, peer); } }spin_unlock_bh (&ar->data_lock);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/530 wifi: mac80211: allow bw change during channel switch in mesh
In reply to Greg Kroah-HartmanFrom: Hari Chandrakanthan <[email protected]>
[ Upstream commit 6b75f133fe05c36c52d691ff21545d5757fff721 ]
Quoted 1 line
From 'IEEE Std 802.11-2020 section 11.8.8.4.1':
The mesh channel switch may be triggered by the need to avoid interference to a detected radar signal, or to reassign mesh STA channels to ensure the MBSS connectivity.
A 20/40 MHz MBSS may be changed to a 20 MHz MBSS and a 20 MHz MBSS may be changed to a 20/40 MHz MBSS.
Since the standard allows the change of bandwidth during the channel switch in mesh, remove the bandwidth check present in ieee80211_set_csa_beacon.
--- net/mac80211/cfg.c | 3 --- 1 file changed, 3 deletions(-)
net/mac80211/cfg.c +0 -3
@@ -3384,9 +3384,6 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,case NL80211_IFTYPE_MESH_POINT : {struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; -if (params->chandef.width != sdata->vif.bss_conf.chandef.width) -return -EINVAL ; -/* changes into another band are not supported */ if (sdata->vif.bss_conf.chandef.chan->band != params->chandef.chan->band)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/530 bpftool: Fix a wrong type cast in btf_dumper_int
In reply to Greg Kroah-HartmanFrom: Lam Thai <[email protected]>
[ Upstream commit 7184aef9c0f7a81db8fd18d183ee42481d89bf35 ]
When data points to a boolean value, casting it to int * is problematic and could lead to a wrong value being passed to jsonw_bool. Change the cast to bool * instead.
--- tools/bpf/bpftool/btf_dumper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/btf_dumper.c +1 -1
@@ -418,7 +418,7 @@ static int btf_dumper_int(const struct btf_type *t, __u8 bit_offset, *(char *)data);break ;case BTF_INT_BOOL : -jsonw_bool (jw, *(int *)data); +jsonw_bool (jw, *(bool *)data);break ;default :/* shouldn't happen */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 137/530 userfaultfd: open userfaultfds with O_RDONLY
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit abec3d015fdfb7c63105c7e1c956188bf381aa55 ]
Since userfaultfd doesn't implement a write operation, it is more appropriate to open it read-only.
When userfaultfds are opened read-write like it is now, and such fd is passed from one process to another, SELinux will check both read and write permissions for the target process, even though it can't actually do any write operation on the fd later.
Inspired by the following bug report, which has hit the SELinux scenario described above:
https://bugzilla.redhat.com/show_bug.cgi?id=1974559
--- fs/userfaultfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/userfaultfd.c +2 -2
@@ -982,7 +982,7 @@ static int resolve_userfault_fork(struct userfaultfd_ctx *new,int fd; fd =anon_inode_getfd_secure ("[userfaultfd]" , &userfaultfd_fops, new, -O_RDWR | (new->flags &UFFD_SHARED_FCNTL_FLAGS ), inode); +O_RDONLY | (new->flags &UFFD_SHARED_FCNTL_FLAGS ), inode);if (fd <0 )return fd;
@@ -2097,7 +2097,7 @@ SYSCALL_DEFINE1(userfaultfd, int, flags)mmgrab (ctx->mm); fd =anon_inode_getfd_secure ("[userfaultfd]" , &userfaultfd_fops, ctx, -O_RDWR | (flags &UFFD_SHARED_FCNTL_FLAGS ),NULL ); +O_RDONLY | (flags &UFFD_SHARED_FCNTL_FLAGS ),NULL );if (fd <0 ) {mmdrop (ctx->mm);kmem_cache_free (userfaultfd_ctx_cachep, ctx);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 171/530 bpf: btf: fix truncated last_member_type_id in btf_struct_resolve
In reply to Greg Kroah-HartmanFrom: Lorenz Bauer <[email protected]>
[ Upstream commit a37a32583e282d8d815e22add29bc1e91e19951a ]
When trying to finish resolving a struct member, btf_struct_resolve saves the member type id in a u16 temporary variable. This truncates the 32 bit type id value if it exceeds UINT16_MAX.
As a result, structs that have members with type ids > UINT16_MAX and which need resolution will fail with a message like this:
[67414] STRUCT ff_device size=120 vlen=12
effect_owners type_id=67434 bits_offset=960 Member exceeds struct_size
Fix this by changing the type of last_member_type_id to u32.
--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
@@ -2983,7 +2983,7 @@ static int btf_struct_resolve(struct btf_verifier_env *env,if (v->next_member) {const struct btf_type *last_member_type;const struct btf_member *last_member; -u16 last_member_type_id; +u32 last_member_type_id; last_member =btf_type_member (v->t) + v->next_member -1 ; last_member_type_id = last_member->type;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/530 drm/amd/display: Fix vblank refcount in vrr transition
In reply to Greg Kroah-HartmanFrom: Yunxiang Li <[email protected]>
commit 8799c0be89ebb99a16098bdf618f49f817bef76a upstream.
manage_dm_interrupts disable/enable vblank using drm_crtc_vblank_off/on which causes drm_crtc_vblank_get in vrr_transition to fail, and later when drm_crtc_vblank_put is called the refcount on vblank will be messed up. Therefore move the call to after manage_dm_interrupts.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 55 ++++++++++------------ 1 file changed, 26 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +26 -29
@@ -8860,15 +8860,15 @@ static void amdgpu_dm_handle_vrr_transit* We also need vupdate irq for the actual core vblank handling * at end of vblank. */ -dm_set_vupdate_irq (new_state->base.crtc, true); -drm_crtc_vblank_get (new_state->base.crtc); +WARN_ON (dm_set_vupdate_irq (new_state->base.crtc, true) !=0 ); +WARN_ON (drm_crtc_vblank_get (new_state->base.crtc) !=0 );DRM_DEBUG_DRIVER ("%s: crtc=%u VRR off->on: Get vblank ref\n" , __func__, new_state->base.crtc->base.id); }else if (old_vrr_active && !new_vrr_active) {/* Transition VRR active -> inactive: * Allow vblank irq disable again for fixed refresh rate. */ -dm_set_vupdate_irq (new_state->base.crtc, false); +WARN_ON (dm_set_vupdate_irq (new_state->base.crtc, false) !=0 );drm_crtc_vblank_put (new_state->base.crtc);DRM_DEBUG_DRIVER ("%s: crtc=%u VRR on->off: Drop vblank ref\n" , __func__, new_state->base.crtc->base.id);
@@ -9604,23 +9604,6 @@ static void amdgpu_dm_atomic_commit_tailmutex_unlock (&dm->dc_lock); } -/* Count number of newly disabled CRTCs for dropping PM refs later. */ -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, - new_crtc_state, i) { -if (old_crtc_state->active && !new_crtc_state->active) - crtc_disable_count++; - - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); - dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); - -/* For freesync config update on crtc state and params for irq */ -update_stream_irq_parameters (dm, dm_new_crtc_state); - -/* Handle vrr on->off / off->on transitions */ -amdgpu_dm_handle_vrr_transition (dm_old_crtc_state, - dm_new_crtc_state); - } -/** * Enable interrupts for CRTCs that are newly enabled or went through * a modeset. It was intentionally deferred until after the front end
@@ -9630,16 +9613,29 @@ static void amdgpu_dm_atomic_commit_tailfor_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);#ifdef CONFIG_DEBUG_FS -bool configure_crc = false;enum amdgpu_dm_pipe_crc_source cur_crc_src;#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) -struct crc_rd_work *crc_rd_wrk = dm->crc_rd_wrk; +struct crc_rd_work *crc_rd_wrk; +#endif +#endif +/* Count number of newly disabled CRTCs for dropping PM refs later. */ +if (old_crtc_state->active && !new_crtc_state->active) + crtc_disable_count++; + + dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + +/* For freesync config update on crtc state and params for irq */ +update_stream_irq_parameters (dm, dm_new_crtc_state); + +#ifdef CONFIG_DEBUG_FS +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) + crc_rd_wrk = dm->crc_rd_wrk;#endif spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags); cur_crc_src = acrtc->dm_irq_params.crc_src;spin_unlock_irqrestore (&adev_to_drm (adev)->event_lock, flags);#endif - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); if (new_crtc_state->active && (!old_crtc_state->active ||
@@ -9647,16 +9643,19 @@ static void amdgpu_dm_atomic_commit_taildc_stream_retain (dm_new_crtc_state->stream); acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;manage_dm_interrupts (adev, acrtc, true); + } +/* Handle vrr on->off / off->on transitions */ +amdgpu_dm_handle_vrr_transition (dm_old_crtc_state, dm_new_crtc_state);#ifdef CONFIG_DEBUG_FS +if (new_crtc_state->active && + (!old_crtc_state->active || +drm_atomic_crtc_needs_modeset (new_crtc_state))) {/** * Frontend may have changed so reapply the CRC capture * settings for the stream. */ - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); -if (amdgpu_dm_is_valid_crc_source (cur_crc_src)) { - configure_crc = true;#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )if (amdgpu_dm_crc_window_is_activated (crtc)) {spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags);
@@ -9668,12 +9667,10 @@ static void amdgpu_dm_atomic_commit_tailspin_unlock_irqrestore (&adev_to_drm (adev)->event_lock, flags); }#endif - } - -if (configure_crc)if (amdgpu_dm_crtc_configure_crc_source ( crtc, dm_new_crtc_state, cur_crc_src))DRM_DEBUG_DRIVER ("Failed to configure crc source" ); + }#endif } }
Greg Kroah-Hartman
maintainerPATCH 173/530 wifi: rtl8xxxu: Remove copy-paste leftover in gen2_update_rate_mask
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
[ Upstream commit d5350756c03cdf18696295c6b11d7acc4dbf825c ]
It looks like a leftover from copying rtl8xxxu_update_rate_mask, which is used with the gen1 chips.
It wasn't causing any problems for my RTL8188FU test device, but it's clearly a mistake, so remove it.
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +2 -3
@@ -4338,15 +4338,14 @@ void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, h2c.b_macid_cfg.ramask2 = (ramask >>16 ) &0xff ; h2c.b_macid_cfg.ramask3 = (ramask >>24 ) &0xff ; - h2c.ramask.arg =0x80 ; h2c.b_macid_cfg.data1 = rateid;if (sgi) h2c.b_macid_cfg.data1 |=BIT (7 ); h2c.b_macid_cfg.data2 = bw; -dev_dbg (&priv->udev->dev,"%s: rate mask %08x, arg %02x, size %zi\n" , - __func__, ramask, h2c.ramask.arg,sizeof (h2c.b_macid_cfg)); +dev_dbg (&priv->udev->dev,"%s: rate mask %08x, rateid %02x, sgi %d, size %zi\n" , + __func__, ramask, rateid, sgi,sizeof (h2c.b_macid_cfg));rtl8xxxu_gen2_h2c_cmd (priv, &h2c,sizeof (h2c.b_macid_cfg)); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 176/530 wifi: mt76: mt7915: do not check state before configuring implicit beamform
In reply to Greg Kroah-HartmanFrom: Howard Hsu <[email protected]>
[ Upstream commit d2b5bb6dfab29fe32bedefaade88dcd182c03a00 ]
Do not need to check running state before configuring implicit Tx beamform. It is okay to configure implicit Tx beamform in run time. Noted that the existing connected stations will be applied for new configuration only if they reconnected to the interface.
--- drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +3 -3
@@ -12,9 +12,9 @@ mt7915_implicit_txbf_set(void *data, u64 val) {struct mt7915_dev *dev = data; -if (test_bit (MT76_STATE_RUNNING , &dev->mphy.state)) -return -EBUSY ; - +/* The existing connected stations shall reconnect to apply +* new implicit txbf configuration. +*/ dev->ibf = !!val;return mt7915_mcu_set_txbf (dev,MT_BF_TYPE_UPDATE );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 182/530 netfilter: conntrack: revisit the gc initial rescheduling bias
In reply to Greg Kroah-HartmanFrom: Antoine Tenart <[email protected]>
[ Upstream commit 2aa192757005f130b2dd3547dda6e462e761199f ]
The previous commit changed the way the rescheduling delay is computed which has a side effect: the bias is now represented as much as the other entries in the rescheduling delay which makes the logic to kick in only with very large sets, as the initial interval is very large (INT_MAX).
Revisit the GC initial bias to allow more frequent GC for smaller sets while still avoiding wakeups when a machine is mostly idle. We're moving from a large initial value to pretending we have 100 entries expiring at the upper bound. This way only a few entries having a small timeout won't impact much the rescheduling delay and non-idle machines will have enough entries to lower the delay when needed. This also improves readability as the initial bias is now linked to what is computed instead of being an arbitrary large value.
--- net/netfilter/nf_conntrack_core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/nf_conntrack_core.c +6 -4
@@ -86,10 +86,12 @@ static DEFINE_MUTEX(nf_conntrack_mutex);/* clamp timeouts to this value (TCP unacked) */ #define GC_SCAN_INTERVAL_CLAMP (300ul * HZ) -/* large initial bias so that we don't scan often just because we have -* three entries with a 1s timeout. +/* Initial bias pretending we have 100 entries at the upper bound so we don't +* wakeup often just because we have three entries with a 1s timeout while still +* allowing non-idle machines to wakeup more often when needed. */ -#define GC_SCAN_INTERVAL_INIT INT_MAX +#define GC_SCAN_INITIAL_COUNT 100 +#define GC_SCAN_INTERVAL_INIT GC_SCAN_INTERVAL_MAX#define GC_SCAN_MAX_DURATION msecs_to_jiffies(10)#define GC_SCAN_EXPIRED_MAX (64000u / HZ)
@@ -1450,7 +1452,7 @@ static void gc_worker(struct work_struct *work)if (i ==0 ) { gc_work->avg_timeout =GC_SCAN_INTERVAL_INIT ; - gc_work->count =1 ; + gc_work->count =GC_SCAN_INITIAL_COUNT ; gc_work->start_time = start_time; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 180/530 Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 3124d320c22f3f4388d9ac5c8f37eaad0cefd6b1 ]
syzbot is reporting NULL pointer dereference at hci_uart_tty_close() [1], for rcu_sync_enter() is called without rcu_sync_init() due to hci_uart_tty_open() ignoring percpu_init_rwsem() failure.
While we are at it, fix that hci_uart_register_device() ignores percpu_init_rwsem() failure and hci_uart_unregister_device() does not call percpu_free_rwsem().
--- drivers/bluetooth/hci_ldisc.c | 7 +++++-- drivers/bluetooth/hci_serdev.c | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/bluetooth/hci_ldisc.c +5 -2
@@ -490,6 +490,11 @@ static int hci_uart_tty_open(struct tty_struct *tty)BT_ERR ("Can't allocate control structure" );return -ENFILE ; } +if (percpu_init_rwsem (&hu->proto_lock)) { +BT_ERR ("Can't allocate semaphore structure" ); +kfree (hu); +return -ENOMEM ; + } tty->disc_data = hu; hu->tty = tty;
@@ -502,8 +507,6 @@ static int hci_uart_tty_open(struct tty_struct *tty)INIT_WORK (&hu->init_ready, hci_uart_init_work);INIT_WORK (&hu->write_work, hci_uart_write_work); -percpu_init_rwsem (&hu->proto_lock); -/* Flush any pending characters in the driver */ tty_driver_flush_buffer (tty);
drivers/bluetooth/hci_serdev.c +7 -3
@@ -301,11 +301,12 @@ int hci_uart_register_device(struct hci_uart *hu,serdev_device_set_client_ops (hu->serdev, &hci_serdev_client_ops); +if (percpu_init_rwsem (&hu->proto_lock)) +return -ENOMEM ; + err =serdev_device_open (hu->serdev);if (err) -return err; - -percpu_init_rwsem (&hu->proto_lock); + goto err_rwsem; err = p->open (hu);if (err)
@@ -378,6 +379,8 @@ int hci_uart_register_device(struct hci_uart *hu, p->close (hu); err_open:serdev_device_close (hu->serdev); +err_rwsem: +percpu_free_rwsem (&hu->proto_lock);return err; }EXPORT_SYMBOL_GPL (hci_uart_register_device);
@@ -399,5 +402,6 @@ void hci_uart_unregister_device(struct hci_uart *hu)clear_bit (HCI_UART_PROTO_READY , &hu->flags);serdev_device_close (hu->serdev); } +percpu_free_rwsem (&hu->proto_lock); }EXPORT_SYMBOL_GPL (hci_uart_unregister_device);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/530 wifi: rtl8xxxu: tighten bounds checking in rtl8xxxu_read_efuse()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 620d5eaeb9059636864bda83ca1c68c20ede34a5 ]
There some bounds checking to ensure that "map_addr" is not out of bounds before the start of the loop. But the checking needs to be done as we iterate through the loop because "map_addr" gets larger as we iterate.
--- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +7 -7
@@ -1874,13 +1874,6 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)/* We have 8 bits to indicate validity */ map_addr = offset *8 ; -if (map_addr >=EFUSE_MAP_LEN ) { -dev_warn (dev,"%s: Illegal map_addr (%04x), " -"efuse corrupt!\n" , - __func__, map_addr); - ret = -EINVAL ; - goto exit; - }for (i =0 ; i <EFUSE_MAX_WORD_UNIT ; i++) {/* Check word enable condition in the section */ if (word_mask &BIT (i)) {
@@ -1891,6 +1884,13 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv) ret =rtl8xxxu_read_efuse8 (priv, efuse_addr++, &val8);if (ret) goto exit; +if (map_addr >=EFUSE_MAP_LEN -1 ) { +dev_warn (dev,"%s: Illegal map_addr (%04x), " +"efuse corrupt!\n" , + __func__, map_addr); + ret = -EINVAL ; + goto exit; + } priv->efuse_wifi.raw[map_addr++] = val8; ret =rtl8xxxu_read_efuse8 (priv, efuse_addr++, &val8);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 191/530 xfrm: Reinject transport-mode packets through workqueue
In reply to Greg Kroah-HartmanFrom: Liu Jian <[email protected]>
[ Upstream commit 4f4920669d21e1060b7243e5118dc3b71ced1276 ]
The following warning is displayed when the tcp6-multi-diffip11 stress test case of the LTP test suite is tested:
watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [ns-tcpserver:48198] CPU: 0 PID: 48198 Comm: ns-tcpserver Kdump: loaded Not tainted 6.0.0-rc6+ #39 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : des3_ede_encrypt+0x27c/0x460 [libdes] lr : 0x3f
sp : ffff80000ceaa1b0
x29: ffff80000ceaa1b0 x28: ffff0000df056100 x27: ffff0000e51e5280
x26: ffff80004df75030 x25: ffff0000e51e4600 x24: 000000000000003b
x23: 0000000000802080 x22: 000000000000003d x21: 0000000000000038
x20: 0000000080000020 x19: 000000000000000a x18: 0000000000000033
x17: ffff0000e51e4780 x16: ffff80004e2d1448 x15: ffff80004e2d1248
x14: ffff0000e51e4680 x13: ffff80004e2d1348 x12: ffff80004e2d1548
x11: ffff80004e2d1848 x10: ffff80004e2d1648 x9 : ffff80004e2d1748 x8 : ffff80004e2d1948 x7 : 000000000bcaf83d x6 : 000000000000001b x5 : ffff80004e2d1048 x4 : 00000000761bf3bf x3 : 000000007f1dd0a3 x2 : ffff0000e51e4780 x1 : ffff0000e3b9a2f8 x0 : 00000000db44e872
Call trace: des3_ede_encrypt+0x27c/0x460 [libdes] crypto_des3_ede_encrypt+0x1c/0x30 [des_generic] crypto_cbc_encrypt+0x148/0x190 crypto_skcipher_encrypt+0x2c/0x40 crypto_authenc_encrypt+0xc8/0xfc [authenc] crypto_aead_encrypt+0x2c/0x40 echainiv_encrypt+0x144/0x1a0 [echainiv] crypto_aead_encrypt+0x2c/0x40 esp6_output_tail+0x1c8/0x5d0 [esp6] esp6_output+0x120/0x278 [esp6] xfrm_output_one+0x458/0x4ec xfrm_output_resume+0x6c/0x1f0 xfrm_output+0xac/0x4ac __xfrm6_output+0x130/0x270 xfrm6_output+0x60/0xec ip6_xmit+0x2ec/0x5bc inet6_csk_xmit+0xbc/0x10c __tcp_transmit_skb+0x460/0x8c0 tcp_write_xmit+0x348/0x890 __tcp_push_pending_frames+0x44/0x110 tcp_rcv_established+0x3c8/0x720 tcp_v6_do_rcv+0xdc/0x4a0 tcp_v6_rcv+0xc24/0xcb0 ip6_protocol_deliver_rcu+0xf0/0x574 ip6_input_finish+0x48/0x7c ip6_input+0x48/0xc0 ip6_rcv_finish+0x80/0x9c xfrm_trans_reinject+0xb0/0xf4 tasklet_action_common.constprop.0+0xf8/0x134 tasklet_action+0x30/0x3c __do_softirq+0x128/0x368 do_softirq+0xb4/0xc0 __local_bh_enable_ip+0xb0/0xb4 put_cpu_fpsimd_context+0x40/0x70 kernel_neon_end+0x20/0x40 sha1_base_do_update.constprop.0.isra.0+0x11c/0x140 [sha1_ce] sha1_ce_finup+0x94/0x110 [sha1_ce] crypto_shash_finup+0x34/0xc0 hmac_finup+0x48/0xe0 crypto_shash_finup+0x34/0xc0 shash_digest_unaligned+0x74/0x90 crypto_shash_digest+0x4c/0x9c shash_ahash_digest+0xc8/0xf0 shash_async_digest+0x28/0x34 crypto_ahash_digest+0x48/0xcc crypto_authenc_genicv+0x88/0xcc [authenc] crypto_authenc_encrypt+0xd8/0xfc [authenc] crypto_aead_encrypt+0x2c/0x40 echainiv_encrypt+0x144/0x1a0 [echainiv] crypto_aead_encrypt+0x2c/0x40 esp6_output_tail+0x1c8/0x5d0 [esp6] esp6_output+0x120/0x278 [esp6] xfrm_output_one+0x458/0x4ec xfrm_output_resume+0x6c/0x1f0 xfrm_output+0xac/0x4ac __xfrm6_output+0x130/0x270 xfrm6_output+0x60/0xec ip6_xmit+0x2ec/0x5bc inet6_csk_xmit+0xbc/0x10c __tcp_transmit_skb+0x460/0x8c0 tcp_write_xmit+0x348/0x890 __tcp_push_pending_frames+0x44/0x110 tcp_push+0xb4/0x14c tcp_sendmsg_locked+0x71c/0xb64 tcp_sendmsg+0x40/0x6c inet6_sendmsg+0x4c/0x80 sock_sendmsg+0x5c/0x6c __sys_sendto+0x128/0x15c __arm64_sys_sendto+0x30/0x40 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0x170/0x194 do_el0_svc+0x38/0x4c el0_svc+0x28/0xe0 el0t_64_sync_handler+0xbc/0x13c el0t_64_sync+0x180/0x184
Get softirq info by bcc tool:
./softirqs -NT 10
Tracing soft irq event time... Hit Ctrl-C to end.
15:34:34
SOFTIRQ TOTAL_nsecs
block 158990
timer 20030920
sched 46577080net_rx 676746820
tasklet 9906067650
15:34:45
SOFTIRQ TOTAL_nsecs
block 86100
sched 38849790net_rx 676532470
timer 1163848790
tasklet 9409019620
15:34:55
SOFTIRQ TOTAL_nsecs
sched 58078450net_rx 475156720
timer 533832410
tasklet 9431333300
The tasklet software interrupt takes too much time. Therefore, the xfrm_trans_reinject executor is changed from tasklet to workqueue. Add add spin lock to protect the queue. This reduces the processing flow of the tcp_sendmsg function in this scenario.
--- net/xfrm/xfrm_input.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
net/xfrm/xfrm_input.c +13 -5
@@ -24,7 +24,8 @@#include "xfrm_inout.h" struct xfrm_trans_tasklet { -struct tasklet_struct tasklet; +struct work_struct work; +spinlock_t queue_lock;struct sk_buff_head queue; };
@@ -760,18 +761,22 @@ int xfrm_input_resume(struct sk_buff *skb, int nexthdr) }EXPORT_SYMBOL (xfrm_input_resume); -static void xfrm_trans_reinject (struct tasklet_struct *t) +static void xfrm_trans_reinject (struct work_struct *work) { -struct xfrm_trans_tasklet *trans =from_tasklet (trans, t, tasklet); + struct xfrm_trans_tasklet *trans = container_of(work, struct xfrm_trans_tasklet, work);struct sk_buff_head queue;struct sk_buff *skb;__skb_queue_head_init (&queue); +spin_lock_bh (&trans->queue_lock);skb_queue_splice_init (&trans->queue, &queue); +spin_unlock_bh (&trans->queue_lock); +local_bh_disable ();while ((skb =__skb_dequeue (&queue)))XFRM_TRANS_SKB_CB (skb)->finish (XFRM_TRANS_SKB_CB (skb)->net,NULL , skb); +local_bh_enable (); } int xfrm_trans_queue_net(struct net *net, struct sk_buff *skb,
@@ -789,8 +794,10 @@ int xfrm_trans_queue_net(struct net *net, struct sk_buff *skb,XFRM_TRANS_SKB_CB (skb)->finish = finish;XFRM_TRANS_SKB_CB (skb)->net = net; +spin_lock_bh (&trans->queue_lock);__skb_queue_tail (&trans->queue, skb); -tasklet_schedule (&trans->tasklet); +spin_unlock_bh (&trans->queue_lock); +schedule_work (&trans->work);return 0 ; }EXPORT_SYMBOL (xfrm_trans_queue_net);
@@ -817,7 +824,8 @@ void __init xfrm_input_init(void)struct xfrm_trans_tasklet *trans; trans = &per_cpu (xfrm_trans_tasklet, i); +spin_lock_init (&trans->queue_lock);__skb_queue_head_init (&trans->queue); -tasklet_setup (&trans->tasklet, xfrm_trans_reinject); +INIT_WORK (&trans->work, xfrm_trans_reinject); } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 183/530 wifi: ath11k: fix number of VHT beamformee spatial streams
In reply to Greg Kroah-HartmanFrom: Jesus Fernandez Manzano <[email protected]>
[ Upstream commit 55b5ee3357d7bb98ee578cf9b84a652e7a1bc199 ]
The number of spatial streams used when acting as a beamformee in VHT mode are reported by the firmware as 7 (8 sts - 1) both in IPQ6018 and IPQ8074 which respectively have 2 and 4 sts each. So the firmware should report 1 (2 - 1) and 3 (4 - 1).
Fix this by checking that the number of VHT beamformee sts reported by the firmware is not greater than the number of receiving antennas - 1. The fix is based on the same approach used in this same function for sanitizing the number of sounding dimensions reported by the firmware.
Without this change, acting as a beamformee in VHT mode is not working properly.
Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/mac.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +20 -5
@@ -3684,6 +3684,8 @@ static int ath11k_mac_set_txbf_conf(struct ath11k_vif *arvif)if (vht_cap & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE )) { nsts = vht_cap &IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK ; nsts >>=IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT ; +if (nsts > (ar->num_rx_chains -1 )) + nsts = ar->num_rx_chains -1 ; value |=SM (nsts,WMI_TXBF_STS_CAP_OFFSET ); }
@@ -3724,7 +3726,7 @@ static int ath11k_mac_set_txbf_conf(struct ath11k_vif *arvif)static void ath11k_set_vht_txbf_cap (struct ath11k *ar,u32 *vht_cap) {bool subfer, subfee; -int sound_dim =0 ; +int sound_dim =0 , nsts =0 ; subfer = !!(*vht_cap & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE )); subfee = !!(*vht_cap & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE ));
@@ -3734,6 +3736,11 @@ static void ath11k_set_vht_txbf_cap(struct ath11k *ar, u32 *vht_cap) subfer = false; } +if (ar->num_rx_chains <2 ) { + *vht_cap &= ~(IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE ); + subfee = false; + } +/* If SU Beaformer is not set, then disable MU Beamformer Capability */ if (!subfer) *vht_cap &= ~(IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE );
@@ -3746,7 +3753,9 @@ static void ath11k_set_vht_txbf_cap(struct ath11k *ar, u32 *vht_cap) sound_dim >>=IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT ; *vht_cap &= ~IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK ; -/* TODO: Need to check invalid STS and Sound_dim values set by FW? */ + nsts = (*vht_cap &IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK ); + nsts >>=IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT ; + *vht_cap &= ~IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK ;/* Enable Sounding Dimension Field only if SU BF is enabled */ if (subfer) {
@@ -3758,9 +3767,15 @@ static void ath11k_set_vht_txbf_cap(struct ath11k *ar, u32 *vht_cap) *vht_cap |= sound_dim; } -/* Use the STS advertised by FW unless SU Beamformee is not supported*/ -if (!subfee) - *vht_cap &= ~(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK ); +/* Enable Beamformee STS Field only if SU BF is enabled */ +if (subfee) { +if (nsts > (ar->num_rx_chains -1 )) + nsts = ar->num_rx_chains -1 ; + + nsts <<=IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT ; + nsts &=IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK ; + *vht_cap |= nsts; + } } static struct ieee80211_sta_vht_cap
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 195/530 vhost/vsock: Use kvmalloc/kvfree for larger packets.
In reply to Greg Kroah-HartmanFrom: Junichi Uekawa <[email protected]>
[ Upstream commit 0e3f72931fc47bb81686020cc643cde5d9cd0bb8 ]
When copying a large file over sftp over vsock, data size is usually 32kB, and kmalloc seems to fail to try to allocate 32 32kB regions.
vhost-5837: page allocation failure: order:4, mode:0x24040c0
Call Trace: [<ffffffffb6a0df64>] dump_stack+0x97/0xdb [<ffffffffb68d6aed>] warn_alloc_failed+0x10f/0x138 [<ffffffffb68d868a>] ? __alloc_pages_direct_compact+0x38/0xc8 [<ffffffffb664619f>] __alloc_pages_nodemask+0x84c/0x90d [<ffffffffb6646e56>] alloc_kmem_pages+0x17/0x19 [<ffffffffb6653a26>] kmalloc_order_trace+0x2b/0xdb [<ffffffffb66682f3>] __kmalloc+0x177/0x1f7 [<ffffffffb66e0d94>] ? copy_from_iter+0x8d/0x31d [<ffffffffc0689ab7>] vhost_vsock_handle_tx_kick+0x1fa/0x301 [vhost_vsock] [<ffffffffc06828d9>] vhost_worker+0xf7/0x157 [vhost] [<ffffffffb683ddce>] kthread+0xfd/0x105 [<ffffffffc06827e2>] ? vhost_dev_set_owner+0x22e/0x22e [vhost] [<ffffffffb683dcd1>] ? flush_kthread_worker+0xf3/0xf3 [<ffffffffb6eb332e>] ret_from_fork+0x4e/0x80 [<ffffffffb683dcd1>] ? flush_kthread_worker+0xf3/0xf3
Work around by doing kvmalloc instead.
--- drivers/vhost/vsock.c | 2 +- net/vmw_vsock/virtio_transport_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/vhost/vsock.c +1 -1
@@ -393,7 +393,7 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq,return NULL ; } - pkt->buf =kmalloc (pkt->len,GFP_KERNEL ); + pkt->buf =kvmalloc (pkt->len,GFP_KERNEL );if (!pkt->buf) {kfree (pkt);return NULL ;
net/vmw_vsock/virtio_transport_common.c +1 -1
@@ -1342,7 +1342,7 @@ EXPORT_SYMBOL_GPL(virtio_transport_recv_pkt);void virtio_transport_free_pkt (struct virtio_vsock_pkt *pkt) { -kfree (pkt->buf); +kvfree (pkt->buf);kfree (pkt); }EXPORT_SYMBOL_GPL (virtio_transport_free_pkt);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 124/530 KVM: nVMX: Unconditionally purge queued/injected events on nested "exit"
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit d953540430c5af57f5de97ea9e36253908204027 upstream.
Drop pending exceptions and events queued for re-injection when leaving nested guest mode, even if the "exit" is due to VM-Fail, SMI, or forced by host userspace. Failure to purge events could result in an event belonging to L2 being injected into L1.
This _should_ never happen for VM-Fail as all events should be blocked by nested_run_pending, but it's possible if KVM, not the L1 hypervisor, is the source of VM-Fail when running vmcs02.
SMI is a nop (barring unknown bugs) as recognition of SMI and thus entry to SMM is blocked by pending exceptions and re-injected events.
Forced exit is definitely buggy, but has likely gone unnoticed because userspace probably follows the forced exit with KVM_SET_VCPU_EVENTS (or some other ioctl() that purges the queue).
--- arch/x86/kvm/vmx/nested.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
arch/x86/kvm/vmx/nested.c +11 -8
@@ -4251,14 +4251,6 @@ static void prepare_vmcs12(struct kvm_vcnested_vmx_abort (vcpu,VMX_ABORT_SAVE_GUEST_MSR_FAIL ); } - -/* -* Drop what we picked up for L2 via vmx_complete_interrupts. It is -* preserved above and would only end up incorrectly in L1. -*/ - vcpu->arch.nmi_injected = false; -kvm_clear_exception_queue (vcpu); -kvm_clear_interrupt_queue (vcpu); }/*
@@ -4598,6 +4590,17 @@ void nested_vmx_vmexit(struct kvm_vcpu *WARN_ON_ONCE (nested_early_check); } +/* +* Drop events/exceptions that were queued for re-injection to L2 +* (picked up via vmx_complete_interrupts()), as well as exceptions +* that were pending for L2. Note, this must NOT be hoisted above +* prepare_vmcs12(), events/exceptions queued for re-injection need to +* be captured in vmcs12 (see vmcs12_save_pending_event()). +*/ + vcpu->arch.nmi_injected = false; +kvm_clear_exception_queue (vcpu); +kvm_clear_interrupt_queue (vcpu); +vmx_switch_vmcs (vcpu, &vmx->vmcs01);/* Update any VMCS fields that might have changed while L2 ran */
Greg Kroah-Hartman
maintainerPATCH 165/530 wifi: rtw88: add missing destroy_workqueue() on error path in rtw_core_init()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit b0ea758b30bbdf7c4323c78b7c50c05d2e1224d5 ]
Add the missing destroy_workqueue() before return from rtw_core_init() in error path.
--- drivers/net/wireless/realtek/rtw88/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/main.c +6 -2
@@ -1869,7 +1869,7 @@ int rtw_core_init(struct rtw_dev *rtwdev) ret =rtw_load_firmware (rtwdev,RTW_NORMAL_FW );if (ret) {rtw_warn (rtwdev,"no firmware loaded\n" ); -return ret; + goto out; }if (chip->wow_fw_name) {
@@ -1879,11 +1879,15 @@ int rtw_core_init(struct rtw_dev *rtwdev)wait_for_completion (&rtwdev->fw.completion);if (rtwdev->fw.firmware)release_firmware (rtwdev->fw.firmware); -return ret; + goto out; } }return 0 ; + +out: +destroy_workqueue (rtwdev->tx_wq); +return ret; }EXPORT_SYMBOL (rtw_core_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 212/530 drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 64b88afbd92fbf434759d1896a7cf705e1c00e79 ]
Previous commit fixed checking of the ERR_PTR value returned by drm_gem_shmem_get_sg_table(), but it missed to zero out the shmem->pages, which will crash virtio_gpu_cleanup_object(). Add the missing zeroing of the shmem->pages.
--- drivers/gpu/drm/virtio/virtgpu_object.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_object.c +1 -0
@@ -169,6 +169,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, shmem->pages =drm_gem_shmem_get_sg_table (&bo->base);if (IS_ERR (shmem->pages)) {drm_gem_shmem_unpin (&bo->base); + shmem->pages =NULL ;return PTR_ERR (shmem->pages); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 196/530 eth: alx: take rtnl_lock on resume
In reply to Greg Kroah-HartmanFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 6ad1c94e1e7e374d88f0cfd77936dddb8339aaba ]
Zbynek reports that alx trips an rtnl assertion on resume:
RTNL: assertion failed at net/core/dev.c (2891)
RIP: 0010:netif_set_real_num_tx_queues+0x1ac/0x1c0 Call Trace: <TASK> __alx_open+0x230/0x570 [alx] alx_resume+0x54/0x80 [alx] ? pci_legacy_resume+0x80/0x80 dpm_run_callback+0x4a/0x150 device_resume+0x8b/0x190 async_resume+0x19/0x30 async_run_entry_fn+0x30/0x130 process_one_work+0x1e5/0x3b0
indeed the driver does not hold rtnl_lock during its internal close and re-open functions during suspend/resume. Note that this is not a huge bug as the driver implements its own locking, and does not implement changing the number of queues, but we need to silence the splat.
--- drivers/net/ethernet/atheros/alx/main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/atheros/alx/main.c +5 -0
@@ -1912,11 +1912,14 @@ static int alx_suspend(struct device *dev)if (!netif_running (alx->dev))return 0 ; + +rtnl_lock ();netif_device_detach (alx->dev);mutex_lock (&alx->mtx);__alx_stop (alx);mutex_unlock (&alx->mtx); +rtnl_unlock ();return 0 ; }
@@ -1927,6 +1930,7 @@ static int alx_resume(struct device *dev)struct alx_hw *hw = &alx->hw;int err; +rtnl_lock ();mutex_lock (&alx->mtx);alx_reset_phy (hw);
@@ -1943,6 +1947,7 @@ static int alx_resume(struct device *dev) unlock:mutex_unlock (&alx->mtx); +rtnl_unlock ();return err; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 81/530 f2fs: complete checkpoints during remount
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit 4f99484d27961cb194cebcd917176fa038a5025f upstream.
Otherwise, pending checkpoints can contribute a race condition to give a quota warning.
- Thread - checkpoint thread
add checkpoints to the listdo_remount()
down_write(&sb->s_umount);
f2fs_remount()
block_operations()
down_read_trylock(&sb->s_umount) = 0
up_write(&sb->s_umount);
f2fs_quota_sync()
dquot_writeback_dquots()
WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));Or,
do_remount()
down_write(&sb->s_umount);
f2fs_remount()
create a ckpt thread f2fs_enable_checkpoint() adds checkpoints wait for f2fs_sync_fs() trigger another pending checkpoint
block_operations()
down_read_trylock(&sb->s_umount) = 0
up_write(&sb->s_umount);
f2fs_quota_sync()
dquot_writeback_dquots()
WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -2152,6 +2152,9 @@ static void f2fs_enable_checkpoint(strucup_write (&sbi->gc_lock);f2fs_sync_fs (sbi->sb,1 ); + +/* Let's ensure there's no pending checkpoint anymore */ +f2fs_flush_ckpt_thread (sbi); }static int f2fs_remount (struct super_block *sb,int *flags,char *data)
@@ -2318,6 +2321,9 @@ static int f2fs_remount(struct super_blof2fs_stop_ckpt_thread (sbi); need_restart_ckpt = true; }else { +/* Flush if the prevous checkpoint, if exists. */ +f2fs_flush_ckpt_thread (sbi); + err =f2fs_start_ckpt_thread (sbi);if (err) { f2fs_err(sbi,
Greg Kroah-Hartman
maintainerPATCH 218/530 platform/chrome: fix memory corruption in ioctl
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 8a07b45fd3c2dda24fad43639be5335a4595196a ]
If "s_mem.bytes" is larger than the buffer size it leads to memory corruption.
--- drivers/platform/chrome/cros_ec_chardev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/chrome/cros_ec_chardev.c +3 -0
@@ -327,6 +327,9 @@ static long cros_ec_chardev_ioctl_readmem(struct cros_ec_dev *ec,if (copy_from_user (&s_mem, arg,sizeof (s_mem)))return -EFAULT ; +if (s_mem.bytes >sizeof (s_mem.buffer)) +return -EINVAL ; + num = ec_dev->cmd_readmem (ec_dev, s_mem.offset, s_mem.bytes, s_mem.buffer);if (num <=0 )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 32/530 platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure
In reply to Greg Kroah-HartmanFrom: Patryk Duda <[email protected]>
commit f74c7557ed0d321947e8bb4e9d47c1013f8b2227 upstream.
Some EC based devices (e.g. Fingerpint MCU) can jump to RO part of the firmware (intentionally or due to device reboot). The RO part doesn't change during the device lifecycle, so it won't support newer version of EC_CMD_GET_NEXT_EVENT command.
Function cros_ec_query_all() is responsible for finding maximum supported MKBP event version. It's usually called when the device is running RW part of the firmware, so the command version can be potentially higher than version supported by the RO.
The problem was fixed by updating maximum supported version when the device returns EC_RES_INVALID_VERSION (mapped to -ENOPROTOOPT). That way the kernel will use highest common version supported by RO and RW.
--- drivers/platform/chrome/cros_ec_proto.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/platform/chrome/cros_ec_proto.c +32 -0
@@ -748,6 +748,7 @@ int cros_ec_get_next_event(struct cros_eu8 event_type;u32 host_event;int ret; +u32 ver_mask;/* * Default value for wake_event.
@@ -769,6 +770,37 @@ int cros_ec_get_next_event(struct cros_ereturn get_keyboard_state_event (ec_dev); ret =get_next_event (ec_dev); +/* +* -ENOPROTOOPT is returned when EC returns EC_RES_INVALID_VERSION. +* This can occur when EC based device (e.g. Fingerprint MCU) jumps to +* the RO image which doesn't support newer version of the command. In +* this case we will attempt to update maximum supported version of the +* EC_CMD_GET_NEXT_EVENT. +*/ +if (ret == -ENOPROTOOPT ) { +dev_dbg (ec_dev->dev, +"GET_NEXT_EVENT returned invalid version error.\n" ); + ret =cros_ec_get_host_command_version_mask (ec_dev, +EC_CMD_GET_NEXT_EVENT , + &ver_mask); +if (ret <0 || ver_mask ==0 ) +/* +* Do not change the MKBP supported version if we can't +* obtain supported version correctly. Please note that +* calling EC_CMD_GET_NEXT_EVENT returned +* EC_RES_INVALID_VERSION which means that the command +* is present. +*/ +return -ENOPROTOOPT ; + + ec_dev->mkbp_event_supported =fls (ver_mask); +dev_dbg (ec_dev->dev,"MKBP support version changed to %u\n" , + ec_dev->mkbp_event_supported -1 ); + +/* Try to get next event with new MKBP support version set. */ + ret =get_next_event (ec_dev); + } +if (ret <=0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 219/530 ASoC: tas2764: Allow mono streams
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit 23204d928a27146d13e11c9383632775345ecca8 ]
The part is a mono speaker amp, but it can do downmix and switch between left and right channel, so the right channel range is 1 to 2.
(This mirrors commit bf54d97a835d ("ASoC: tas2770: Allow mono streams") which was a fix to the tas2770 driver.)
--- sound/soc/codecs/tas2764.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tas2764.c +1 -1
@@ -485,7 +485,7 @@ static struct snd_soc_dai_driver tas2764_dai_driver[] = { .id = 0, .playback = { .stream_name = "ASI1 Playback", - .channels_min = 2, + .channels_min = 1, .channels_max = 2, .rates = TAS2764_RATES, .formats = TAS2764_FORMATS,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 102/530 ext4: fix potential memory leak in ext4_fc_record_regions()
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 7069d105c1f15c442b68af43f7fde784f3126739 upstream.
As krealloc may return NULL, in this case 'state->fc_regions' may not be freed by krealloc, but 'state->fc_regions' already set NULL. Then will lead to 'state->fc_regions' memory leak.
--- fs/ext4/fast_commit.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
fs/ext4/fast_commit.c +8 -6
@@ -1607,15 +1607,17 @@ int ext4_fc_record_regions(struct super_if (replay && state->fc_regions_used != state->fc_regions_valid) state->fc_regions_used = state->fc_regions_valid;if (state->fc_regions_used == state->fc_regions_size) { +struct ext4_fc_alloc_region *fc_regions; + state->fc_regions_size +=EXT4_FC_REPLAY_REALLOC_INCREMENT ; - state->fc_regions =krealloc ( - state->fc_regions, - state->fc_regions_size * -sizeof (struct ext4_fc_alloc_region ), -GFP_KERNEL ); -if (!state->fc_regions) + fc_regions =krealloc (state->fc_regions, + state->fc_regions_size * +sizeof (struct ext4_fc_alloc_region ), +GFP_KERNEL ); +if (!fc_regions)return -ENOMEM ; + state->fc_regions = fc_regions; } region = &state->fc_regions[state->fc_regions_used++]; region->ino = ino;
Greg Kroah-Hartman
maintainerPATCH 61/530 PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
commit 0e32818397426a688f598f35d3bc762eca6d7592 upstream.
When pci_assign_resource() is unable to assign resources to a BAR, it uses pci_revert_fw_address() to fall back to a firmware assignment (if any). Previously pci_revert_fw_address() assumed all addresses could reach the device, but this is not true if the device is below a bridge that only forwards addresses within its windows.
This problem was observed on a Tyan Tomcat IV S1564D system where the BIOS did not assign valid addresses to several bridges and USB devices:
pci 0000:00:11.0: PCI-to-PCIe bridge to [bus 01-ff]
pci 0000:00:11.0: bridge window [io 0xe000-0xefff]
pci 0000:01:00.0: PCIe Upstream Port to [bus 02-ff]
pci 0000:01:00.0: bridge window [io 0x0000-0x0fff] # unreachable
pci 0000:02:02.0: PCIe Downstream Port to [bus 05-ff]
pci 0000:02:02.0: bridge window [io 0x0000-0x0fff] # unreachable
pci 0000:05:00.0: PCIe-to-PCI bridge to [bus 06-ff]
pci 0000:05:00.0: bridge window [io 0x0000-0x0fff] # unreachable
pci 0000:06:08.0: USB UHCI 1.1
pci 0000:06:08.0: BAR 4: [io 0xfce0-0xfcff] # unreachable
pci 0000:06:08.1: USB UHCI 1.1
pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] # unreachable
pci 0000:06:08.0: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window pci 0000:06:08.1: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window
During the first pass of assigning unassigned resources, there was not enough I/O space available, so we couldn't assign the 06:08.0 BAR and reverted to the firmware assignment (still unreachable). Reverting the 06:08.1 assignment failed because it conflicted with 06:08.0:
pci 0000:00:11.0: bridge window [io 0xe000-0xefff]
pci 0000:01:00.0: no space for bridge window [io size 0x2000] pci 0000:02:02.0: no space for bridge window [io size 0x1000] pci 0000:05:00.0: no space for bridge window [io size 0x1000]
pci 0000:06:08.0: BAR 4: no space for [io size 0x0020]
pci 0000:06:08.0: BAR 4: trying firmware assignment [io 0xfce0-0xfcff]
pci 0000:06:08.1: BAR 4: no space for [io size 0x0020]
pci 0000:06:08.1: BAR 4: trying firmware assignment [io 0xfce0-0xfcff]
pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] conflicts with 0000:06:08.0 [io 0xfce0-0xfcff]
A subsequent pass assigned valid bridge windows and a valid 06:08.1 BAR, but left the 06:08.0 BAR alone, so the UHCI device was still unusable:
pci 0000:00:11.0: bridge window [io 0xe000-0xefff] released pci 0000:00:11.0: bridge window [io 0x1000-0x2fff] # reassigned pci 0000:01:00.0: bridge window [io 0x1000-0x2fff] # reassigned pci 0000:02:02.0: bridge window [io 0x2000-0x2fff] # reassigned pci 0000:05:00.0: bridge window [io 0x2000-0x2fff] # reassigned pci 0000:06:08.0: BAR 4: assigned [io 0xfce0-0xfcff] # left alone pci 0000:06:08.1: BAR 4: assigned [io 0x2000-0x201f]
...
uhci_hcd 0000:06:08.0: host system error, PCI problems?
uhci_hcd 0000:06:08.0: host controller process error, something bad happened! uhci_hcd 0000:06:08.0: host controller halted, very bad! uhci_hcd 0000:06:08.0: HCRESET not completed yet!
uhci_hcd 0000:06:08.0: HC died; cleaning up
If the address assigned by firmware is not reachable because it's not within upstream bridge windows, fail instead of assigning the unusable address from firmware.
--- drivers/pci/setup-res.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/pci/setup-res.c +11 -0
@@ -210,6 +210,17 @@ static int pci_revert_fw_address(struct root =pci_find_parent_resource (dev, res);if (!root) { +/* +* If dev is behind a bridge, accesses will only reach it +* if res is inside the relevant bridge window. +*/ +if (pci_upstream_bridge (dev)) +return -ENXIO ; + +/* +* On the root bus, assume the host bridge will forward +* everything. +*/ if (res->flags &IORESOURCE_IO ) root = &ioport_resource;else
Greg Kroah-Hartman
maintainerPATCH 13/530 cifs: destage dirty pages before re-reading them for cache=none
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
commit bb44c31cdcac107344dd2fcc3bd0504a53575c51 upstream.
This is the opposite case of kernel bugzilla 216301.
If we mmap a file using cache=none and then proceed to update the mmapped area these updates are not reflected in a later pread() of that part of the file.
To fix this we must first destage any dirty pages in the range before we allow the pread() to proceed.
--- fs/cifs/file.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/cifs/file.c +9 -0
@@ -4015,6 +4015,15 @@ static ssize_t __cifs_readv( len = ctx->len; } +if (direct) { + rc =filemap_write_and_wait_range (file->f_inode->i_mapping, + offset, offset + len -1 ); +if (rc) { +kref_put (&ctx->refcount, cifs_aio_ctx_release); +return -EAGAIN ; + } + } +/* grab a lock here due to read response handlers can access ctx */ mutex_lock (&ctx->aio_mutex);
Greg Kroah-Hartman
maintainerPATCH 99/530 ext4: fix dir corruption when ext4_dx_add_entry() fails
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 7177dd009c7c04290891e9a534cd47d1b620bd04 upstream.
Following process may lead to fs corruption:
1. ext4_create(dir/foo)
ext4_add_nondir
ext4_add_entry
ext4_dx_add_entry
a. add_dirent_to_buf
ext4_mark_inode_dirty
ext4_handle_dirty_metadata // dir inode bh is recorded into journal
b. ext4_append // dx_get_count(entries) == dx_get_limit(entries)
ext4_bread(EXT4_GET_BLOCKS_CREATE)
ext4_getblk
ext4_map_blocks
ext4_ext_map_blocks
ext4_mb_new_blocks
dquot_alloc_block
dquot_alloc_space_nodirty
inode_add_bytes // update dir's i_blocks
ext4_ext_insert_extent
ext4_ext_dirty // record extent bh into journal
ext4_handle_dirty_metadata(bh)
// record new block into journal
inode->i_size += inode->i_sb->s_blocksize // new size(in mem)
c. ext4_handle_dirty_dx_node(bh2)
// record dir's new block(dx_node) into journal
d. ext4_handle_dirty_dx_node((frame - 1)->bh)
e. ext4_handle_dirty_dx_node(frame->bh)
f. do_split // ret err!
g. add_dirent_to_buf
ext4_mark_inode_dirty(dir) // update raw_inode on disk(skipped)2. fsck -a /dev/sdb
drop last block(dx_node) which beyonds dir's i_size.
/dev/sdb: recovering journal
/dev/sdb contains a file system with errors, check forced. /dev/sdb: Inode 12, end of extent exceeds allowed value
(logical block 128, physical block 3938, len 1)
3. fsck -fn /dev/sdb
dx_node->entry[i].blk > dir->i_size
Pass 2: Checking directory structure
Problem in HTREE directory inode 12 (/dir): bad block number 128. Clear HTree index? no
Problem in HTREE directory inode 12: block #3 has invalid depth (2) Problem in HTREE directory inode 12: block #3 has bad max hash Problem in HTREE directory inode 12: block #3 not referenced
Fix it by marking inode dirty directly inside ext4_append(). Fetch a reproducer in [Link].
--- fs/ext4/namei.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
fs/ext4/namei.c +10 -5
@@ -85,15 +85,20 @@ static struct buffer_head *ext4_append(hreturn bh; inode->i_size += inode->i_sb->s_blocksize;EXT4_I (inode)->i_disksize = inode->i_size; + err =ext4_mark_inode_dirty (handle, inode); +if (err) + goto out;BUFFER_TRACE (bh,"get_write_access" ); err =ext4_journal_get_write_access (handle, inode->i_sb, bh,EXT4_JTR_NONE ); -if (err) { -brelse (bh); -ext4_std_error (inode->i_sb, err); -return ERR_PTR (err); - } +if (err) + goto out;return bh; + +out: +brelse (bh); +ext4_std_error (inode->i_sb, err); +return ERR_PTR (err); } static int ext4_dx_csum_verify(struct inode *inode,
Greg Kroah-Hartman
maintainerPATCH 20/530 xhci: dbc: Fix memory leak in xhci_alloc_dbc()
In reply to Greg Kroah-HartmanFrom: Rafael Mendonca <[email protected]>
commit d591b32e519603524a35b172156db71df9116902 upstream.
If DbC is already in use, then the allocated memory for the xhci_dbc struct doesn't get freed before returning NULL, which leads to a memleak.
--- drivers/usb/host/xhci-dbgcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dbgcap.c +1 -1
@@ -988,7 +988,7 @@ xhci_alloc_dbc(struct device *dev, void dbc->driver = driver;if (readl (&dbc->regs->control) &DBC_CTRL_DBC_ENABLE ) -return NULL ; + goto err;INIT_DELAYED_WORK (&dbc->event_work, xhci_dbc_handle_events);spin_lock_init (&dbc->lock);
Greg Kroah-Hartman
maintainerPATCH 60/530 xen/gntdev: Accommodate VMA splitting
In reply to Greg Kroah-HartmanFrom: M. Vefa Bicakci <[email protected]>
commit 5c13a4a0291b30191eff9ead8d010e1ca43a4d0c upstream.
Prior to this commit, the gntdev driver code did not handle the following scenario correctly with paravirtualized (PV) Xen domains:
* User process sets up a gntdev mapping composed of two grant mappings (i.e., two pages shared by another Xen domain).
* User process munmap()s one of the pages.
* User process munmap()s the remaining page.
* User process exits.
In the scenario above, the user process would cause the kernel to log the following messages in dmesg for the first munmap(), and the second munmap() call would result in similar log messages:
BUG: Bad page map in process doublemap.test pte:... pmd:...
page:0000000057c97bff refcount:1 mapcount:-1 \
mapping:0000000000000000 index:0x0 pfn:...
...
page dumped because: bad pte
...
file:gntdev fault:0x0 mmap:gntdev_mmap [xen_gntdev] readpage:0x0
...
Call Trace:
<TASK>
dump_stack_lvl+0x46/0x5e
print_bad_pte.cold+0x66/0xb6
unmap_page_range+0x7e5/0xdc0
unmap_vmas+0x78/0xf0
unmap_region+0xa8/0x110
__do_munmap+0x1ea/0x4e0
__vm_munmap+0x75/0x120
__x64_sys_munmap+0x28/0x40
do_syscall_64+0x38/0x90
entry_SYSCALL_64_after_hwframe+0x61/0xcb
...For each munmap() call, the Xen hypervisor (if built with CONFIG_DEBUG) would print out the following and trigger a general protection fault in the affected Xen PV domain:
(XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ...
As of this writing, gntdev_grant_map structure's vma field (referred to as map->vma below) is mainly used for checking the start and end addresses of mappings. However, with split VMAs, these may change, and there could be more than one VMA associated with a gntdev mapping. Hence, remove the use of map->vma and rely on map->pages_vm_start for the original start address and on (map->count << PAGE_SHIFT) for the original mapping size. Let the invalidate() and find_special_page() hooks use these.
Also, given that there can be multiple VMAs associated with a gntdev mapping, move the "mmu_interval_notifier_remove(&map->notifier)" call to the end of gntdev_put_map, so that the MMU notifier is only removed after the closing of the last remaining VMA.
Finally, use an atomic to prevent inadvertent gntdev mapping re-use, instead of using the map->live_grants atomic counter and/or the map->vma pointer (the latter of which is now removed). This prevents the userspace from mmap()'ing (with MAP_FIXED) a gntdev mapping over the same address range as a previously set up gntdev mapping. This scenario can be summarized with the following call-trace, which was valid prior to this commit:
mmap
gntdev_mmap
mmap (repeat mmap with MAP_FIXED over the same address range)
gntdev_invalidate
unmap_grant_pages (sets 'being_removed' entries to true)
gnttab_unmap_refs_async
unmap_single_vma
gntdev_mmap (maps the shared pages again)
munmap
gntdev_invalidate
unmap_grant_pages
(no-op because 'being_removed' entries are true)
unmap_single_vma (For PV domains, Xen reports that a granted page
is being unmapped and triggers a general protection fault in the affected domain, if Xen was built with CONFIG_DEBUG)
The fix for this last scenario could be worth its own commit, but we opted for a single commit, because removing the gntdev_grant_map structure's vma field requires guarding the entry to gntdev_mmap(), and the live_grants atomic counter is not sufficient on its own to prevent the mmap() over a pre-existing mapping.
--- drivers/xen/gntdev-common.h | 3 +- drivers/xen/gntdev.c | 58 ++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 34 deletions(-)
drivers/xen/gntdev-common.h +2 -1
@@ -44,9 +44,10 @@ struct gntdev_unmap_notify { };struct gntdev_grant_map { +atomic_t in_use;struct mmu_interval_notifier notifier; +bool notifier_init;struct list_head next; -struct vm_area_struct *vma;int index;int count;int flags;
drivers/xen/gntdev.c +25 -33
131 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 12/530 hv_netvsc: Fix race between VF offering and VF association message from host
In reply to Greg Kroah-HartmanFrom: Gaurav Kohli <[email protected]>
commit 365e1ececb2905f94cc10a5817c5b644a32a3ae2 upstream.
During vm boot, there might be possibility that vf registration call comes before the vf association from host to vm.
And this might break netvsc vf path, To prevent the same block vf registration until vf bind message comes from host.
--- drivers/net/hyperv/hyperv_net.h | 3 ++- drivers/net/hyperv/netvsc.c | 4 ++++ drivers/net/hyperv/netvsc_drv.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-)
drivers/net/hyperv/hyperv_net.h +2 -1
@@ -1037,7 +1037,8 @@ struct net_device_context {u32 vf_alloc;/* Serial number of the VF to team with */ u32 vf_serial; - +/* completion variable to confirm vf association */ +struct completion vf_add;/* Is the current data path through the VF NIC? */ bool data_path_is_vf;
drivers/net/hyperv/netvsc.c +4 -0
@@ -1450,6 +1450,10 @@ static void netvsc_send_vf(struct net_de net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated; net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial; + +if (net_device_ctx->vf_alloc) +complete (&net_device_ctx->vf_add); +netdev_info (ndev,"VF slot %u %s\n" , net_device_ctx->vf_serial, net_device_ctx->vf_alloc ?"added" :"removed" );
drivers/net/hyperv/netvsc_drv.c +19 -0
@@ -2336,6 +2336,18 @@ static struct net_device *get_netvsc_bys } +/* Fallback path to check synthetic vf with +* help of mac addr +*/ +list_for_each_entry (ndev_ctx, &netvsc_dev_list, list) { + ndev =hv_get_drvdata (ndev_ctx->device_ctx); +if (ether_addr_equal (vf_netdev->perm_addr, ndev->perm_addr)) { +netdev_notice (vf_netdev, +"falling back to mac addr based matching\n" ); +return ndev; + } + } +netdev_notice (vf_netdev,"no netdev found for vf serial:%u\n" , serial);return NULL ;
@@ -2432,6 +2444,11 @@ static int netvsc_vf_changed(struct net_if (net_device_ctx->data_path_is_vf == vf_is_up)return NOTIFY_OK ; +if (vf_is_up && !net_device_ctx->vf_alloc) { +netdev_info (ndev,"Waiting for the VF association from host\n" ); +wait_for_completion (&net_device_ctx->vf_add); + } + ret =netvsc_switch_datapath (ndev, vf_is_up);if (ret) {
@@ -2463,6 +2480,7 @@ static int netvsc_unregister_vf(struct nnetvsc_vf_setxdp (vf_netdev,NULL ); +reinit_completion (&net_device_ctx->vf_add);netdev_rx_handler_unregister (vf_netdev);netdev_upper_dev_unlink (vf_netdev, ndev);RCU_INIT_POINTER (net_device_ctx->vf_netdev,NULL );
@@ -2502,6 +2520,7 @@ static int netvsc_probe(struct hv_deviceINIT_DELAYED_WORK (&net_device_ctx->dwork, netvsc_link_change); +init_completion (&net_device_ctx->vf_add);spin_lock_init (&net_device_ctx->lock);INIT_LIST_HEAD (&net_device_ctx->reconfig_events);INIT_DELAYED_WORK (&net_device_ctx->vf_takeover, netvsc_vf_setup);
Greg Kroah-Hartman
maintainerPATCH 59/530 xen/gntdev: Prevent leaking grants
In reply to Greg Kroah-HartmanFrom: M. Vefa Bicakci <[email protected]>
commit 0991028cd49567d7016d1b224fe0117c35059f86 upstream.
Prior to this commit, if a grant mapping operation failed partially, some of the entries in the map_ops array would be invalid, whereas all of the entries in the kmap_ops array would be valid. This in turn would cause the following logic in gntdev_map_grant_pages to become invalid:
for (i = 0; i < map->count; i++) {
if (map->map_ops[i].status == GNTST_okay) {
map->unmap_ops[i].handle = map->map_ops[i].handle;
if (!use_ptemod)
alloced++;
}
if (use_ptemod) {
if (map->kmap_ops[i].status == GNTST_okay) {
if (map->map_ops[i].status == GNTST_okay)
alloced++;
map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
}
}
}
...
atomic_add(alloced, &map->live_grants);Assume that use_ptemod is true (i.e., the domain mapping the granted pages is a paravirtualized domain). In the code excerpt above, note that the "alloced" variable is only incremented when both kmap_ops[i].status and map_ops[i].status are set to GNTST_okay (i.e., both mapping operations are successful). However, as also noted above, there are cases where a grant mapping operation fails partially, breaking the assumption of the code excerpt above.
The aforementioned causes map->live_grants to be incorrectly set. In some cases, all of the map_ops mappings fail, but all of the kmap_ops mappings succeed, meaning that live_grants may remain zero. This in turn makes it impossible to unmap the successfully grant-mapped pages pointed to by kmap_ops, because unmap_grant_pages has the following snippet of code at its beginning:
if (atomic_read(&map->live_grants) == 0)
return; /* Nothing to do */
In other cases where only some of the map_ops mappings fail but all kmap_ops mappings succeed, live_grants is made positive, but when the user requests unmapping the grant-mapped pages, __unmap_grant_pages_done will then make map->live_grants negative, because the latter function does not check if all of the pages that were requested to be unmapped were actually unmapped, and the same function unconditionally subtracts "data->count" (i.e., a value that can be greater than map->live_grants) from map->live_grants. The side effects of a negative live_grants value have not been studied.
The net effect of all of this is that grant references are leaked in one of the above conditions. In Qubes OS v4.1 (which uses Xen's grant mechanism extensively for X11 GUI isolation), this issue manifests itself with warning messages like the following to be printed out by the Linux kernel in the VM that had granted pages (that contain X11 GUI window data) to dom0: "g.e. 0x1234 still pending", especially after the user rapidly resizes GUI VM windows (causing some grant-mapping operations to partially or completely fail, due to the fact that the VM unshares some of the pages as part of the window resizing, making the pages impossible to grant-map from dom0).
The fix for this issue involves counting all successful map_ops and kmap_ops mappings separately, and then adding the sum to live_grants. During unmapping, only the number of successfully unmapped grants is subtracted from live_grants. The code is also modified to check for negative live_grants values after the subtraction and warn the user.
--- drivers/xen/gntdev.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
drivers/xen/gntdev.c +17 -5
@@ -367,8 +367,7 @@ int gntdev_map_grant_pages(struct gntdevfor (i =0 ; i < map->count; i++) {if (map->map_ops[i].status == GNTST_okay) { map->unmap_ops[i].handle = map->map_ops[i].handle; -if (!use_ptemod) - alloced++; + alloced++; }else if (!err) err = -EINVAL ;
@@ -377,8 +376,7 @@ int gntdev_map_grant_pages(struct gntdevif (use_ptemod) {if (map->kmap_ops[i].status == GNTST_okay) { -if (map->map_ops[i].status == GNTST_okay) - alloced++; + alloced++; map->kunmap_ops[i].handle = map->kmap_ops[i].handle; }else if (!err) err = -EINVAL ;
@@ -394,8 +392,14 @@ static void __unmap_grant_pages_done(intunsigned int i;struct gntdev_grant_map *map = data->data;unsigned int offset = data->unmap_ops - map->unmap_ops; +int successful_unmaps =0 ; +int live_grants;for (i =0 ; i < data->count; i++) { +if (map->unmap_ops[offset + i].status == GNTST_okay && + map->unmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ) + successful_unmaps++; +WARN_ON (map->unmap_ops[offset + i].status != GNTST_okay && map->unmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ); pr_debug("unmap handle=%d st=%d\n",
@@ -403,6 +407,10 @@ static void __unmap_grant_pages_done(int map->unmap_ops[offset+i].status); map->unmap_ops[offset+i].handle =INVALID_GRANT_HANDLE ;if (use_ptemod) { +if (map->kunmap_ops[offset + i].status == GNTST_okay && + map->kunmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ) + successful_unmaps++; +WARN_ON (map->kunmap_ops[offset + i].status != GNTST_okay && map->kunmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ); pr_debug("kunmap handle=%u st=%d\n",
@@ -411,11 +419,15 @@ static void __unmap_grant_pages_done(int map->kunmap_ops[offset+i].handle =INVALID_GRANT_HANDLE ; } } +/* * Decrease the live-grant counter. This must happen after the loop to * prevent premature reuse of the grants by gnttab_mmap(). */ -atomic_sub (data->count, &map->live_grants); + live_grants =atomic_sub_return (successful_unmaps, &map->live_grants); +if (WARN_ON (live_grants <0 )) +pr_err ("%s: live_grants became negative (%d) after unmapping %d pages!\n" , + __func__, live_grants, successful_unmaps);/* Release reference taken by __unmap_grant_pages */ gntdev_put_map (NULL , map);
Greg Kroah-Hartman
maintainerPATCH 58/530 mm/mmap: undo ->mmap() when arch_validate_flags() fails
In reply to Greg Kroah-HartmanFrom: Carlos Llamas <[email protected]>
commit deb0f6562884b5b4beb883d73e66a7d3a1b96d99 upstream.
Commit c462ac288f2c ("mm: Introduce arch_validate_flags()") added a late check in mmap_region() to let architectures validate vm_flags. The check needs to happen after calling ->mmap() as the flags can potentially be modified during this callback.
If arch_validate_flags() check fails we unmap and free the vma. However, the error path fails to undo the ->mmap() call that previously succeeded and depending on the specific ->mmap() implementation this translates to reference increments, memory allocations and other operations what will not be cleaned up.
There are several places (mainly device drivers) where this is an issue. However, one specific example is bpf_map_mmap() which keeps count of the mappings in map->writecnt. The count is incremented on ->mmap() and then decremented on vm_ops->close(). When arch_validate_flags() fails this count is off since bpf_map_mmap_close() is never called.
One can reproduce this issue in arm64 devices with MTE support. Here the vm_flags are checked to only allow VM_MTE if VM_MTE_ALLOWED has been set previously. From userspace then is enough to pass the PROT_MTE flag to mmap() syscall to trigger the arch_validate_flags() failure.
The following program reproduces this issue:
#include <stdio.h> #include <unistd.h> #include <linux/unistd.h> #include <linux/bpf.h> #include <sys/mman.h>
int main(void)
{
union bpf_attr attr = {
.map_type = BPF_MAP_TYPE_ARRAY,
.key_size = sizeof(int),
.value_size = sizeof(long long),
.max_entries = 256,
.map_flags = BPF_F_MMAPABLE,
};
int fd;
fd = syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr));
mmap(NULL, 4096, PROT_WRITE | PROT_MTE, MAP_SHARED, fd, 0);
return 0;}
By manually adding some log statements to the vm_ops callbacks we can confirm that when passing PROT_MTE to mmap() the map->writecnt is off upon ->release():
With PROT_MTE flag:
root@debian:~# ./bpf-test [ 111.263874] bpf_map_write_active_inc: map=9 writecnt=1 [ 111.288763] bpf_map_release: map=9 writecnt=1
Without PROT_MTE flag:
root@debian:~# ./bpf-test [ 157.816912] bpf_map_write_active_inc: map=10 writecnt=1 [ 157.830442] bpf_map_write_active_dec: map=10 writecnt=0 [ 157.832396] bpf_map_release: map=10 writecnt=0
This patch fixes the above issue by calling vm_ops->close() when the arch_validate_flags() check fails, after this we can proceed to unmap and free the vma on the error path.
--- mm/mmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
mm/mmap.c +4 -1
@@ -1836,7 +1836,7 @@ unsigned long mmap_region(struct file *fif (!arch_validate_flags (vma->vm_flags)) { error = -EINVAL ;if (file) - goto unmap_and_free_vma; + goto close_and_free_vma;else goto free_vma; }
@@ -1876,6 +1876,9 @@ out:return addr; +close_and_free_vma: +if (vma->vm_ops && vma->vm_ops->close) + vma->vm_ops->close (vma); unmap_and_free_vma:fput (vma->vm_file); vma->vm_file =NULL ;
Greg Kroah-Hartman
maintainerPATCH 199/530 tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited
In reply to Greg Kroah-HartmanFrom: Neal Cardwell <[email protected]>
[ Upstream commit f4ce91ce12a7c6ead19b128ffa8cff6e3ded2a14 ]
This commit fixes a bug in the tracking of max_packets_out and is_cwnd_limited. This bug can cause the connection to fail to remember that is_cwnd_limited is true, causing the connection to fail to grow cwnd when it should, causing throughput to be lower than it should be.
The following event sequence is an example that triggers the bug:
(a) The connection is cwnd_limited, but packets_out is not at its peak due to TSO deferral deciding not to send another skb yet. In such cases the connection can advance max_packets_seq and set tp->is_cwnd_limited to true and max_packets_out to a small number.
(b) Then later in the round trip the connection is pacing-limited (not cwnd-limited), and packets_out is larger. In such cases the connection would raise max_packets_out to a bigger number but (unexpectedly) flip tp->is_cwnd_limited from true to false.
This commit fixes that bug.
One straightforward fix would be to separately track (a) the next window after max_packets_out reaches a maximum, and (b) the next window after tp->is_cwnd_limited is set to true. But this would require consuming an extra u32 sequence number.
Instead, to save space we track only the most important information. Specifically, we track the strongest available signal of the degree to which the cwnd is fully utilized:
(1) If the connection is cwnd-limited then we remember that fact for the current window.
(2) If the connection not cwnd-limited then we track the maximum number of outstanding packets in the current window.
In particular, note that the new logic cannot trigger the buggy (a)/(b) sequence above because with the new logic a condition where tp->packets_out > tp->max_packets_out can only trigger an update of tp->is_cwnd_limited if tp->is_cwnd_limited is false.
This first showed up in a testing of a BBRv2 dev branch, but this buggy behavior highlighted a general issue with the tcp_cwnd_validate() logic that can cause cwnd to fail to increase at the proper rate for any TCP congestion control, including Reno or CUBIC.
--- include/linux/tcp.h | 2 +- include/net/tcp.h | 5 ++++- net/ipv4/tcp.c | 2 ++ net/ipv4/tcp_output.c | 19 ++++++++++++------- 4 files changed, 19 insertions(+), 9 deletions(-)
include/linux/tcp.h +1 -1
@@ -265,7 +265,7 @@ struct tcp_sock {u32 packets_out;/* Packets which are "in flight" */ u32 retrans_out;/* Retransmitted packets out */ u32 max_packets_out;/* max packets_out in last window */ -u32 max_packets_seq;/* right edge of max_packets_out flight */ +u32 cwnd_usage_seq;/* right edge of cwnd usage tracking flight */ u16 urg_data;/* Saved octet of OOB data and control flags */ u8 ecn_flags;/* ECN status bits. */
include/net/tcp.h +4 -1
@@ -1281,11 +1281,14 @@ static inline bool tcp_is_cwnd_limited(const struct sock *sk) {const struct tcp_sock *tp =tcp_sk (sk); +if (tp->is_cwnd_limited) +return true; +/* If in slow start, ensure cwnd grows to twice what was ACKed. */ if (tcp_in_slow_start (tp))return tcp_snd_cwnd (tp) <2 * tp->max_packets_out; -return tp->is_cwnd_limited; +return false; }/* BBR congestion control needs pacing.
net/ipv4/tcp.c +2 -0
@@ -3025,6 +3025,8 @@ int tcp_disconnect(struct sock *sk, int flags) tp->snd_ssthresh =TCP_INFINITE_SSTHRESH ;tcp_snd_cwnd_set (tp,TCP_INIT_CWND ); tp->snd_cwnd_cnt =0 ; + tp->is_cwnd_limited =0 ; + tp->max_packets_out =0 ; tp->window_clamp =0 ; tp->delivered =0 ; tp->delivered_ce =0 ;
net/ipv4/tcp_output.c +12 -7
@@ -1878,15 +1878,20 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited)const struct tcp_congestion_ops *ca_ops =inet_csk (sk)->icsk_ca_ops;struct tcp_sock *tp =tcp_sk (sk); -/* Track the maximum number of outstanding packets in each -* window, and remember whether we were cwnd-limited then. +/* Track the strongest available signal of the degree to which the cwnd +* is fully utilized. If cwnd-limited then remember that fact for the +* current window. If not cwnd-limited then track the maximum number of +* outstanding packets in the current window. (If cwnd-limited then we +* chose to not update tp->max_packets_out to avoid an extra else +* clause with no functional impact.) */ -if (!before (tp->snd_una, tp->max_packets_seq) || - tp->packets_out > tp->max_packets_out || - is_cwnd_limited) { - tp->max_packets_out = tp->packets_out; - tp->max_packets_seq = tp->snd_nxt; +if (!before (tp->snd_una, tp->cwnd_usage_seq) || + is_cwnd_limited || + (!tp->is_cwnd_limited && + tp->packets_out > tp->max_packets_out)) { tp->is_cwnd_limited = is_cwnd_limited; + tp->max_packets_out = tp->packets_out; + tp->cwnd_usage_seq = tp->snd_nxt; }if (tcp_is_cwnd_limited (sk)) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 201/530 hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller
In reply to Greg Kroah-HartmanFrom: Oleksandr Shamray <[email protected]>
[ Upstream commit 525dd5aed67a2f4f7278116fb92a24e6a53e2622 ]
Fix scale factors for reading MPS Multi-phase mp2888 controller. Fixed sensors:
- PIN/POUT: based on vendor documentation, set bscale factor 0.5W/LSB
- IOUT: based on vendor documentation, set scale factor 0.25 A/LSB
--- drivers/hwmon/pmbus/mp2888.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/hwmon/pmbus/mp2888.c +6 -7
@@ -34,7 +34,7 @@ struct mp2888_data {int curr_sense_gain; }; -#define to_mp2888_data (x) container_of(x, struct mp2888_data, info) +#define to_mp2888_data (x) container_of(x, struct mp2888_data, info)static int mp2888_read_byte_data (struct i2c_client *client,int page,int reg) {
@@ -109,7 +109,7 @@ mp2888_read_phase(struct i2c_client *client, struct mp2888_data *data, int page,* - Kcs is the DrMOS current sense gain of power stage, which is obtained from the * register MP2888_MFR_VR_CONFIG1, bits 13-12 with the following selection of DrMOS * (data->curr_sense_gain): -* 00b - 5µA/A, 01b - 8.5µA/A, 10b - 9.7µA/A, 11b - 10µA/A. +* 00b - 8.5µA/A, 01b - 9.7µA/A, 1b - 10µA/A, 11b - 5µA/A. * - Rcs is the internal phase current sense resistor. This parameter depends on hardware * assembly. By default it is set to 1kΩ. In case of different assembly, user should * scale this parameter by dividing it by Rcs.
@@ -118,10 +118,9 @@ mp2888_read_phase(struct i2c_client *client, struct mp2888_data *data, int page,* because sampling of current occurrence of bit weight has a big deviation, especially for * light load. */ - ret =DIV_ROUND_CLOSEST (ret *100 -9800 , data->curr_sense_gain); - ret = (data->phase_curr_resolution) ? ret *2 : ret; + ret =DIV_ROUND_CLOSEST (ret *200 -19600 , data->curr_sense_gain);/* Scale according to total current resolution. */ - ret = (data->total_curr_resolution) ? ret *8 : ret *4 ; + ret = (data->total_curr_resolution) ? ret *2 : ret;return ret; }
@@ -212,7 +211,7 @@ static int mp2888_read_word_data(struct i2c_client *client, int page, int phase, ret =pmbus_read_word_data (client, page, phase, reg);if (ret <0 )return ret; - ret = data->total_curr_resolution ? ret *2 : ret; + ret = data->total_curr_resolution ? ret :DIV_ROUND_CLOSEST (ret,2 );break ;case PMBUS_POUT_OP_WARN_LIMIT : ret =pmbus_read_word_data (client, page, phase, reg);
@@ -223,7 +222,7 @@ static int mp2888_read_word_data(struct i2c_client *client, int page, int phase,* set 1. Actual power is reported with 0.5W or 1W respectively resolution. Scaling * is needed to match both. */ - ret = data->total_curr_resolution ? ret *4 : ret *2 ; + ret = data->total_curr_resolution ? ret *2 : ret;break ;/* * The below registers are not implemented by device or implemented not according to the
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 197/530 mISDN: fix use-after-free bugs in l1oip timer handlers
In reply to Greg Kroah-HartmanFrom: Duoming Zhou <[email protected]>
[ Upstream commit 2568a7e0832ee30b0a351016d03062ab4e0e0a3f ]
The l1oip_cleanup() traverses the l1oip_ilist and calls release_card() to cleanup module and stack. However, release_card() calls del_timer() to delete the timers such as keep_tl and timeout_tl. If the timer handler is running, the del_timer() will not stop it and result in UAF bugs. One of the processes is shown below:
(cleanup routine) | (timer handler)
release_card() | l1oip_timeout()
... |
del_timer() | ...
... |
kfree(hc) //FREE |
| hc->timeout_on = 0 //USEFix by calling del_timer_sync() in release_card(), which makes sure the timer handlers have finished before the resources, such as l1oip and so on, have been deallocated.
What's more, the hc->workq and hc->socket_thread can kick those timers right back in. We add a bool flag to show if card is released. Then, check this flag in hc->workq and hc->socket_thread.
--- drivers/isdn/mISDN/l1oip.h | 1 + drivers/isdn/mISDN/l1oip_core.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/isdn/mISDN/l1oip.h +1 -0
@@ -59,6 +59,7 @@ struct l1oip {int bundle;/* bundle channels in one frm */ int codec;/* codec to use for transmis. */ int limit;/* limit number of bchannels */ +bool shutdown;/* if card is released */ /* timer */ struct timer_list keep_tl;
drivers/isdn/mISDN/l1oip_core.c +7 -6
@@ -275,7 +275,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, p = frame;/* restart timer */ -if (time_before (hc->keep_tl.expires, jiffies +5 *HZ )) +if (time_before (hc->keep_tl.expires, jiffies +5 *HZ ) && !hc->shutdown)mod_timer (&hc->keep_tl, jiffies +L1OIP_KEEPALIVE *HZ );else hc->keep_tl.expires = jiffies +L1OIP_KEEPALIVE *HZ ;
@@ -601,7 +601,9 @@ l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len) goto multiframe;/* restart timer */ -if (time_before (hc->timeout_tl.expires, jiffies +5 *HZ ) || !hc->timeout_on) { +if ((time_before (hc->timeout_tl.expires, jiffies +5 *HZ ) || + !hc->timeout_on) && + !hc->shutdown) { hc->timeout_on =1 ;mod_timer (&hc->timeout_tl, jiffies +L1OIP_TIMEOUT *HZ ); }else /* only adjust timer */
@@ -1232,11 +1234,10 @@ release_card(struct l1oip *hc) {int ch; -if (timer_pending (&hc->keep_tl)) -del_timer (&hc->keep_tl); + hc->shutdown = true; -if (timer_pending (&hc->timeout_tl)) -del_timer (&hc->timeout_tl); +del_timer_sync (&hc->keep_tl); +del_timer_sync (&hc->timeout_tl);cancel_work_sync (&hc->workq);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 198/530 sctp: handle the error returned from sctp_auth_asoc_init_active_key
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 022152aaebe116a25c39818a07e175a8cd3c1e11 ]
When it returns an error from sctp_auth_asoc_init_active_key(), the active_key is actually not updated. The old sh_key will be freeed while it's still used as active key in asoc. Then an use-after-free will be triggered when sending patckets, as found by syzbot:
sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112 sctp_set_owner_w net/sctp/socket.c:132 [inline] sctp_sendmsg_to_asoc+0xbd5/0x1a20 net/sctp/socket.c:1863 sctp_sendmsg+0x1053/0x1d50 net/sctp/socket.c:2025 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734
This patch is to fix it by not replacing the sh_key when it returns errors from sctp_auth_asoc_init_active_key() in sctp_auth_set_key(). For sctp_auth_set_active_key(), old active_key_id will be set back to asoc->active_key_id when the same thing happens.
--- net/sctp/auth.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
net/sctp/auth.c +14 -4
@@ -863,12 +863,17 @@ int sctp_auth_set_key(struct sctp_endpoint *ep, }list_del_init (&shkey->key_list); -sctp_auth_shkey_release (shkey);list_add (&cur_key->key_list, sh_keys); -if (asoc && asoc->active_key_id == auth_key->sca_keynumber) -sctp_auth_asoc_init_active_key (asoc,GFP_KERNEL ); +if (asoc && asoc->active_key_id == auth_key->sca_keynumber && +sctp_auth_asoc_init_active_key (asoc,GFP_KERNEL )) { +list_del_init (&cur_key->key_list); +sctp_auth_shkey_release (cur_key); +list_add (&shkey->key_list, sh_keys); +return -ENOMEM ; + } +sctp_auth_shkey_release (shkey);return 0 ; }
@@ -902,8 +907,13 @@ int sctp_auth_set_active_key(struct sctp_endpoint *ep,return -EINVAL ;if (asoc) { +__u16 active_key_id = asoc->active_key_id; + asoc->active_key_id = key_id; -sctp_auth_asoc_init_active_key (asoc,GFP_KERNEL ); +if (sctp_auth_asoc_init_active_key (asoc,GFP_KERNEL )) { + asoc->active_key_id = active_key_id; +return -ENOMEM ; + } }else ep->active_key_id = key_id;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 240/530 mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit cb58188ad90a61784a56a64f5107faaf2ad323e7 ]
A dma_free_coherent() call is missing in the error handling path of the probe, as already done in the remove function.
--- drivers/mmc/host/wmt-sdmmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mmc/host/wmt-sdmmc.c +4 -1
@@ -849,7 +849,7 @@ static int wmt_mci_probe(struct platform_device *pdev)if (IS_ERR (priv->clk_sdmmc)) {dev_err (&pdev->dev,"Error getting clock\n" ); ret =PTR_ERR (priv->clk_sdmmc); - goto fail5; + goto fail5_and_a_half; } ret =clk_prepare_enable (priv->clk_sdmmc);
@@ -866,6 +866,9 @@ static int wmt_mci_probe(struct platform_device *pdev)return 0 ; fail6:clk_put (priv->clk_sdmmc); +fail5_and_a_half: +dma_free_coherent (&pdev->dev, mmc->max_blk_count *16 , + priv->dma_desc_buffer, priv->dma_desc_device_addr); fail5:free_irq (dma_irq, priv); fail4:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 242/530 ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of wm5110_probe.
--- sound/soc/codecs/wm5110.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm5110.c +3 -3
@@ -2458,9 +2458,6 @@ static int wm5110_probe(struct platform_device *pdev)regmap_update_bits (arizona->regmap, wm5110_digital_vu[i],WM5110_DIG_VU ,WM5110_DIG_VU ); -pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev); - ret =arizona_request_irq (arizona,ARIZONA_IRQ_DSP_IRQ1 ,"ADSP2 Compressed IRQ" , wm5110_adsp2_irq, wm5110);
@@ -2493,6 +2490,9 @@ static int wm5110_probe(struct platform_device *pdev) goto err_spk_irqs; } +pm_runtime_enable (&pdev->dev); +pm_runtime_idle (&pdev->dev); +return ret; err_spk_irqs:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 194/530 wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
[ Upstream commit 5574d3290449916397f3092dcd2bac92415498e1 ]
ieee80211_tx_queue_params.aifs is not supposed to be written directly to the REG_EDCA_*_PARAM registers. Instead process it like the vendor drivers do. It's kinda hacky but it works.
This change boosts the download speed and makes it more stable.
Tested with RTL8188FU but all the other supported chips should also benefit.
--- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +49 -0
@@ -4507,6 +4507,53 @@ rtl8xxxu_wireless_mode(struct ieee80211_hw *hw, struct ieee80211_sta *sta)return network_type; } +static void rtl8xxxu_set_aifs (struct rtl8xxxu_priv *priv,u8 slot_time) +{ +u32 reg_edca_param[IEEE80211_NUM_ACS ] = { + [IEEE80211_AC_VO ] =REG_EDCA_VO_PARAM , + [IEEE80211_AC_VI ] =REG_EDCA_VI_PARAM , + [IEEE80211_AC_BE ] =REG_EDCA_BE_PARAM , + [IEEE80211_AC_BK ] =REG_EDCA_BK_PARAM , + }; +u32 val32; +u16 wireless_mode =0 ; +u8 aifs, aifsn, sifs; +int i; + +if (priv->vif) { +struct ieee80211_sta *sta; + +rcu_read_lock (); + sta =ieee80211_find_sta (priv->vif, priv->vif->bss_conf.bssid); +if (sta) + wireless_mode =rtl8xxxu_wireless_mode (priv->hw, sta); +rcu_read_unlock (); + } + +if (priv->hw->conf.chandef.chan->band ==NL80211_BAND_5GHZ || + (wireless_mode &WIRELESS_MODE_N_24G )) + sifs =16 ; +else + sifs =10 ; + +for (i =0 ; i <IEEE80211_NUM_ACS ; i++) { + val32 =rtl8xxxu_read32 (priv, reg_edca_param[i]); + +/* It was set in conf_tx. */ + aifsn = val32 &0xff ; + +/* aifsn not set yet or already fixed */ +if (aifsn <2 || aifsn >15 ) +continue ; + + aifs = aifsn * slot_time + sifs; + + val32 &= ~0xff ; + val32 |= aifs; +rtl8xxxu_write32 (priv, reg_edca_param[i], val32); + } +} +static void rtl8xxxu_bss_info_changed (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_bss_conf *bss_conf,u32 changed)
@@ -4592,6 +4639,8 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,else val8 =20 ;rtl8xxxu_write8 (priv,REG_SLOT , val8); + +rtl8xxxu_set_aifs (priv, val8); }if (changed &BSS_CHANGED_BSSID ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 203/530 bnx2x: fix potential memory leak in bnx2x_tpa_stop()
In reply to Greg Kroah-HartmanFrom: Jianglei Nie <[email protected]>
[ Upstream commit b43f9acbb8942b05252be83ac25a81cec70cc192 ]
bnx2x_tpa_stop() allocates a memory chunk from new_data with bnx2x_frag_alloc(). The new_data should be freed when gets some error. But when "pad + len > fp->rx_buf_size" is true, bnx2x_tpa_stop() returns without releasing the new_data, which will lead to a memory leak.
We should free the new_data with bnx2x_frag_free() when "pad + len > fp->rx_buf_size" is true.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -0
@@ -788,6 +788,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,BNX2X_ERR ("skb_put is about to fail... pad %d len %d rx_buf_size %d\n" , pad, len, fp->rx_buf_size);bnx2x_panic (); +bnx2x_frag_free (fp, new_data); return; }#endif
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 238/530 ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit abb4e4349afe7eecdb0499582f1c777031e3a7c8 ]
If clk_hw_register() fails, the corresponding clk should not be unregistered.
To handle errors from loops, clean up partial iterations before doing the goto. So add a clk_hw_unregister().
Then use a while (--i >= 0) loop in the unwind section.
--- sound/soc/codecs/da7219.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/codecs/da7219.c +3 -2
@@ -2196,6 +2196,7 @@ static int da7219_register_dai_clks(struct snd_soc_component *component) dai_clk_lookup =clkdev_hw_create (dai_clk_hw, init.name,"%s" ,dev_name (dev));if (!dai_clk_lookup) { +clk_hw_unregister (dai_clk_hw); ret = -ENOMEM ; goto err; }else {
@@ -2217,12 +2218,12 @@ static int da7219_register_dai_clks(struct snd_soc_component *component)return 0 ; err: -do { +while (--i >=0 ) {if (da7219->dai_clks_lookup[i])clkdev_drop (da7219->dai_clks_lookup[i]);clk_hw_unregister (&da7219->dai_clks_hw[i]); - }while (i-- >0 ); + }if (np)kfree (da7219->clk_hw_data);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 132/530 drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier
In reply to Greg Kroah-HartmanFrom: Ville Syrjälä <[email protected]>
commit 070a2855900de17b1e11a0dc35af9794e80f1a28 upstream.
Take the gen12+ CCS+CC modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this Y-tiled modifier is linear.
The rc_surface part is actually a nop since that is not used for any glk+ platform.
--- drivers/gpu/drm/i915/intel_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +4 -2
@@ -5404,12 +5404,14 @@ skl_compute_wm_params(const struct intel modifier ==I915_FORMAT_MOD_Y_TILED_CCS || modifier == I915_FORMAT_MOD_Yf_TILED_CCS || modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ; + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC ; wp->x_tiled = modifier ==I915_FORMAT_MOD_X_TILED ; wp->rc_surface = modifier ==I915_FORMAT_MOD_Y_TILED_CCS || modifier == I915_FORMAT_MOD_Yf_TILED_CCS || modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS || - modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ; + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC ; wp->is_planar =intel_format_info_is_yuv_semiplanar (format, modifier); wp->width = width;
Greg Kroah-Hartman
maintainerPATCH 245/530 ALSA: hda/hdmi: Dont skip notification handling during PM operation
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 5226c7b9784eee215e3914f440b3c2e1764f67a8 ]
The HDMI driver skips the notification handling from the graphics driver when the codec driver is being in the PM operation. This behavior was introduced by the commit eb399d3c99d8 ("ALSA: hda - Skip ELD notification during PM process"). This skip may cause a problem, as we may miss the ELD update when the connection/disconnection happens right at the runtime-PM operation of the audio codec.
Although this workaround was valid at that time, it's no longer true; the fix was required just because the ELD update procedure needed to wake up the audio codec, which had lead to a runtime-resume during a runtime-suspend. Meanwhile, the ELD update procedure doesn't need a codec wake up any longer since the commit 788d441a164c ("ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling"); i.e. there is no much reason for skipping the notification.
Let's drop those checks for addressing the missing notification.
--- sound/pci/hda/patch_hdmi.c | 6 ------ 1 file changed, 6 deletions(-)
sound/pci/hda/patch_hdmi.c +0 -6
@@ -2685,9 +2685,6 @@ static void generic_acomp_pin_eld_notify(void *audio_ptr, int port, int dev_id)*/ if (codec->core.dev.power.power_state.event ==PM_EVENT_SUSPEND )return ; -/* ditto during suspend/resume process itself */ -if (snd_hdac_is_in_pm (&codec->core)) -return ;check_presence_and_report (codec, pin_nid, dev_id); }
@@ -2871,9 +2868,6 @@ static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe)*/ if (codec->core.dev.power.power_state.event ==PM_EVENT_SUSPEND )return ; -/* ditto during suspend/resume process itself */ -if (snd_hdac_is_in_pm (&codec->core)) -return ;snd_hdac_i915_set_bclk (&codec->bus->core);check_presence_and_report (codec, pin_nid, dev_id);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 246/530 memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe()
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 61b3c876c1cbdb1efd1f52a1f348580e6e14efb6 ]
The break of for_each_available_child_of_node() needs a corresponding of_node_put() when the reference 'child' is not used anymore. Here we do not need to call of_node_put() in fail path as '!match' means no break.
While the of_platform_device_create() will created a new reference by 'child' but it has considered the refcounting.
--- drivers/memory/pl353-smc.c | 1 + 1 file changed, 1 insertion(+)
drivers/memory/pl353-smc.c +1 -0
@@ -122,6 +122,7 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id) }of_platform_device_create (child,NULL , &adev->dev); +of_node_put (child);return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 249/530 locks: fix TOCTOU race when granting write lease
In reply to Greg Kroah-HartmanFrom: Amir Goldstein <[email protected]>
[ Upstream commit d6da19c9cace63290ccfccb1fc35151ffefc0bec ]
Thread A trying to acquire a write lease checks the value of i_readcount and i_writecount in check_conflicting_open() to verify that its own fd is the only fd referencing the file.
Thread B trying to open the file for read will call break_lease() in do_dentry_open() before incrementing i_readcount, which leaves a small window where thread A can acquire the write lease and then thread B completes the open of the file for read without breaking the write lease that was acquired by thread A.
Fix this race by incrementing i_readcount before checking for existing leases, same as the case with i_writecount.
Use a helper put_file_access() to decrement i_readcount or i_writecount in do_dentry_open() and __fput().
--- fs/file_table.c | 7 +------ fs/internal.h | 10 ++++++++++ fs/open.c | 11 ++++------- 3 files changed, 15 insertions(+), 13 deletions(-)
fs/file_table.c +1 -6
@@ -284,12 +284,7 @@ static void __fput(struct file *file) }fops_put (file->f_op);put_pid (file->f_owner.pid); -if ((mode & (FMODE_READ |FMODE_WRITE )) ==FMODE_READ ) -i_readcount_dec (inode); -if (mode &FMODE_WRITER ) { -put_write_access (inode); -__mnt_drop_write (mnt); - } +put_file_access (file);dput (dentry);if (unlikely (mode &FMODE_NEED_UNMOUNT ))dissolve_on_fput (mnt);
fs/internal.h +10 -0
@@ -100,6 +100,16 @@ extern void chroot_fs_refs(const struct path *, const struct path *);extern struct file *alloc_empty_file (int ,const struct cred *);extern struct file *alloc_empty_file_noaccount (int ,const struct cred *); +static inline void put_file_access (struct file *file) +{ +if ((file->f_mode & (FMODE_READ |FMODE_WRITE )) ==FMODE_READ ) { +i_readcount_dec (file->f_inode); + }else if (file->f_mode &FMODE_WRITER ) { +put_write_access (file->f_inode); +__mnt_drop_write (file->f_path.mnt); + } +} +/* * super.c */
fs/open.c +4 -7
@@ -786,7 +786,9 @@ static int do_dentry_open(struct file *f,return 0 ; } -if (f->f_mode &FMODE_WRITE && !special_file (inode->i_mode)) { +if ((f->f_mode & (FMODE_READ |FMODE_WRITE )) ==FMODE_READ ) { +i_readcount_inc (inode); + }else if (f->f_mode &FMODE_WRITE && !special_file (inode->i_mode)) { error =get_write_access (inode);if (unlikely (error)) goto cleanup_file;
@@ -826,8 +828,6 @@ static int do_dentry_open(struct file *f, goto cleanup_all; } f->f_mode |=FMODE_OPENED ; -if ((f->f_mode & (FMODE_READ |FMODE_WRITE )) ==FMODE_READ ) -i_readcount_inc (inode);if ((f->f_mode &FMODE_READ ) &&likely (f->f_op->read || f->f_op->read_iter)) f->f_mode |=FMODE_CAN_READ ;
@@ -880,10 +880,7 @@ static int do_dentry_open(struct file *f,if (WARN_ON_ONCE (error >0 )) error = -EINVAL ;fops_put (f->f_op); -if (f->f_mode &FMODE_WRITER ) { -put_write_access (inode); -__mnt_drop_write (f->f_path.mnt); - } +put_file_access (f); cleanup_file:path_put (&f->f_path); f->f_path.mnt =NULL ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 252/530 ARM: dts: imx6qdl-kontron-samx6i: hook up DDC i2c bus
In reply to Greg Kroah-HartmanFrom: Lucas Stach <[email protected]>
[ Upstream commit afd8f77957e3e83adf21d9229c61ff37f44a177a ]
i2c2 is routed to the pins dedicated as DDC in the module standard. Reduce clock rate to 100kHz to be in line with VESA standard and hook this bus up to the HDMI node.
--- arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi +5 -1
@@ -263,6 +263,10 @@ phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; }; +&hdmi { + ddc-i2c-bus = <&i2c2>; +}; + &i2c_intern { pmic@8 { compatible = "fsl,pfuze100";
@@ -387,7 +391,7 @@ /* HDMI_CTRL */ &i2c2 { - clock-frequency = <375000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 248/530 memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings()
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 48af14fb0eaa63d9aa68f59fb0b205ec55a95636 ]
We should add the of_node_put() when breaking out of for_each_child_of_node() as it will automatically increase and decrease the refcount.
--- drivers/memory/of_memory.c | 1 + 1 file changed, 1 insertion(+)
drivers/memory/of_memory.c +1 -0
@@ -283,6 +283,7 @@ const struct lpddr3_timingsif (of_device_is_compatible (np_tim, tim_compat)) {if (of_lpddr3_do_get_timings (np_tim, &timings[i])) {devm_kfree (dev, timings); +of_node_put (np_tim); goto default_timings; } i++;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 179/530 bpf: Ensure correct locking around vulnerable function find_vpid()
In reply to Greg Kroah-HartmanFrom: Lee Jones <[email protected]>
[ Upstream commit 83c10cc362d91c0d8d25e60779ee52fdbbf3894d ]
The documentation for find_vpid() clearly states:
"Must be called with the tasklist_lock or rcu_read_lock() held."
Presently we do neither for find_vpid() instance in bpf_task_fd_query(). Add proper rcu_read_lock/unlock() to fix the issue.
--- kernel/bpf/syscall.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/bpf/syscall.c +2 -0
@@ -4100,7 +4100,9 @@ static int bpf_task_fd_query(const union bpf_attr *attr,if (attr->task_fd_query.flags !=0 )return -EINVAL ; +rcu_read_lock (); task =get_pid_task (find_vpid (pid),PIDTYPE_PID ); +rcu_read_unlock ();if (!task)return -ENOENT ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 185/530 x86/cpu: Include the header of init_ia32_feat_ctl()s prototype
In reply to Greg Kroah-HartmanFrom: Luciano Leão <[email protected]>
[ Upstream commit 30ea703a38ef76ca119673cd8bdd05c6e068e2ac ]
Include the header containing the prototype of init_ia32_feat_ctl(), solving the following warning:
$ make W=1 arch/x86/kernel/cpu/feat_ctl.o
arch/x86/kernel/cpu/feat_ctl.c:112:6: warning: no previous prototype for ‘init_ia32_feat_ctl’ [-Wmissing-prototypes]
112 | void init_ia32_feat_ctl(struct cpuinfo_x86 *c)This warning appeared after commit
5d5103595e9e5 ("x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup")
had moved the function init_ia32_feat_ctl()'s prototype from arch/x86/kernel/cpu/cpu.h to arch/x86/include/asm/cpu.h.
Note that, before the commit mentioned above, the header include "cpu.h" (arch/x86/kernel/cpu/cpu.h) was added by commit
0e79ad863df43 ("x86/cpu: Fix a -Wmissing-prototypes warning for init_ia32_feat_ctl()")
solely to fix init_ia32_feat_ctl()'s missing prototype. So, the header include "cpu.h" is no longer necessary.
[ bp: Massage commit message. ]
--- arch/x86/kernel/cpu/feat_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/feat_ctl.c +1 -1
@@ -1,11 +1,11 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/tboot.h> +#include <asm/cpu.h> #include <asm/cpufeature.h> #include <asm/msr-index.h> #include <asm/processor.h> #include <asm/vmx.h> -#include "cpu.h" #undef pr_fmt#define pr_fmt (fmt) "x86/cpu: " fmt
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 276/530 clk: qoriq: Hold reference returned by of_get_parent()
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit a8ea4273bc26256ce3cce83164f0f51c5bf6e127 ]
In legacy_init_clockgen(), we need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance.
Beside, in create_sysclk(), we need to call of_node_put() on 'sysclk' also for refcount balance.
--- drivers/clk/clk-qoriq.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/clk/clk-qoriq.c +8 -2
@@ -1063,8 +1063,13 @@ static void __init _clockgen_init(struct device_node *np, bool legacy);*/ static void __init legacy_init_clockgen (struct device_node *np) { -if (!clockgen.node) -_clockgen_init (of_get_parent (np), true); +if (!clockgen.node) { +struct device_node *parent_np; + + parent_np =of_get_parent (np); +_clockgen_init (parent_np, true); +of_node_put (parent_np); + } }/* Legacy node */
@@ -1159,6 +1164,7 @@ static struct clk * __init create_sysclk(const char *name) sysclk =of_get_child_by_name (clockgen.node,"sysclk" );if (sysclk) { clk =sysclk_from_fixed (sysclk, name); +of_node_put (sysclk);if (!IS_ERR (clk))return clk; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 280/530 clk: tegra: Fix refcount leak in tegra114_clock_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit db16a80c76ea395766913082b1e3f939dde29b2c ]
of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
--- drivers/clk/tegra/clk-tegra114.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/tegra/clk-tegra114.c +1 -0
@@ -1317,6 +1317,7 @@ static void __init tegra114_clock_init(struct device_node *np) } pmc_base =of_iomap (node,0 ); +of_node_put (node);if (!pmc_base) {pr_err ("Can't map pmc registers\n" );WARN_ON (1 );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 281/530 clk: tegra20: Fix refcount leak in tegra20_clock_init
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 4e343bafe03ff68a62f48f8235cf98f2c685468b ]
of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
--- drivers/clk/tegra/clk-tegra20.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/tegra/clk-tegra20.c +1 -0
@@ -1128,6 +1128,7 @@ static void __init tegra20_clock_init(struct device_node *np) } pmc_base =of_iomap (node,0 ); +of_node_put (node);if (!pmc_base) {pr_err ("Can't map pmc registers\n" );BUG ();
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 258/530 arm64: dts: ti: k3-j7200: fix main pinmux range
In reply to Greg Kroah-HartmanFrom: Matt Ranostay <[email protected]>
[ Upstream commit 0d0a0b4413460383331088b2203ba09a6971bc3a ]
Range size of 0x2b4 was incorrect since there isn't 173 configurable pins for muxing. Additionally there is a non-addressable region in the mapping which requires splitting into two ranges.
main_pmx0 -> 67 pinsmain_pmx1 -> 3 pins
--- arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts | 10 ++++++---- arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +6 -4
@@ -131,15 +131,17 @@ >; }; - main_usbss0_pins_default: main-usbss0-pins-default { + vdd_sd_dv_pins_default: vdd-sd-dv-pins-default { pinctrl-single,pins = < - J721E_IOPAD(0x120, PIN_OUTPUT, 0) /* (T4) USB0_DRVVBUS */ + J721E_IOPAD(0xd0, PIN_OUTPUT, 7) /* (T5) SPI0_D1.GPIO0_55 */ >; }; +}; - vdd_sd_dv_pins_default: vdd-sd-dv-pins-default { +&main_pmx1 { + main_usbss0_pins_default: main-usbss0-pins-default { pinctrl-single,pins = < - J721E_IOPAD(0xd0, PIN_OUTPUT, 7) /* (T5) SPI0_D1.GPIO0_55 */ + J721E_IOPAD(0x04, PIN_OUTPUT, 0) /* (T4) USB0_DRVVBUS */ >; }; };
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi +10 -1
@@ -295,7 +295,16 @@ main_pmx0: pinctrl@11c000 { compatible = "pinctrl-single"; /* Proxy 0 addressing */ - reg = <0x00 0x11c000 0x00 0x2b4>; + reg = <0x00 0x11c000 0x00 0x10c>; + #pinctrl-cells = <1>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0xffffffff>; + }; + + main_pmx1: pinctrl@11c11c { + compatible = "pinctrl-single"; + /* Proxy 0 addressing */ + reg = <0x00 0x11c11c 0x00 0xc>; #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0xffffffff>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 262/530 arm64: ftrace: fix module PLTs with mcount
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
[ Upstream commit 8cfb08575c6d4585f1ce0deeb189e5c824776b04 ]
Li Huafei reports that mcount-based ftrace with module PLTs was broken by commit:
a6253579977e4c6f ("arm64: ftrace: consistently handle PLTs.")
When a module PLTs are used and a module is loaded sufficiently far away from the kernel, we'll create PLTs for any branches which are out-of-range. These are separate from the special ftrace trampoline PLTs, which the module PLT code doesn't directly manipulate.
When mcount is in use this is a problem, as each mcount callsite in a module will be initialized to point to a module PLT, but since commit a6253579977e4c6f ftrace_make_nop() will assume that the callsite has been initialized to point to the special ftrace trampoline PLT, and ftrace_find_callable_addr() rejects other cases.
This means that when ftrace tries to initialize a callsite via ftrace_make_nop(), the call to ftrace_find_callable_addr() will find that the _mcount stub is out-of-range and is not handled by the ftrace PLT, resulting in a splat:
| ftrace_test: loading out-of-tree module taints kernel. | ftrace: no module PLT for _mcount | ------------[ ftrace bug ]------------ | ftrace failed to modify | [<ffff800029180014>] 0xffff800029180014 | actual: 44:00:00:94 | Initializing ftrace call sites | ftrace record flags: 2000000 | (0) | expected tramp: ffff80000802eb3c | ------------[ cut here ]------------ | WARNING: CPU: 3 PID: 157 at kernel/trace/ftrace.c:2120 ftrace_bug+0x94/0x270 | Modules linked in: | CPU: 3 PID: 157 Comm: insmod Tainted: G O 6.0.0-rc6-00151-gcd722513a189-dirty #22 | Hardware name: linux,dummy-virt (DT) | pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : ftrace_bug+0x94/0x270 | lr : ftrace_bug+0x21c/0x270 | sp : ffff80000b2bbaf0 | x29: ffff80000b2bbaf0 x28: 0000000000000000 x27: ffff0000c4d38000 | x26: 0000000000000001 x25: ffff800009d7e000 x24: ffff0000c4d86e00 | x23: 0000000002000000 x22: ffff80000a62b000 x21: ffff8000098ebea8 | x20: ffff0000c4d38000 x19: ffff80000aa24158 x18: ffffffffffffffff | x17: 0000000000000000 x16: 0a0d2d2d2d2d2d2d x15: ffff800009aa9118 | x14: 0000000000000000 x13: 6333626532303830 x12: 3030303866666666 | x11: 203a706d61727420 x10: 6465746365707865 x9 : 3362653230383030 | x8 : c0000000ffffefff x7 : 0000000000017fe8 x6 : 000000000000bff4 | x5 : 0000000000057fa8 x4 : 0000000000000000 x3 : 0000000000000001 | x2 : ad2cb14bb5438900 x1 : 0000000000000000 x0 : 0000000000000022 | Call trace: | ftrace_bug+0x94/0x270 | ftrace_process_locs+0x308/0x430 | ftrace_module_init+0x44/0x60 | load_module+0x15b4/0x1ce8 | __do_sys_init_module+0x1ec/0x238 | __arm64_sys_init_module+0x24/0x30 | invoke_syscall+0x54/0x118 | el0_svc_common.constprop.4+0x84/0x100 | do_el0_svc+0x3c/0xd0 | el0_svc+0x1c/0x50 | el0t_64_sync_handler+0x90/0xb8 | el0t_64_sync+0x15c/0x160 | ---[ end trace 0000000000000000 ]--- | ---------test_init-----------
Fix this by reverting to the old behaviour of ignoring the old instruction when initialising an mcount callsite in a module, which was the behaviour prior to commit a6253579977e4c6f.
--- arch/arm64/kernel/ftrace.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
arch/arm64/kernel/ftrace.c +16 -1
@@ -217,11 +217,26 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,unsigned long pc = rec->ip;u32 old =0 , new; + new =aarch64_insn_gen_nop (); + +/* +* When using mcount, callsites in modules may have been initalized to +* call an arbitrary module PLT (which redirects to the _mcount stub) +* rather than the ftrace PLT we'll use at runtime (which redirects to +* the ftrace trampoline). We can ignore the old PLT when initializing +* the callsite. +* +* Note: 'mod' is only set at module load time. +*/ +if (!IS_ENABLED (CONFIG_DYNAMIC_FTRACE_WITH_REGS ) && +IS_ENABLED (CONFIG_ARM64_MODULE_PLTS ) && mod) { +return aarch64_insn_patch_text_nosync ((void *)pc, new); + } +if (!ftrace_find_callable_addr (rec, mod, &addr))return -EINVAL ; old =aarch64_insn_gen_branch_imm (pc, addr,AARCH64_INSN_BRANCH_LINK ); - new =aarch64_insn_gen_nop ();return ftrace_modify_code (pc, old, new, true); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 282/530 HSI: omap_ssi: Fix refcount leak in ssi_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 9a2ea132df860177b33c9fd421b26c4e9a0a9396 ]
When returning or breaking early from a for_each_available_child_of_node() loop, we need to explicitly call of_node_put() on the child node to possibly release the node.
--- drivers/hsi/controllers/omap_ssi_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/hsi/controllers/omap_ssi_core.c +1 -0
@@ -524,6 +524,7 @@ static int ssi_probe(struct platform_device *pd)if (!childpdev) { err = -ENODEV ;dev_err (&pd->dev,"failed to create ssi controller port\n" ); +of_node_put (child); goto out3; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 263/530 ARM: dts: exynos: fix polarity of VBUS GPIO of Origen
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit a08137bd1e0a7ce951dce9ce4a83e39d379b6e1b ]
EHCI Oxynos (drivers/usb/host/ehci-exynos.c) drives VBUS GPIO high when trying to power up the bus, therefore the GPIO in DTS must be marked as "active high". This will be important when EHCI driver is converted to gpiod API that respects declared polarities.
--- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos4412-origen.dts +1 -1
@@ -95,7 +95,7 @@ }; &ehci { - samsung,vbus-gpio = <&gpx3 5 1>; + samsung,vbus-gpio = <&gpx3 5 GPIO_ACTIVE_HIGH>; status = "okay"; phys = <&exynos_usbphy 2>, <&exynos_usbphy 3>; phy-names = "hsic0", "hsic1";
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 259/530 ARM: dts: exynos: correct s5k6a3 reset polarity on Midas family
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 3ba2d4bb9592bf7a6a3fe3dbe711ecfc3d004bab ]
According to s5k6a3 driver code, the reset line for the chip appears to be active low. This also matches the typical polarity of reset lines in general. Let's fix it up as having correct polarity in DTS is important when the driver will be switched over to gpiod API.
--- arch/arm/boot/dts/exynos4412-midas.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos4412-midas.dtsi +1 -1
@@ -585,7 +585,7 @@ clocks = <&camera 1>; clock-names = "extclk"; samsung,camclk-out = <1>; - gpios = <&gpm1 6 GPIO_ACTIVE_HIGH>; + gpios = <&gpm1 6 GPIO_ACTIVE_LOW>; port { is_s5k6a3_ep: endpoint {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 294/530 dmaengine: hisilicon: Disable channels when unregister hisi_dma
In reply to Greg Kroah-HartmanFrom: Jie Hai <[email protected]>
[ Upstream commit e3bdaa04ada31f46d0586df83a2789b8913053c5 ]
When hisi_dma is unloaded or unbinded, all of channels should be disabled. This patch disables DMA channels when driver is unloaded or unbinded.
--- drivers/dma/hisi_dma.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/dma/hisi_dma.c +9 -5
@@ -180,7 +180,8 @@ static void hisi_dma_reset_qp_point(struct hisi_dma_dev *hdma_dev, u32 index)hisi_dma_chan_write (hdma_dev->base,HISI_DMA_CQ_HEAD_PTR , index,0 ); } -static void hisi_dma_reset_hw_chan (struct hisi_dma_chan *chan) +static void hisi_dma_reset_or_disable_hw_chan (struct hisi_dma_chan *chan, +bool disable) {struct hisi_dma_dev *hdma_dev = chan->hdma_dev;u32 index = chan->qp_num, tmp;
@@ -201,8 +202,11 @@ static void hisi_dma_reset_hw_chan(struct hisi_dma_chan *chan)hisi_dma_do_reset (hdma_dev, index);hisi_dma_reset_qp_point (hdma_dev, index);hisi_dma_pause_dma (hdma_dev, index, false); -hisi_dma_enable_dma (hdma_dev, index, true); -hisi_dma_unmask_irq (hdma_dev, index); + +if (!disable) { +hisi_dma_enable_dma (hdma_dev, index, true); +hisi_dma_unmask_irq (hdma_dev, index); + } ret = readl_relaxed_poll_timeout(hdma_dev->base + HISI_DMA_Q_FSM_STS + index * HISI_DMA_OFFSET, tmp,
@@ -218,7 +222,7 @@ static void hisi_dma_free_chan_resources(struct dma_chan *c)struct hisi_dma_chan *chan =to_hisi_dma_chan (c);struct hisi_dma_dev *hdma_dev = chan->hdma_dev; -hisi_dma_reset_hw_chan (chan); +hisi_dma_reset_or_disable_hw_chan (chan, false);vchan_free_chan_resources (&chan->vc);memset (chan->sq,0 ,sizeof (struct hisi_dma_sqe ) * hdma_dev->chan_depth);
@@ -394,7 +398,7 @@ static void hisi_dma_enable_qp(struct hisi_dma_dev *hdma_dev, u32 qp_index)static void hisi_dma_disable_qp (struct hisi_dma_dev *hdma_dev,u32 qp_index) { -hisi_dma_reset_hw_chan (&hdma_dev->chan[qp_index]); +hisi_dma_reset_or_disable_hw_chan (&hdma_dev->chan[qp_index], true); }static void hisi_dma_enable_qps (struct hisi_dma_dev *hdma_dev)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 302/530 mtd: devices: docg3: check the return value of devm_ioremap() in the probe
In reply to Greg Kroah-HartmanFrom: William Dean <[email protected]>
[ Upstream commit 26e784433e6c65735cd6d93a8db52531970d9a60 ]
The function devm_ioremap() in docg3_probe() can fail, so its return value should be checked.
--- drivers/mtd/devices/docg3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mtd/devices/docg3.c +6 -1
@@ -1974,9 +1974,14 @@ static int __init docg3_probe(struct platform_device *pdev)dev_err (dev,"No I/O memory resource defined\n" );return ret; } - base =devm_ioremap (dev, ress->start,DOC_IOSPACE_SIZE ); ret = -ENOMEM ; + base =devm_ioremap (dev, ress->start,DOC_IOSPACE_SIZE ); +if (!base) { +dev_err (dev,"devm_ioremap dev failed\n" ); +return ret; + } + cascade =devm_kcalloc (dev,DOC_MAX_NBFLOORS ,sizeof (*cascade),GFP_KERNEL );if (!cascade)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 308/530 RDMA/irdma: Align AE id codes to correct flush code and event
In reply to Greg Kroah-HartmanFrom: Sindhu-Devale <[email protected]>
[ Upstream commit 7f51a961f8c6b84752a48e950074a8c4a0808d91 ]
A number of asynchronous event (AE) ids were not aligned to the correct flush_code and event_type. Fix these up so that the correct IBV error and event codes are returned to application.
Also, add handling for new AE ids like IRDMA_AE_INVALID_REQUEST to return the correct WC error code.
--- drivers/infiniband/hw/irdma/defs.h | 1 + drivers/infiniband/hw/irdma/hw.c | 51 +++++++++++++++++------------ drivers/infiniband/hw/irdma/type.h | 1 + drivers/infiniband/hw/irdma/user.h | 1 + drivers/infiniband/hw/irdma/utils.c | 3 ++ drivers/infiniband/hw/irdma/verbs.c | 2 ++ 6 files changed, 38 insertions(+), 21 deletions(-)
drivers/infiniband/hw/irdma/defs.h +1 -0
@@ -314,6 +314,7 @@ enum irdma_cqp_op_type {#define IRDMA_AE_IB_REMOTE_ACCESS_ERROR 0x020d#define IRDMA_AE_IB_REMOTE_OP_ERROR 0x020e#define IRDMA_AE_WQE_LSMM_TOO_LONG 0x0220 +#define IRDMA_AE_INVALID_REQUEST 0x0223#define IRDMA_AE_DDP_INVALID_MSN_GAP_IN_MSN 0x0301#define IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER 0x0303#define IRDMA_AE_DDP_UBE_INVALID_DDP_VERSION 0x0304
drivers/infiniband/hw/irdma/hw.c +30 -21
89 lines not on this page · raw message
drivers/infiniband/hw/irdma/type.h +1 -0
@@ -99,6 +99,7 @@ enum irdma_term_mpa_errors {enum irdma_qp_event_type {IRDMA_QP_EVENT_CATASTROPHIC ,IRDMA_QP_EVENT_ACCESS_ERR , +IRDMA_QP_EVENT_REQ_ERR , };enum irdma_hw_stats_index_32b {
drivers/infiniband/hw/irdma/user.h +1 -0
@@ -104,6 +104,7 @@ enum irdma_flush_opcode {FLUSH_FATAL_ERR ,FLUSH_RETRY_EXC_ERR ,FLUSH_MW_BIND_ERR , + FLUSH_REM_INV_REQ_ERR, }; enum irdma_cmpl_status {
drivers/infiniband/hw/irdma/utils.c +3 -0
@@ -2535,6 +2535,9 @@ void irdma_ib_qp_event(struct irdma_qp *iwqp, enum irdma_qp_event_type event)case IRDMA_QP_EVENT_ACCESS_ERR : ibevent.event =IB_EVENT_QP_ACCESS_ERR ;break ; +case IRDMA_QP_EVENT_REQ_ERR : + ibevent.event =IB_EVENT_QP_REQ_ERR ; +break ; } ibevent.device = iwqp->ibqp.device; ibevent.element.qp = &iwqp->ibqp;
drivers/infiniband/hw/irdma/verbs.c +2 -0
@@ -3359,6 +3359,8 @@ static enum ib_wc_status irdma_flush_err_to_ib_wc_status(enum irdma_flush_opcodereturn IB_WC_RETRY_EXC_ERR ;case FLUSH_MW_BIND_ERR :return IB_WC_MW_BIND_ERR ; +case FLUSH_REM_INV_REQ_ERR : +return IB_WC_REM_INV_REQ_ERR ;case FLUSH_FATAL_ERR :default :return IB_WC_FATAL_ERR ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 310/530 RDMA/siw: Always consume all skbuf data in sk_data_ready() upcall.
In reply to Greg Kroah-HartmanFrom: Bernard Metzler <[email protected]>
[ Upstream commit 754209850df8367c954ac1de7671c7430b1f342c ]
For header and trailer/padding processing, siw did not consume new skb data until minimum amount present to fill current header or trailer structure, including potential payload padding. Not consuming any data during upcall may cause a receive stall, since tcp_read_sock() is not upcalling again if no new data arrive.
A NFSoRDMA client got stuck at RDMA Write reception of unaligned payload, if the current skb did contain only the expected 3 padding bytes, but not the 4 bytes CRC trailer. Expecting 4 more bytes already arrived in another skb, and not consuming those 3 bytes in the current upcall left the Write incomplete, waiting for the CRC forever.
--- drivers/infiniband/sw/siw/siw_qp_rx.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/infiniband/sw/siw/siw_qp_rx.c +15 -12
@@ -961,27 +961,28 @@ int siw_proc_terminate(struct siw_qp *qp)static int siw_get_trailer (struct siw_qp *qp,struct siw_rx_stream *srx) {struct sk_buff *skb = srx->skb; +int avail =min (srx->skb_new, srx->fpdu_part_rem);u8 *tbuf = (u8 *)&srx->trailer.crc - srx->pad;__wsum crc_in, crc_own =0 ;siw_dbg_qp (qp,"expected %d, available %d, pad %u\n" , srx->fpdu_part_rem, srx->skb_new, srx->pad); -if (srx->skb_new < srx->fpdu_part_rem) -return -EAGAIN ; - -skb_copy_bits (skb, srx->skb_offset, tbuf, srx->fpdu_part_rem); +skb_copy_bits (skb, srx->skb_offset, tbuf, avail); -if (srx->mpa_crc_hd && srx->pad) -crypto_shash_update (srx->mpa_crc_hd, tbuf, srx->pad); + srx->skb_new -= avail; + srx->skb_offset += avail; + srx->skb_copied += avail; + srx->fpdu_part_rem -= avail; - srx->skb_new -= srx->fpdu_part_rem; - srx->skb_offset += srx->fpdu_part_rem; - srx->skb_copied += srx->fpdu_part_rem; +if (srx->fpdu_part_rem) +return -EAGAIN ;if (!srx->mpa_crc_hd)return 0 ; +if (srx->pad) +crypto_shash_update (srx->mpa_crc_hd, tbuf, srx->pad);/* * CRC32 is computed, transmitted and received directly in NBO, * so there's never a reason to convert byte order.
@@ -1083,10 +1084,9 @@ static int siw_get_hdr(struct siw_rx_stream *srx)* completely received. */ if (iwarp_pktinfo[opcode].hdr_len >sizeof (struct iwarp_ctrl_tagged )) { - bytes = iwarp_pktinfo[opcode].hdr_len -MIN_DDP_HDR ; +int hdrlen = iwarp_pktinfo[opcode].hdr_len; -if (srx->skb_new < bytes) -return -EAGAIN ; + bytes =min_t (int, hdrlen -MIN_DDP_HDR , srx->skb_new);skb_copy_bits (skb, srx->skb_offset, (char *)c_hdr + srx->fpdu_part_rcvd, bytes);
@@ -1096,6 +1096,9 @@ static int siw_get_hdr(struct siw_rx_stream *srx) srx->skb_new -= bytes; srx->skb_offset += bytes; srx->skb_copied += bytes; + +if (srx->fpdu_part_rcvd < hdrlen) +return -EAGAIN ; }/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 313/530 ata: fix ata_id_has_devslp()
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
[ Upstream commit 9c6e09a434e1317e09b78b3b69cd384022ec9a03 ]
ACS-5 section
7.13.6.36 Word 78: Serial ATA features supported
states that:
If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero.
(This text also exists in really old ACS standards, e.g. ACS-3.)
Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check.
--- include/linux/ata.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/ata.h +4 -1
@@ -565,6 +565,10 @@ struct ata_bmdma_prd { ((((id)[ATA_ID_SATA_CAPABILITY ] !=0x0000 ) && \ ((id)[ATA_ID_SATA_CAPABILITY ] !=0xffff )) && \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2))) +#define ata_id_has_devslp (id) \ + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)))#define ata_id_iordy_disable (id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))#define ata_id_has_iordy (id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))#define ata_id_u32 (id,n) \
@@ -577,7 +581,6 @@ struct ata_bmdma_prd {#define ata_id_cdb_intr (id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)#define ata_id_has_da (id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) -#define ata_id_has_devslp (id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))#define ata_id_has_ncq_autosense (id) \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 316/530 mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 3e4ad3212cf22687410b1e8f4e68feec50646113 ]
The meson_nfc_ecc_correct() function accidentally does a right shift instead of a left shift so it only works for BIT(0). Also use BIT_ULL() because "correct_bitmap" is a u64 and we want to avoid shift wrapping bugs.
--- drivers/mtd/nand/raw/meson_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/meson_nand.c +2 -2
@@ -454,7 +454,7 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips,if (ECC_ERR_CNT (*info) !=ECC_UNCORRECTABLE ) { mtd->ecc_stats.corrected +=ECC_ERR_CNT (*info); *bitflips =max_t (u32, *bitflips,ECC_ERR_CNT (*info)); - *correct_bitmap |=1 >> i; + *correct_bitmap |=BIT_ULL (i);continue ; } if ((nand->options & NAND_NEED_SCRAMBLING) &&
@@ -800,7 +800,7 @@ static int meson_nfc_read_page_hwecc(struct nand_chip *nand, u8 *buf,u8 *data = buf + i * ecc->size;u8 *oob = nand->oob_poi + i * (ecc->bytes +2 ); -if (correct_bitmap & (1 << i)) +if (correct_bitmap &BIT_ULL (i))continue ; ret = nand_check_erased_ecc_chunk(data, ecc->size, oob, ecc->bytes + 2,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 288/530 media: uvcvideo: Use entity get_cur in uvc_ctrl_set
In reply to Greg Kroah-HartmanFrom: Yunke Cao <[email protected]>
[ Upstream commit 5f36851c36b30f713f588ed2b60aa7b4512e2c76 ]
Entity controls should get_cur using an entity-defined function instead of via a query. Fix this in uvc_ctrl_set.
--- drivers/media/usb/uvc/uvc_ctrl.c | 83 ++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 37 deletions(-)
drivers/media/usb/uvc/uvc_ctrl.c +46 -37
@@ -988,36 +988,56 @@ static s32 __uvc_ctrl_get_value(struct uvc_control_mapping *mapping,return value; } -static int __uvc_ctrl_get (struct uvc_video_chain *chain, -struct uvc_control *ctrl,struct uvc_control_mapping *mapping, -s32 *value) +static int __uvc_ctrl_load_cur (struct uvc_video_chain *chain, +struct uvc_control *ctrl) { +u8 *data;int ret; -if ((ctrl->info.flags &UVC_CTRL_FLAG_GET_CUR ) ==0 ) -return -EACCES ; +if (ctrl->loaded) +return 0 ; -if (!ctrl->loaded) { -if (ctrl->entity->get_cur) { - ret = ctrl->entity->get_cur (chain->dev, - ctrl->entity, - ctrl->info.selector, -uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ), - ctrl->info.size); - }else { - ret =uvc_query_ctrl (chain->dev,UVC_GET_CUR , - ctrl->entity->id, - chain->dev->intfnum, - ctrl->info.selector, -uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ), - ctrl->info.size); - } -if (ret <0 ) -return ret; + data =uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ); +if ((ctrl->info.flags &UVC_CTRL_FLAG_GET_CUR ) ==0 ) { +memset (data,0 , ctrl->info.size); ctrl->loaded =1 ; + +return 0 ; } +if (ctrl->entity->get_cur) + ret = ctrl->entity->get_cur (chain->dev, ctrl->entity, + ctrl->info.selector, data, + ctrl->info.size); +else + ret =uvc_query_ctrl (chain->dev,UVC_GET_CUR , + ctrl->entity->id, chain->dev->intfnum, + ctrl->info.selector, data, + ctrl->info.size); + +if (ret <0 ) +return ret; + + ctrl->loaded =1 ; + +return ret; +} + +static int __uvc_ctrl_get (struct uvc_video_chain *chain, +struct uvc_control *ctrl, +struct uvc_control_mapping *mapping, +s32 *value) +{ +int ret; + +if ((ctrl->info.flags &UVC_CTRL_FLAG_GET_CUR ) ==0 ) +return -EACCES ; + + ret =__uvc_ctrl_load_cur (chain, ctrl); +if (ret <0 ) +return ret; + *value =__uvc_ctrl_get_value (mapping,uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ));
@@ -1667,21 +1687,10 @@ int uvc_ctrl_set(struct uvc_fh *handle,* needs to be loaded from the device to perform the read-modify-write * operation. */ -if (!ctrl->loaded && (ctrl->info.size *8 ) != mapping->size) { -if ((ctrl->info.flags &UVC_CTRL_FLAG_GET_CUR ) ==0 ) { -memset (uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ), -0 , ctrl->info.size); - }else { - ret =uvc_query_ctrl (chain->dev,UVC_GET_CUR , - ctrl->entity->id, chain->dev->intfnum, - ctrl->info.selector, -uvc_ctrl_data (ctrl,UVC_CTRL_DATA_CURRENT ), - ctrl->info.size); -if (ret <0 ) -return ret; - } - - ctrl->loaded =1 ; +if ((ctrl->info.size *8 ) != mapping->size) { + ret =__uvc_ctrl_load_cur (chain, ctrl); +if (ret <0 ) +return ret; }/* Backup the current value in case we need to rollback later. */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 286/530 media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start()
In reply to Greg Kroah-HartmanFrom: Xu Qiang <[email protected]>
[ Upstream commit 4029372233e13e281f8c387f279f9f064ced3810 ]
Add the missing clk_disable_unprepare() before return from vdec_hevc_start() in the error handling case.
--- drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/staging/media/meson/vdec/vdec_hevc.c +5 -1
@@ -167,8 +167,12 @@ static int vdec_hevc_start(struct amvdec_session *sess)clk_set_rate (core->vdec_hevc_clk,666666666 ); ret =clk_prepare_enable (core->vdec_hevc_clk); -if (ret) +if (ret) { +if (core->platform->revision ==VDEC_REVISION_G12A || + core->platform->revision ==VDEC_REVISION_SM1 ) +clk_disable_unprepare (core->vdec_hevcf_clk);return ret; + }if (core->platform->revision ==VDEC_REVISION_SM1 ) regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 269/530 iio: inkern: fix return value in devm_of_iio_channel_get_by_name()
In reply to Greg Kroah-HartmanFrom: Nuno Sá <[email protected]>
[ Upstream commit 9e878dbc0e8322f8b2f5ab0093c1e89926362dbe ]
of_iio_channel_get_by_name() can either return NULL or an error pointer so that only doing IS_ERR() is not enough. Fix it by checking the NULL pointer case and return -ENODEV in that case. Note this is done like this so that users of the function (which only check for error pointers) do not need to be changed. This is not ideal since we are losing error codes and as such, in a follow up change, things will be unified so that of_iio_channel_get_by_name() only returns error codes.
--- drivers/iio/inkern.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iio/inkern.c +2 -0
@@ -395,6 +395,8 @@ struct iio_channel *devm_of_iio_channel_get_by_name(struct device *dev, channel =of_iio_channel_get_by_name (np, channel_name);if (IS_ERR (channel))return channel; +if (!channel) +return ERR_PTR (-ENODEV ); ret =devm_add_action_or_reset (dev, devm_iio_channel_free, channel);if (ret)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 324/530 drivers: serial: jsm: fix some leaks in probe
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 1d5859ef229e381f4db38dce8ed58e4bf862006b ]
This error path needs to unwind instead of just returning directly.
--- drivers/tty/serial/jsm/jsm_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/jsm/jsm_driver.c +2 -1
@@ -211,7 +211,8 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)break ;default : -return -ENXIO ; + rc = -ENXIO ; + goto out_kfree_brd; } rc =request_irq (brd->irq, brd->bd_ops->intr,IRQF_SHARED ,"JSM" , brd);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 69/530 slimbus: qcom-ngd: use correct error in message of pdr_add_lookup() failure
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 5038d21dde818fe74ba1fcb6f2cee35b8c2ebbf2 upstream.
Use correct error code, instead of previous 'ret' value, when printing error from pdr_add_lookup() failure.
--- drivers/slimbus/qcom-ngd-ctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/slimbus/qcom-ngd-ctrl.c +2 -1
@@ -1572,8 +1572,9 @@ static int qcom_slim_ngd_ctrl_probe(stru pds =pdr_add_lookup (ctrl->pdr,"avs/audio" ,"msm/adsp/audio_pd" );if (IS_ERR (pds) &&PTR_ERR (pds) != -EALREADY ) { + ret =PTR_ERR (pds);dev_err (dev,"pdr add lookup failed: %d\n" , ret); -return PTR_ERR (pds); +return ret; }platform_driver_register (&qcom_slim_ngd_driver);
Greg Kroah-Hartman
maintainerPATCH 326/530 tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown
In reply to Greg Kroah-HartmanFrom: Sherry Sun <[email protected]>
[ Upstream commit 316ae95c175a7d770d1bfe4c011192712f57aa4a ]
lpuart_dma_shutdown tears down lpuart dma, but lpuart_flush_buffer can still occur which in turn tries to access dma apis if lpuart_dma_tx_use flag is true. At this point since dma is torn down, these dma apis can abort. Set lpuart_dma_tx_use and the corresponding rx flag lpuart_dma_rx_use to false in lpuart_dma_shutdown so that dmas are not accessed after they are relinquished.
Otherwise, when try to kill btattach, kernel may panic. This patch may fix this issue.
root@imx8ulpevk:~# btattach -B /dev/ttyLP2 -S 115200 ^C[ 90.182296] Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP [ 90.189806] Modules linked in: moal(O) mlan(O) [ 90.194258] CPU: 0 PID: 503 Comm: btattach Tainted: G O 5.15.32-06136-g34eecdf2f9e4 #37 [ 90.203554] Hardware name: NXP i.MX8ULP 9X9 EVK (DT) [ 90.208513] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 90.215470] pc : fsl_edma3_disable_request+0x8/0x60 [ 90.220358] lr : fsl_edma3_terminate_all+0x34/0x20c [ 90.225237] sp : ffff800013f0bac0 [ 90.228548] x29: ffff800013f0bac0 x28: 0000000000000001 x27: ffff000008404800 [ 90.235681] x26: ffff000008404960 x25: ffff000008404a08 x24: ffff000008404a00 [ 90.242813] x23: ffff000008404a60 x22: 0000000000000002 x21: 0000000000000000 [ 90.249946] x20: ffff800013f0baf8 x19: ffff00000559c800 x18: 0000000000000000 [ 90.257078] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 90.264211] x14: 0000000000000003 x13: 0000000000000000 x12: 0000000000000040 [ 90.271344] x11: ffff00000600c248 x10: ffff800013f0bb10 x9 : ffff000057bcb090 [ 90.278477] x8 : fffffc0000241a08 x7 : ffff00000534ee00 x6 : ffff000008404804 [ 90.285609] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff0000055b3480 [ 90.292742] x2 : ffff8000135c0000 x1 : ffff00000534ee00 x0 : ffff00000559c800 [ 90.299876] Call trace: [ 90.302321] fsl_edma3_disable_request+0x8/0x60 [ 90.306851] lpuart_flush_buffer+0x40/0x160 [ 90.311037] uart_flush_buffer+0x88/0x120 [ 90.315050] tty_driver_flush_buffer+0x20/0x30 [ 90.319496] hci_uart_flush+0x44/0x90 [ 90.323162] +0x34/0x12c [ 90.327253] tty_ldisc_close+0x38/0x70 [ 90.331005] tty_ldisc_release+0xa8/0x190 [ 90.335018] tty_release_struct+0x24/0x8c [ 90.339022] tty_release+0x3ec/0x4c0 [ 90.342593] __fput+0x70/0x234 [ 90.345652] ____fput+0x14/0x20 [ 90.348790] task_work_run+0x84/0x17c [ 90.352455] do_exit+0x310/0x96c [ 90.355688] do_group_exit+0x3c/0xa0 [ 90.359259] __arm64_sys_exit_group+0x1c/0x20 [ 90.363609] invoke_syscall+0x48/0x114 [ 90.367362] el0_svc_common.constprop.0+0xd4/0xfc [ 90.372068] do_el0_svc+0x2c/0x94 [ 90.375379] el0_svc+0x28/0x80 [ 90.378438] el0t_64_sync_handler+0xa8/0x130 [ 90.382711] el0t_64_sync+0x1a0/0x1a4 [ 90.386376] Code: 17ffffda d503201f d503233f f9409802 (b9400041) [ 90.392467] ---[ end trace 2f60524b4a43f1f6 ]--- [ 90.397073] note: btattach[503] exited with preempt_count 1 [ 90.402636] Fixing recursive fault but reboot is needed!
--- drivers/tty/serial/fsl_lpuart.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/fsl_lpuart.c +2 -0
@@ -1787,6 +1787,7 @@ static void lpuart_dma_shutdown(struct lpuart_port *sport)if (sport->lpuart_dma_rx_use) {del_timer_sync (&sport->lpuart_timer);lpuart_dma_rx_free (&sport->port); + sport->lpuart_dma_rx_use = false; }if (sport->lpuart_dma_tx_use) {
@@ -1795,6 +1796,7 @@ static void lpuart_dma_shutdown(struct lpuart_port *sport) sport->dma_tx_in_progress = false;dmaengine_terminate_all (sport->dma_tx_chan); } + sport->lpuart_dma_tx_use = false; }if (sport->dma_tx_chan)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 293/530 fpga: prevent integer overflow in dfl_feature_ioctl_set_irq()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 939bc5453b8cbdde9f1e5110ce8309aedb1b501a ]
The "hdr.count * sizeof(s32)" multiplication can overflow on 32 bit systems leading to memory corruption. Use array_size() to fix that.
--- drivers/fpga/dfl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl.c +1 -1
@@ -1864,7 +1864,7 @@ long dfl_feature_ioctl_set_irq(struct platform_device *pdev,return -EINVAL ; fds =memdup_user ((void __user *)(arg +sizeof (hdr)), - hdr.count *sizeof (s32)); +array_size (hdr.count,sizeof (s32)));if (IS_ERR (fds))return PTR_ERR (fds);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 98/530 ext4: place buffer head allocation before handle start
In reply to Greg Kroah-HartmanFrom: Jinke Han <[email protected]>
commit d1052d236eddf6aa851434db1897b942e8db9921 upstream.
In our product environment, we encounter some jbd hung waiting handles to stop while several writters were doing memory reclaim for buffer head allocation in delay alloc write path. Ext4 do buffer head allocation with holding transaction handle which may be blocked too long if the reclaim works not so smooth. According to our bcc trace, the reclaim time in buffer head allocation can reach 258s and the jbd transaction commit also take almost the same time meanwhile. Except for these extreme cases, we often see several seconds delays for cgroup memory reclaim on our servers. This is more likely to happen considering docker environment.
One thing to note, the allocation of buffer heads is as often as page allocation or more often when blocksize less than page size. Just like page cache allocation, we should also place the buffer head allocation before startting the handle.
--- fs/ext4/inode.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/ext4/inode.c +7 -0
@@ -1177,6 +1177,13 @@ retry_grab: page =grab_cache_page_write_begin (mapping, index, flags);if (!page)return -ENOMEM ; +/* +* The same as page allocation, we prealloc buffer heads before +* starting the handle. +*/ +if (!page_has_buffers (page)) +create_empty_buffers (page, inode->i_sb->s_blocksize,0 ); +unlock_page (page); retry_journal:
Greg Kroah-Hartman
maintainerPATCH 284/530 media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 211f8304fa21aaedc2c247f0c9d6c7f1aaa61ad7 ]
In fimc_is_register_subdevs(), we need to call of_node_put() for the reference 'i2c_bus' when breaking out of the for_each_compatible_node() which has increased the refcount.
--- drivers/media/platform/exynos4-is/fimc-is.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/exynos4-is/fimc-is.c +1 -0
@@ -213,6 +213,7 @@ static int fimc_is_register_subdevs(struct fimc_is *is)if (ret <0 || index >=FIMC_IS_SENSORS_NUM ) {of_node_put (child); +of_node_put (i2c_bus);return ret; } index++;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 25/530 can: kvaser_usb_leaf: Fix CAN state after restart
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
commit 0be1a655fe68c8e6dcadbcbddb69cf2fb29881f5 upstream.
can_restart() expects CMD_START_CHIP to set the error state to ERROR_ACTIVE as it calls netif_carrier_on() immediately afterwards.
Otherwise the user may immediately trigger restart again and hit a BUG_ON() in can_restart().
Fix kvaser_usb_leaf set_mode(CMD_START_CHIP) to set the expected state.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +2 -0
@@ -1435,6 +1435,8 @@ static int kvaser_usb_leaf_set_mode(stru err =kvaser_usb_leaf_simple_cmd_async (priv,CMD_START_CHIP );if (err)return err; + + priv->can.state =CAN_STATE_ERROR_ACTIVE ;break ;default :return -EOPNOTSUPP ;
Greg Kroah-Hartman
maintainerPATCH 153/530 leds: lm3601x: Dont use mutex after it was destroyed
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 32f7eed0c763a9b89f6b357ec54b48398fc7b99e ]
The mutex might still be in use until the devm cleanup callback devm_led_classdev_flash_release() is called. This only happens some time after lm3601x_remove() completed.
--- drivers/leds/flash/leds-lm3601x.c | 2 -- 1 file changed, 2 deletions(-)
drivers/leds/flash/leds-lm3601x.c +0 -2
@@ -444,8 +444,6 @@ static int lm3601x_remove(struct i2c_client *client) {struct lm3601x_led *led =i2c_get_clientdata (client); -mutex_destroy (&led->lock); -return regmap_update_bits (led->regmap,LM3601X_ENABLE_REG ,LM3601X_ENABLE_MASK ,LM3601X_MODE_STANDBY );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 298/530 dyndbg: fix module.dyndbg handling
In reply to Greg Kroah-HartmanFrom: Jim Cromie <[email protected]>
[ Upstream commit 85d6b66d31c35158364058ee98fb69ab5bb6a6b1 ]
For CONFIG_DYNAMIC_DEBUG=N, the ddebug_dyndbg_module_param_cb() stub-fn is too permissive:
bash-5.1# modprobe drm JUNKdyndbg
bash-5.1# modprobe drm dyndbgJUNK
[ 42.933220] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds [ 42.937484] ACPI: bus type drm_connector registered
This caused no ill effects, because unknown parameters are either ignored by default with an "unknown parameter" warning, or ignored because dyndbg allows its no-effect use on non-dyndbg builds.
But since the code has an explicit feedback message, it should be issued accurately. Fix with strcmp for exact param-name match.
--- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/dynamic_debug.h +1 -1
@@ -201,7 +201,7 @@ static inline int ddebug_remove_module(const char *mod)static inline int ddebug_dyndbg_module_param_cb (char *param,char *val,const char *modname) { -if (strstr (param,"dyndbg" )) { +if (!strcmp (param,"dyndbg" )) {/* avoid pr_warn(), which wants pr_fmt() fully defined */ printk (KERN_WARNING "dyndbg param is supported only in " "CONFIG_DYNAMIC_DEBUG builds\n" );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 305/530 mtd: rawnand: intel: Read the chip-select line from the correct OF node
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit bfc618fcc3f167ad082053e81e9d664e724c6288 ]
The chip select has to be read from the flash node which is a child node of the NAND controller.
--- drivers/mtd/nand/raw/intel-nand-controller.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/intel-nand-controller.c +9 -2
@@ -16,6 +16,7 @@#include <linux/mtd/rawnand.h> #include <linux/mtd/nand.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/sched.h> #include <linux/slab.h>
@@ -580,6 +581,7 @@ static int ebu_nand_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct ebu_nand_controller *ebu_host; +struct device_node *chip_np;struct nand_chip *nand;struct mtd_info *mtd;struct resource *res;
@@ -604,7 +606,12 @@ static int ebu_nand_probe(struct platform_device *pdev)if (IS_ERR (ebu_host->hsnand))return PTR_ERR (ebu_host->hsnand); - ret =device_property_read_u32 (dev,"reg" , &cs); + chip_np =of_get_next_child (dev->of_node,NULL ); +if (!chip_np) +return dev_err_probe (dev, -EINVAL , +"Could not find child node for the NAND chip\n" ); + + ret =of_property_read_u32 (chip_np,"reg" , &cs);if (ret) {dev_err (dev,"failed to get chip select: %d\n" , ret);return ret;
@@ -660,7 +667,7 @@ static int ebu_nand_probe(struct platform_device *pdev)writel (ebu_host->cs[cs].addr_sel |EBU_ADDR_MASK (5 ) |EBU_ADDR_SEL_REGEN , ebu_host->ebu +EBU_ADDR_SEL (cs)); -nand_set_flash_node (&ebu_host->chip, dev->of_node); +nand_set_flash_node (&ebu_host->chip, chip_np); mtd =nand_to_mtd (&ebu_host->chip);if (!mtd->name) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 312/530 ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting()
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
[ Upstream commit 690aa8c3ae308bc696ec8b1b357b995193927083 ]
ACS-5 section
7.13.6.41 Words 85..87, 120: Commands and feature sets supported or enabled states that:
If bit 15 of word 86 is set to one, bit 14 of word 119 is set to one, and bit 15 of word 119 is cleared to zero, then word 119 is valid.
If bit 15 of word 86 is set to one, bit 14 of word 120 is set to one, and bit 15 of word 120 is cleared to zero, then word 120 is valid.
(This text also exists in really old ACS standards, e.g. ACS-3.)
Currently, ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() both check bit 15 of word 86, but neither of them check that bit 14 of word 119 is set to one, or that bit 15 of word 119 is cleared to zero.
Additionally, make ata_id_sense_reporting_enabled() return false if !ata_id_has_sense_reporting(), similar to how e.g. ata_id_flush_ext_enabled() returns false if !ata_id_has_flush_ext().
--- include/linux/ata.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
include/linux/ata.h +9 -4
@@ -770,16 +770,21 @@ static inline bool ata_id_has_read_log_dma_ext(const u16 *id)static inline bool ata_id_has_sense_reporting (const u16 *id) { -if (!(id[ATA_ID_CFS_ENABLE_2 ] & (1 <<15 ))) +if (!(id[ATA_ID_CFS_ENABLE_2 ] &BIT (15 ))) +return false; +if ((id[ATA_ID_COMMAND_SET_3 ] & (BIT (15 ) |BIT (14 ))) !=BIT (14 ))return false; -return id[ATA_ID_COMMAND_SET_3 ] & (1 <<6 ); +return id[ATA_ID_COMMAND_SET_3 ] &BIT (6 ); }static inline bool ata_id_sense_reporting_enabled (const u16 *id) { -if (!(id[ATA_ID_CFS_ENABLE_2 ] & (1 <<15 ))) +if (!ata_id_has_sense_reporting (id)) +return false; +/* ata_id_has_sense_reporting() == true, word 86 must have bit 15 set */ +if ((id[ATA_ID_COMMAND_SET_4 ] & (BIT (15 ) |BIT (14 ))) !=BIT (14 ))return false; -return id[ATA_ID_COMMAND_SET_4 ] & (1 <<6 ); +return id[ATA_ID_COMMAND_SET_4 ] &BIT (6 ); }/**
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 66/530 NFSD: Protect against send buffer overflow in NFSv3 READ
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit fa6be9cc6e80ec79892ddf08a8c10cabab9baf38 upstream.
Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply at the same time.
Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large.
A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case.
--- fs/nfsd/nfs3proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs3proc.c +2 -2
@@ -146,7 +146,6 @@ nfsd3_proc_read(struct svc_rqst *rqstp) {struct nfsd3_readargs *argp = rqstp->rq_argp;struct nfsd3_readres *resp = rqstp->rq_resp; -u32 max_blocksize =svc_max_payload (rqstp);unsigned int len;int v;
@@ -155,7 +154,8 @@ nfsd3_proc_read(struct svc_rqst *rqstp) (unsigned long ) argp->count, (unsigned long long) argp->offset); - argp->count =min_t (u32, argp->count, max_blocksize); + argp->count =min_t (u32, argp->count,svc_max_payload (rqstp)); + argp->count =min_t (u32, argp->count, rqstp->rq_res.buflen);if (argp->offset > (u64 )OFFSET_MAX ) argp->offset = (u64 )OFFSET_MAX ;if (argp->offset + argp->count > (u64 )OFFSET_MAX )
Greg Kroah-Hartman
maintainerPATCH 113/530 tracing: Wake up waiters when tracing is disabled
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 2b0fd9a59b7990c161fa1cb7b79edb22847c87c2 upstream.
When tracing is disabled, there's no reason that waiters should stay waiting, wake them up, otherwise tasks get stuck when they should be flushing the buffers.
--- kernel/trace/trace.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/trace/trace.c +6 -0
@@ -8291,6 +8291,10 @@ tracing_buffers_splice_read(struct fileif (ret) goto out; +/* No need to wait after waking up when tracing is off */ +if (!tracer_tracing_is_on (iter->tr)) + goto out; +/* Make sure we see the new wait_index */ smp_rmb ();if (wait_index != iter->wait_index)
@@ -9000,6 +9004,8 @@ rb_simple_write(struct file *filp, consttracer_tracing_off (tr);if (tr->current_trace->stop) tr->current_trace->stop (tr); +/* Wake up any waiters */ +ring_buffer_wake_waiters (buffer,RING_BUFFER_ALL_CPUS ); }mutex_unlock (&trace_types_lock); }
Greg Kroah-Hartman
maintainerPATCH 314/530 ata: fix ata_id_has_ncq_autosense()
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
[ Upstream commit a5fb6bf853148974dbde092ec1bde553bea5e49f ]
ACS-5 section
7.13.6.36 Word 78: Serial ATA features supported
states that:
If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero.
(This text also exists in really old ACS standards, e.g. ACS-3.)
Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check.
--- include/linux/ata.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/linux/ata.h +4 -2
@@ -569,6 +569,10 @@ struct ata_bmdma_prd { ((((id)[ATA_ID_SATA_CAPABILITY ] !=0x0000 ) && \ ((id)[ATA_ID_SATA_CAPABILITY ] !=0xffff )) && \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))) +#define ata_id_has_ncq_autosense (id) \ + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7)))#define ata_id_iordy_disable (id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))#define ata_id_has_iordy (id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))#define ata_id_u32 (id,n) \
@@ -581,8 +585,6 @@ struct ata_bmdma_prd {#define ata_id_cdb_intr (id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)#define ata_id_has_da (id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) -#define ata_id_has_ncq_autosense (id) \ - ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))static inline bool ata_id_has_hipm (const u16 *id) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 3/530 ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit a70aef7982b012e86dfd39fbb235e76a21ae778a upstream.
The register_mutex taken around the dev_unregister callback call in snd_rawmidi_free() may potentially lead to a mutex deadlock, when OSS emulation and a hot unplug are involved.
Since the mutex doesn't protect the actual race (as the registration itself is already protected by another means), let's drop it.
--- sound/core/rawmidi.c | 2 -- 1 file changed, 2 deletions(-)
sound/core/rawmidi.c +0 -2
@@ -1835,10 +1835,8 @@ static int snd_rawmidi_free(struct snd_rsnd_info_free_entry (rmidi->proc_entry); rmidi->proc_entry =NULL ; -mutex_lock (®ister_mutex);if (rmidi->ops && rmidi->ops->dev_unregister) rmidi->ops->dev_unregister (rmidi); -mutex_unlock (®ister_mutex);snd_rawmidi_free_substreams (&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT ]);snd_rawmidi_free_substreams (&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT ]);
Greg Kroah-Hartman
maintainerPATCH 307/530 mtd: rawnand: fsl_elbc: Fix none ECC mode
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 049e43b9fd8fd2966940485da163d67e96ee3fea ]
Commit f6424c22aa36 ("mtd: rawnand: fsl_elbc: Make SW ECC work") added support for specifying ECC mode via DTS and skipping autodetection.
But it broke explicit specification of HW ECC mode in DTS as correct settings for HW ECC mode are applied only when NONE mode or nothing was specified in DTS file.
Also it started aliasing NONE mode to be same as when ECC mode was not specified and disallowed usage of ON_DIE mode.
Fix all these issues. Use autodetection of ECC mode only in case when mode was really not specified in DTS file by checking that ecc value is invalid. Set HW ECC settings either when HW ECC was specified in DTS or it was autodetected. And do not fail when ON_DIE mode is set.
--- drivers/mtd/nand/raw/fsl_elbc_nand.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-)
drivers/mtd/nand/raw/fsl_elbc_nand.c +16 -12
@@ -726,36 +726,40 @@ static int fsl_elbc_attach_chip(struct nand_chip *chip)struct fsl_lbc_regs __iomem *lbc = ctrl->regs;unsigned int al; -switch (chip->ecc.engine_type) {/* * if ECC was not chosen in DT, decide whether to use HW or SW ECC from * CS Base Register */ -case NAND_ECC_ENGINE_TYPE_NONE : +if (chip->ecc.engine_type ==NAND_ECC_ENGINE_TYPE_INVALID ) {/* If CS Base Register selects full hardware ECC then use it */ if ((in_be32 (&lbc->bank[priv->bank].br) &BR_DECC ) ==BR_DECC_CHK_GEN ) { - chip->ecc.read_page = fsl_elbc_read_page; - chip->ecc.write_page = fsl_elbc_write_page; - chip->ecc.write_subpage = fsl_elbc_write_subpage; - chip->ecc.engine_type =NAND_ECC_ENGINE_TYPE_ON_HOST ; -mtd_set_ooblayout (mtd, &fsl_elbc_ooblayout_ops); - chip->ecc.size =512 ; - chip->ecc.bytes =3 ; - chip->ecc.strength =1 ; }else {/* otherwise fall back to default software ECC */ chip->ecc.engine_type =NAND_ECC_ENGINE_TYPE_SOFT ; chip->ecc.algo =NAND_ECC_ALGO_HAMMING ; } + } + +switch (chip->ecc.engine_type) { +/* if HW ECC was chosen, setup ecc and oob layout */ +case NAND_ECC_ENGINE_TYPE_ON_HOST : + chip->ecc.read_page = fsl_elbc_read_page; + chip->ecc.write_page = fsl_elbc_write_page; + chip->ecc.write_subpage = fsl_elbc_write_subpage; +mtd_set_ooblayout (mtd, &fsl_elbc_ooblayout_ops); + chip->ecc.size =512 ; + chip->ecc.bytes =3 ; + chip->ecc.strength =1 ;break ; -/* if SW ECC was chosen in DT, we do not need to set anything here */ +/* if none or SW ECC was chosen, we do not need to set anything here */ +case NAND_ECC_ENGINE_TYPE_NONE :case NAND_ECC_ENGINE_TYPE_SOFT : +case NAND_ECC_ENGINE_TYPE_ON_DIE :break ; -/* should we also implement *_ECC_ENGINE_CONTROLLER to do as above? */ default :return -EINVAL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 54/530 drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit 4656b3a26a9e9fe5f04bfd2ab55b066266ba7f4d upstream.
Make virtio_gpu_plane_cleanup_fb() to clean the state which DRM core wants to clean up and not the current plane's state. Normally the older atomic state is cleaned up, but the newer state could also be cleaned up in case of aborted commits.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +3 -3
@@ -265,14 +265,14 @@ static int virtio_gpu_plane_prepare_fb(s }static void virtio_gpu_plane_cleanup_fb (struct drm_plane *plane, -struct drm_plane_state *old_state) +struct drm_plane_state *state) {struct virtio_gpu_framebuffer *vgfb; -if (!plane->state->fb) +if (!state->fb)return ; - vgfb =to_virtio_gpu_framebuffer (plane->state->fb); + vgfb =to_virtio_gpu_framebuffer (state->fb);if (vgfb->fence) {dma_fence_put (&vgfb->fence->f); vgfb->fence =NULL ;
Greg Kroah-Hartman
maintainerPATCH 75/530 ksmbd: fix endless loop when encryption for response fails
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 360c8ee6fefdb496fffd2c18bb9a96a376a1a804 upstream.
If ->encrypt_resp return error, goto statement cause endless loop. It send an error response immediately after removing it.
--- fs/ksmbd/server.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ksmbd/server.c +1 -3
@@ -235,10 +235,8 @@ send:if (work->sess && work->sess->enc && work->encrypted && conn->ops->encrypt_resp) { rc = conn->ops->encrypt_resp (work); -if (rc <0 ) { +if (rc <0 ) conn->ops->set_rsp_status (work,STATUS_DATA_ERROR ); - goto send; - } }ksmbd_conn_write (work);
Greg Kroah-Hartman
maintainerPATCH 184/530 x86/microcode/AMD: Track patch allocation size explicitly
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 712f210a457d9c32414df246a72781550bc23ef6 ]
In preparation for reducing the use of ksize(), record the actual allocation size for later memcpy(). This avoids copying extra (uninitialized!) bytes into the patch buffer when the requested allocation size isn't exactly the size of a kmalloc bucket. Additionally, fix potential future issues where runtime bounds checking will notice that the buffer was allocated to a smaller value than returned by ksize().
--- arch/x86/include/asm/microcode.h | 1 + arch/x86/kernel/cpu/microcode/amd.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/include/asm/microcode.h +1 -0
@@ -9,6 +9,7 @@struct ucode_patch {struct list_head plist;void *data;/* Intel uses only this one */ +unsigned int size;u32 patch_id;u16 equiv_cpu; };
arch/x86/kernel/cpu/microcode/amd.c +2 -1
@@ -782,6 +782,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover,kfree (patch);return -EINVAL ; } + patch->size = *patch_size; mc_hdr = (struct microcode_header_amd *)(fw +SECTION_HDR_SIZE ); proc_id = mc_hdr->processor_rev_id;
@@ -863,7 +864,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size)return ret;memset (amd_ucode_patch,0 ,PATCH_MAX_SIZE ); -memcpy (amd_ucode_patch, p->data,min_t (u32,ksize (p->data),PATCH_MAX_SIZE )); +memcpy (amd_ucode_patch, p->data,min_t (u32, p->size,PATCH_MAX_SIZE ));return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 338/530 clk: qcom: gcc-sm6115: Override default Alpha PLL regs
In reply to Greg Kroah-HartmanFrom: Adam Skladowski <[email protected]>
[ Upstream commit 068a0605ef5a6b430e7278c169bfcd25b680b28f ]
The DEFAULT and BRAMMO PLL offsets are non-standard in downstream, but currently only BRAMMO ones are overridden. Override DEFAULT ones too.
A very similar thing is happening in gcc-qcm2290 driver.
--- drivers/clk/qcom/gcc-sm6115.c | 46 +++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 16 deletions(-)
drivers/clk/qcom/gcc-sm6115.c +30 -16
@@ -53,11 +53,25 @@ static struct pll_vco gpll10_vco[] = { { 750000000, 1500000000, 1 }, }; +static const u8 clk_alpha_pll_regs_offset[][PLL_OFF_MAX_REGS] = { + [CLK_ALPHA_PLL_TYPE_DEFAULT] = { + [PLL_OFF_L_VAL] = 0x04, + [PLL_OFF_ALPHA_VAL] = 0x08, + [PLL_OFF_ALPHA_VAL_U] = 0x0c, + [PLL_OFF_TEST_CTL] = 0x10, + [PLL_OFF_TEST_CTL_U] = 0x14, + [PLL_OFF_USER_CTL] = 0x18, + [PLL_OFF_USER_CTL_U] = 0x1c, + [PLL_OFF_CONFIG_CTL] = 0x20, + [PLL_OFF_STATUS] = 0x24, + }, +}; + static struct clk_alpha_pll gpll0 = { .offset = 0x0, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(0),
@@ -83,7 +97,7 @@ static struct clk_alpha_pll_postdiv gpll0_out_aux2 = { .post_div_table = post_div_table_gpll0_out_aux2, .num_post_div = ARRAY_SIZE(post_div_table_gpll0_out_aux2), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll0_out_aux2" , .parent_hws = (const struct clk_hw *[]){ &gpll0.clkr.hw },
@@ -115,7 +129,7 @@ static struct clk_alpha_pll_postdiv gpll0_out_main = { .post_div_table = post_div_table_gpll0_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll0_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll0_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll0.clkr.hw },
@@ -137,7 +151,7 @@ static struct clk_alpha_pll gpll10 = { .offset = 0xa000, .vco_table = gpll10_vco, .num_vco = ARRAY_SIZE(gpll10_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(10),
@@ -163,7 +177,7 @@ static struct clk_alpha_pll_postdiv gpll10_out_main = { .post_div_table = post_div_table_gpll10_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll10_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll10_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll10.clkr.hw },
@@ -189,7 +203,7 @@ static struct clk_alpha_pll gpll11 = { .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), .flags = SUPPORTS_DYNAMIC_UPDATE, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(11),
@@ -215,7 +229,7 @@ static struct clk_alpha_pll_postdiv gpll11_out_main = { .post_div_table = post_div_table_gpll11_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll11_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll11_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll11.clkr.hw },
@@ -229,7 +243,7 @@ static struct clk_alpha_pll gpll3 = { .offset = 0x3000, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(3),
@@ -248,7 +262,7 @@ static struct clk_alpha_pll gpll4 = { .offset = 0x4000, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(4),
@@ -274,7 +288,7 @@ static struct clk_alpha_pll_postdiv gpll4_out_main = { .post_div_table = post_div_table_gpll4_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll4_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll4_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll4.clkr.hw },
@@ -287,7 +301,7 @@ static struct clk_alpha_pll gpll6 = { .offset = 0x6000, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(6),
@@ -313,7 +327,7 @@ static struct clk_alpha_pll_postdiv gpll6_out_main = { .post_div_table = post_div_table_gpll6_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll6_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll6_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll6.clkr.hw },
@@ -326,7 +340,7 @@ static struct clk_alpha_pll gpll7 = { .offset = 0x7000, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr = { .enable_reg = 0x79000, .enable_mask = BIT(7),
@@ -352,7 +366,7 @@ static struct clk_alpha_pll_postdiv gpll7_out_main = { .post_div_table = post_div_table_gpll7_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll7_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll7_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll7.clkr.hw },
@@ -380,7 +394,7 @@ static struct clk_alpha_pll gpll8 = { .offset = 0x8000, .vco_table = default_vco, .num_vco = ARRAY_SIZE(default_vco), - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .flags = SUPPORTS_DYNAMIC_UPDATE, .clkr = { .enable_reg = 0x79000,
@@ -407,7 +421,7 @@ static struct clk_alpha_pll_postdiv gpll8_out_main = { .post_div_table = post_div_table_gpll8_out_main, .num_post_div = ARRAY_SIZE(post_div_table_gpll8_out_main), .width = 4, - .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], + .regs = clk_alpha_pll_regs_offset[CLK_ALPHA_PLL_TYPE_DEFAULT], .clkr.hw.init = &(struct clk_init_data ){ .name ="gpll8_out_main" , .parent_hws = (const struct clk_hw *[]){ &gpll8.clkr.hw },
Signature · 1 line
2.35.1