commit c75c928bb4af01748aa107d9fb254e7ac79c49a9 Author: Greg Kroah-Hartman Date: Mon Nov 30 12:56:47 2026 +0100 Linux 7.3.7 Link: https://lore.kernel.org/r/20261125143821.729802100@linuxfoundation.org Tested-by: SJ Park Tested-by: Brett A C Sheffield Tested-by: Markus Reichelt Tested-by: Sergey Lebedev # Surface Pro 11 Tested-by: Salvatore Bonaccorso Tested-by: Benjamin Boortz Tested-by: Pavel Machek (CIP) Link: https://lore.kernel.org/r/20261126105729.110697432@linuxfoundation.org Tested-by: Brett A C Sheffield Tested-by: Ronald Warsow Tested-by: Peter Schneider Tested-by: Takeshi Ogasawara Tested-by: Joungmin Lee Tested-by: Miguel Ojeda Tested-by: Barry K. Nathan Tested-by: Sean Lyon Tested-by: Ron Economos Tested-by: Pavel Machek (CIP) Tested-by: Justin M. Forbes Tested-by: Benjamin Boortz Signed-off-by: Greg Kroah-Hartman commit 134c94816b19c21ed5ee8b8351fabc4f136a2929 Author: Niklas Cassel Date: Tue Sep 29 10:25:06 2026 +0200 scsi: scsi_debug: Do not write a partial physical block to a zoned device [ Upstream commit b8fad9f02485f179e35bc4677386b6608d8cefb0 ] do_device_access() copies one logical block at a time and stops at the first short copy, so a data-out buffer smaller than the transfer length of the command can leave part of a physical block written. An initiator can arrange that with SG_IO. That is acceptable everywhere but a sequential write required zone, where ZBC-3 r06 (T10/BSR INCITS 579), 4.5.3.3.2, requires a write to end on a physical block boundary. For such a zone, stop at the last whole physical block that the buffer holds. The bytes left over are not written, and are reported to the initiator as part of the residual. Assisted-by: LLM Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20260929082456.857423-24-cassel@kernel.org Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 9c2e34e6d1e7eb7b261f5881647cbc758cead040 Author: Niklas Cassel Date: Tue Sep 29 10:25:04 2026 +0200 scsi: scsi_debug: Report the residual of a write [ Upstream commit 7c000c4ad2c0a7b2da06ffe28f5a7489fc52ca2d ] Documentation/scsi/scsi_mid_low_api.rst defines the residual as the length of the data buffer less the number of bytes actually transferred, so a write whose data buffer is larger than its transfer length leaves one. resp_read_dt0() and resp_write_tape() report it, but the write paths for a disk do not, so such a write completes with GOOD status and a residual of zero while a READ of the same length into the same buffer reports it correctly. Report it in resp_write_dt0(), resp_write_scat() and resp_atomic_write(). resp_write_scat() differs twice over. Its data-out buffer also holds the parameter list header and the LBA range descriptors, so what the command consumed is sg_off rather than the bytes that the last range transferred; and sg_off counts what was asked for rather than what was transferred, so it can exceed the buffer and needs a guard. A command with no LBA range descriptors or a buffer transfer length of zero transfers nothing, so the whole buffer is residual. An error, real or injected, can end the command after some ranges have been written, so the residual is reported on every exit once the parameter list has been fetched. Assisted-by: LLM Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20260929082456.857423-22-cassel@kernel.org Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit eb44639f749887c59434c9cfd5d09e0b882d1fa1 Author: Arnd Bergmann Date: Mon Oct 26 11:25:50 2026 +0100 drm: xe: select configfs commit c1234293de147949bf9cf06e3ed59ad8766e29a0 upstream. The original addition of configfs to xe missed a compile-time dependency, which leads to a link failure when configfs is enabled as a loadable module: ld.lld-21: error: undefined symbol: xe_configfs_get_survivability_mode >>> referenced by xe_survivability_mode.c:224 >>> drivers/gpu/drm/xe/xe_survivability_mode.o:(xe_survivability_mode_is_requested) in archive vmlinux.a A recent workaround added a 'IS_REACHABLE()' check around the calls into configfs, which makes it link in this configuration, but this is generally a bad idea because it makes the actual behavior inconsistent and confusing to users that expect configfs to work if both xe and configfs are enabled. Use 'select CONFIGFS_FS' instead, like every other configfs user does, and remove the unnecessary stub functions. There is little practical difference here as anyone using XE graphics is likely to have a complex configuration that already selects configfs anyway, and the link error or the IS_REACHABLE() would only manifest during randconfig testing. Fixes: da475c094342 ("drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m") Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode") Signed-off-by: Arnd Bergmann Link: https://patch.msgid.link/20261026102603.2045493-1-arnd@kernel.org Signed-off-by: Rodrigo Vivi (cherry picked from commit be73339dd9d70623b7dbc9c4e3b966824b771069) Signed-off-by: Matthew Brost Acked-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman commit 86ea0036841a73a0bba6eac095cb46aa30fec2f2 Author: Kuniyuki Iwashima Date: Thu Sep 17 19:15:52 2026 +0000 tcp: Set unhashed_state in inet_twsk_hashdance_schedule(). commit 404381b4f1053a271a85679cc76a543b10ae043e upstream. inet_unhash() sets inet_csk(sk)->unhashed_state only when the socket is hashed because tcp_set_state(sk, TCP_CLOSE) could be called multiple times, e.g. tcp_abort() calls it directly and tcp_done_with_error(). However, inet_twsk_hashdance_schedule() also unhashes a socket when replacing it with twsk, allowing the socket to bypass checks for inet_csk(sk)->unhashed_state. Let's update inet_csk(sk)->unhashed_state there as well. Fixes: 8cc3aef0cb19 ("tcp: Do not allow buggy transitions between ehash and lhash2.") Reported-by: Daniel Zahka Closes: https://lore.kernel.org/netdev/DLHLRA8GVI5B.2Q1IRQG5BVJNZ@gmail.com/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: Daniel Zahka Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260917191554.1600494-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 4ee9a80dafacc14e5acb383cc7fb423ec2ee2762 Author: Luiz Capitulino (Red Hat) Date: Tue Nov 3 22:40:18 2026 -0500 powerpc/watchdog: disable watchdog when watchdog_thresh=0 commit d513ec3c907b067d4a32b14ec6f73c3e041cb136 upstream. On powerpc, trying to disable the hardlockup detector with: # echo 0 > /proc/sys/kernel/watchdog_thresh causes an immediate and endless hardlockup detection, eventually leading to an unusable system (splat example below). This happens because watchdog_calc_timeouts() sets wd_timer_period_ms, wd_panic_timeout_tb and wd_smp_panic_timeout_tb to zero, but start_watchdog() still starts the timer (with expiry=0) in this code path: proc_watchdog_thresh() proc_watchdog_update() __lockup_detector_reconfigure() watchdog_hardlockup_start() start_watchdog_on_cpu() start_watchdog() hrtimer_start() /* wd_timer_period_ms=0 */ However, according to Documentation/admin-guide/sysctl/kernel.rst, setting watchdog_thresh=0 should disable both the soft and hard lockup detectors. This condition is already checked in __lockup_detector_reconfigure() for the soft lockup detector and the arch-independent hardlockup detector, what's missing is powerpc performing the same check in start_watchdog(). [ 278.110085] watchdog: CPU 0 detected hard LOCKUP on other CPUs 1 [ 278.110086] watchdog: CPU 1 became unstuck TB:33050716089564575 [ 278.110097] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G E 7.4.0-rc1 #1 PREEMPT(full) [ 278.110103] watchdog: CPU 0 TB:33050716089564185, last SMP heartbeat TB:33050716089563885 (0ms ago) [ 278.110109] Tainted: [E]=UNSIGNED_MODULE [ 278.110126] Hardware name: IBM,8375-42A POWER9 (architected) 0x4e0202 0xf000005 of:IBM,FW940.00 (VL940_027) hv:phyp pSeries [ 278.110136] NIP: c0000000001bd518 LR: c0000000014dedf8 CTR: 0000000000000000 [ 278.110145] REGS: c000000004b17a80 TRAP: 0900 Tainted: G E (7.4.0-rc1) [ 278.110155] MSR: 800000000280b033 CR: 22000224 XER: 20040004 [ 278.110189] CFAR: 0000000000000000 IRQMASK: 0 GPR00: 0000000000000000 c000000004b17d20 c000000001c38100 0000000000000000 GPR04: 000000000000ffff 0000000000000000 0000000000000000 0000000000000000 GPR08: 0000000000000000 0000000000000080 0000000000000080 ffffffffffffffff GPR12: 0000000000000000 c000000017fff300 0000000000000000 000000002ef3d820 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000001 GPR24: 0000000000000001 00000040c0a6075e 0000000000000000 0000000000000001 GPR28: c0000001fdb5b140 0000000000000001 c000000002291968 c000000002291970 [ 278.110306] NIP [c0000000001bd518] plpar_hcall_norets_notrace+0x18/0x2c [ 278.110319] LR [c0000000014dedf8] check_and_cede_processor+0x48/0x60 [ 278.110333] Call Trace: [ 278.110338] [c000000004b17d20] [c000000004b17dd0] 0xc000000004b17dd0 (unreliable) [ 278.110354] [c000000004b17d80] [c0000000014df020] shared_cede_loop+0x70/0x170 [ 278.110367] [c000000004b17dc0] [c0000000014de460] cpuidle_enter_state+0x2f0/0x748 [ 278.110381] [c000000004b17e70] [c000000000fe43b8] cpuidle_enter+0x48/0x70 [ 278.110397] [c000000004b17eb0] [c0000000002cdcf8] call_cpuidle+0x48/0x90 [ 278.110409] [c000000004b17ed0] [c0000000002d6300] cpuidle_idle_call+0x160/0x2d0 [ 278.110422] [c000000004b17f20] [c0000000002d6578] do_idle+0x108/0x1f0 [ 278.110434] [c000000004b17f60] [c0000000002d6938] cpu_startup_entry+0x48/0x50 [ 278.110446] [c000000004b17f90] [c0000000000615c0] start_secondary+0x290/0x2a0 [ 278.110459] [c000000004b17fe0] [c00000000000e258] start_secondary_prolog+0x10/0x14 Fixes: 2104180a5369 ("powerpc/64s: implement arch-specific hardlockup watchdog") Cc: stable@vger.kernel.org Signed-off-by: Luiz Capitulino (Red Hat) Reviewed-by: Michael Ellerman Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261104034018.2676750-1-luiz.capitulino@linux.dev Signed-off-by: Greg Kroah-Hartman commit 6451387e3765a32a79bcef4bec47d587783c0c0e Author: Thomas Lamprecht Date: Mon Nov 2 12:29:43 2026 +0100 drm/amd/display: Don't warn about links without an HPD GPIO commit fb3d0ee0f7cf41488aff58c45f1b31a8f54f3372 upstream. Since commit def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility"), the link encoder programs the HPD filter, and dce110_program_hpd_filter() and dcn10_program_hpd_filter() hit ASSERT(0) if the encoder has no HPD GPIO. That is the case if link_get_hpd_gpio() finds no usable HPD info for the connector in the VBIOS, where program_hpd_filter() used to return early without a warning. This logs a warning with a stack trace on every boot of some systems, for example with Ryzen 7 PRO 4750G APUs on ASRock Rack X570D4U and X470D4U2-2T boards: WARNING: drivers/gpu/drm/amd/amdgpu/../display/dc/dio/dcn10/dcn10_link_encoder.c:1514 at dcn10_program_hpd_filter+0x39/0x90 [amdgpu], CPU#7: (udev-worker)/836 Call Trace: program_hpd_filter+0x5d/0xb0 [amdgpu] construct_phy+0x96f/0xe60 [amdgpu] link_create+0x1f0/0x240 [amdgpu] create_links+0x164/0x4f0 [amdgpu] dc_create+0x3ba/0x720 [amdgpu] amdgpu_dm_init+0x2c9/0x420 [amdgpu] Return false without asserting if there is no HPD GPIO, as before, and keep the assertion for failing to lock the pin. Fixes: def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility") Link: https://forum.proxmox.com/threads/kernel-7-0-14-24-and-7-0-14-25-bug-in-amdgpu.187181/ Reviewed-by: Wayne Lin Signed-off-by: Thomas Lamprecht Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 62ea146c23e14f958744507c37025f1a7f9c041b) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 44f57efaebb0325230cce416204e1ce01e435d2a Author: Hyunwoo Kim Date: Tue Nov 10 23:04:44 2026 +0900 tcp: fix NULL pointer dereference when restarting a Fast Open listener commit aa40afa831ebfe45e40a23721711059f2ac584d4 upstream. When a valid RST is received for a Fast Open child accepted before the three-way handshake completes, reqsk_fastopen_remove() adds the request_sock to the listener's RST list if the listener is in TCP_LISTEN. An application can call shutdown(SHUT_RD) on a listener socket. inet_csk_listen_stop() checks rskq_rst_head without holding fastopenq.lock. If rskq_rst_head is NULL, it does not acquire the lock and therefore does not synchronize with an insertion by reqsk_fastopen_remove() after that function has passed the TCP_LISTEN check. The more likely outcome of this race, even without a subsequent listen(), is a leak. If reqsk_fastopen_remove() inserts a request_sock after inet_csk_listen_stop() observes an empty list and returns, the request_sock is stranded in rskq_rst_head and keeps a reference on the listener. The socket is already in TCP_CLOSE, so a subsequent close() does not call inet_csk_listen_stop() again. If listen() is called again on the same socket before the delayed list insertion, the insertion can overlap the queue initialization in reqsk_queue_alloc(). If it occurs after rskq_rst_head is set to NULL but before rskq_rst_tail is set to NULL, rskq_rst_head points to the request_sock while rskq_rst_tail is NULL. When a valid RST is later received for another accepted Fast Open child, rskq_rst_head is not NULL, so reqsk_fastopen_remove() attempts to write the request_sock pointer to rskq_rst_tail->dl_next while rskq_rst_tail is NULL. KASAN reports: BUG: KASAN: null-ptr-deref in reqsk_fastopen_remove+0x147/0x210 Write of size 8 at addr 0000000000000088 by task swapper/3/0 ... Call Trace: ... reqsk_fastopen_remove+0x147/0x210 tcp_check_req+0xa70/0x1060 ... tcp_rcv_state_process+0x1cb/0x2ae0 ... tcp_v4_do_rcv+0x1fe/0x740 tcp_v4_rcv+0x1744/0x2070 ... ip_protocol_deliver_rcu+0x5c/0x280 ip_local_deliver_finish+0x171/0x330 ip_local_deliver+0x107/0x370 ... To widen the race window, the issue was reproduced after adding mdelay(3000) immediately after reqsk_fastopen_remove() checks that the listener is in TCP_LISTEN and immediately after reqsk_queue_alloc() sets rskq_rst_head to NULL. Make inet_csk_listen_stop() acquire fastopenq.lock regardless of the value of rskq_rst_head and detach the list while holding the lock. With this synchronization, reqsk_fastopen_remove() either inserts the request_sock before inet_csk_listen_stop() acquires the lock, in which case inet_csk_listen_stop() reclaims it, or sees that the listener is not in TCP_LISTEN and does not insert anything. Fixes: 0536fcc039a8 ("tcp: prepare fastopen code for upcoming listener changes") Cc: stable@vger.kernel.org Signed-off-by: Hyunwoo Kim Reviewed-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/avMkfJrXhCFXn8M_@v4bel Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 766d91e46033b65931fe1c83c3e4ddf9dee89a5a Author: Mani Tofigh Date: Wed Nov 11 17:46:31 2026 -0500 nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem() commit ba1213be15c613a1c03db69ea6480ca140a6ca00 upstream. Connecting a controller to a new subsystem deadlocks when sysfs_create_link() fails in nvme_init_subsystem(), e.g., on an allocation failure. The error path drops the last subsystem reference with nvme_subsystems_lock held and nvme_destroy_subsystem() takes the same lock again: nvme nvme0: failed to create sysfs link from subsystem. ============================================ WARNING: possible recursive locking detected ... nvmesubsys/95 is trying to acquire lock: (nvme_subsystems_lock){+.+.}-{4:4}, at: nvme_destroy_subsystem+0x1b/0x1e0 but task is already holding lock: (nvme_subsystems_lock){+.+.}-{4:4}, at: nvme_init_identify+0x81e/0x34b0 ... Call Trace: __mutex_lock+0x1a2/0x26e0 nvme_destroy_subsystem+0x1b/0x1e0 nvme_init_identify.cold+0x3bc/0x56f nvme_init_ctrl_finish+0x1bc/0x7a0 nvme_loop_configure_admin_queue+0x205/0x2b0 nvme_loop_create_ctrl+0x480/0xd10 nvmf_dev_write+0x365/0x650 vfs_write+0x1e3/0x1250 ksys_write+0xfa/0x200 do_syscall_64+0xfb/0x590 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... INFO: task nvmesubsys:95 blocked for more than 20 seconds. INFO: task nvmesubsys:95 is blocked on a mutex likely owned by task nvmesubsys:95. Every later controller setup or removal then waits for the lock too. The nvme_validate_cntlid() error path for an existing subsystem does the same put, and deadlocks the same way if the other references go away in between. Drop the lock before the put. For a new subsystem, take it off the list first so another controller can't find it in between. With the fix, the connect fails and the next connect works. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development. The C reproducer below however hits it within about 30s. Fixes: 32fd90c40768 ("nvme: change locking for the per-subsystem controller list") Cc: stable@vger.kernel.org Signed-off-by: Mani Tofigh Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 26844a6d62018b4e567d6201e6da2199d85cc2ac Author: Henry Martin Date: Wed Nov 11 16:23:13 2026 +0800 sctp: fix skb_over_panic when adding addresses with a pending delete of another family commit ce09d8c13a15fe881d0a04c91979dcdf45ed9543 upstream. sctp_make_asconf_update_ip() accounts for a pending DEL_IP parameter by reusing the length of the address being added. The write-back side instead serializes the pending address itself, with its own address family. If the pending delete is IPv6 (20-byte parameter) while the added addresses are IPv4 (8-byte), the chunk is allocated 12 bytes short and sctp_addto_chunk() writes past the end of the skb. E.g. on mainline (05441d697f7f): skbuff: skb_over_panic: text:ffffffff84859c77 len:392 put:20 tail:0x188 end:0x180 dev: kernel BUG at net/core/skbuff.c:215! CPU: 0 UID: 1000 PID: 379 Comm: poc_sctp Call Trace: skb_panic skb_put sctp_addto_chunk sctp_make_asconf_update_ip sctp_send_asconf_add_ip sctp_setsockopt_bindx __x64_sys_setsockopt Requires addip enabled on the endpoint (net.sctp.addip_enable=1). Account for the pending delete with its own address family, as the write-back side already does. This issue was discovered by an LLM code scanner. Cc: stable@vger.kernel.org Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host") Signed-off-by: Henry Martin Acked-by: Xin Long Link: https://patch.msgid.link/20261111082313.1606366-1-bsdhenrymartin@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit ff49a17d02680910ab397dfbe94c37e1d4234fdb Author: Karol Wachowski Date: Tue Nov 10 13:15:34 2026 +0100 accel/ivpu: Defer recovery until probe completes commit dc61b19db1f77deb4c15bb71e64f46071447837c upstream. An error IRQ that fires after ivpu_boot() enables interrupts queues recovery_work during probe. If probe then fails, the device is torn down while the work runs, and the work faults on the unmapped BARs: BUG: unable to handle page fault for address: ffffcfc6680200f4 Workqueue: events_unbound ivpu_pm_recovery_work [intel_vpu] RIP: 0010:ivpu_hw_ip_ipc_rx_addr_get+0xc/0xb0 [intel_vpu] Call Trace: ivpu_wait_for_ready+0x155/0x220 [intel_vpu] ivpu_boot+0x9e/0x270 [intel_vpu] ivpu_resume+0xa4/0xd0 [intel_vpu] ivpu_pm_reset_complete+0x2c/0x90 [intel_vpu] ivpu_pm_recovery_work+0xf6/0x140 [intel_vpu] If probe succeeds, the recovery runs concurrently with the rest of probe, and its pm_runtime_disable() discards the initial autosuspend request, leaving the NPU active until first use. Any recovery that starts while the NPU is idle loses the pending autosuspend the same way. Keep recovery_work disabled from ivpu_pm_init() until ivpu_pm_enable(). A trigger during probe still runs diagnostics and masks interrupts, and ivpu_pm_enable() runs the deferred recovery before the initial autosuspend request. A trigger racing with ivpu_pm_enable() can cause a second, harmless recovery. Request autosuspend at the end of ivpu_pm_reset_complete() so the NPU suspends again after every reset. Fixes: 852be13f3bd3 ("accel/ivpu: Add PM support") Cc: stable@vger.kernel.org # v6.10+ Reported-by: Daksh Sahni Closes: https://lore.kernel.org/r/20261107174215.15818-1-swizzguy76@gmail.com Tested-by: Daksh Sahni Reviewed-by: Jeff Hugo Signed-off-by: Karol Wachowski Link: https://patch.msgid.link/20261110121534.3566028-1-karol.wachowski@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 58c873e631498ea0d100b1505cbefe8c868d1a38 Author: Hyunjung Ko Date: Tue Nov 17 19:41:10 2026 +0900 gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes commit f94f85f82e042c89a1e64ed3ff1d591a2bccfa7b upstream. mpsse_read() reads min(len + 2, wMaxPacketSize) bytes and then copies len_actual - 2 bytes to the caller. A device that declares a bulk-in endpoint with wMaxPacketSize 1 completes the read with len_actual 1, so the copy length becomes -1 and memcpy() runs far past the one byte buffer on the caller's stack and past bulk_in_buf: memcpy: detected buffer overflow: 18446744073709551615 byte write of buffer size 1 WARNING: lib/string_helpers.c:1036 at __fortify_report+0x6e/0xc0 Call Trace: __fortify_panic+0xd/0x10 gpio_mpsse_get_multiple+0x767/0x780 gpio_mpsse_gpio_get+0xa2/0xf0 gpiod_get_raw_value_commit+0xf8/0x1f0 gpiod_get_value_cansleep+0x1e/0xa0 value_show+0x42/0x90 Reproduced with dummy_hcd and raw-gadget. A read needs room for the two status bytes plus at least one data byte, so refuse to bind otherwise. Fixes: c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO") Cc: stable@vger.kernel.org Signed-off-by: Hyunjung Ko Link: https://patch.msgid.link/20261117104110.240112-1-hj351016@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 5a549dbc2f4c81d8efbbda6e08c7199ce95a8160 Author: Mani Tofigh Date: Fri Nov 6 11:53:21 2026 -0500 blk-mq: take quiesce_lock when removing a queue from the tag set commit 495f22c5a99ac38e527294cdc4f3972718b9bee0 upstream. Unquiescing a tag set can run the hw queues of a queue whose hctxs were already freed. blk_mq_unquiesce_tagset() walks the tag set's queues under quiesce_lock and rcu_read_lock(). Commit 71ec3c7d6db8 ("blk-mq: quiesce a queue that joins a quiesced tag set") added quiesce_lock to the walks and to adding a queue, but blk_mq_del_queue_tag_set() still removes a queue without it. The hctxs are then freed right away since RCU only keeps the request_queue itself alive: Task A (controller reset) Task B (namespace removal) blk_mq_unquiesce_tagset() /* finds q */ blk_mq_del_queue_tag_set(q) blk_mq_release(q) /* frees the hctxs */ blk_mq_run_hw_queues(q) /* reads freed hctxs */ The window is short. On PREEMPT_RT quiesce_lock is a sleeping lock and the walk can be preempted inside it, which is how it's hit here: [ 399.851277] BUG: KASAN: slab-use-after-free in blk_mq_run_hw_queues+0x4bd/0x550 [ 399.851328] Read of size 8 at addr ff11000003014148 by task kworker/u9:2/116 [ 399.851352] CPU: 1 UID: 0 PID: 116 Comm: kworker/u9:2 Not tainted 7.3.0-16299-g81cb9aa43246 #1 PREEMPT_RT [ 399.851425] Workqueue: nvme-reset-wq nvme_loop_reset_ctrl_work [ 399.851441] Call Trace: [ 399.851457] [ 399.851551] blk_mq_run_hw_queues+0x4bd/0x550 [ 399.851564] blk_mq_unquiesce_tagset+0x128/0x210 [ 399.851576] nvme_loop_reset_ctrl_work+0x78/0x4c0 [ 399.851600] process_one_work+0x92b/0x16d0 [ 399.851660] worker_thread+0x4e6/0xd60 [ 399.851707] kthread+0x300/0x3e0 [ 399.851727] ret_from_fork+0x4f0/0x6f0 [ 399.851776] ret_from_fork_asm+0x1a/0x30 [ 399.851793] ... [ 399.851988] Freed by task 111: [ 399.852040] kfree+0x1b3/0x4b0 [ 399.852050] blk_mq_release+0x400/0x550 [ 399.852060] blk_put_queue+0x94/0x120 [ 399.852068] disk_release+0x1bd/0x3f0 [ 399.852102] nvme_free_ns+0x39/0x270 [ 399.852113] nvme_remove_nsid_range+0x2d1/0x4a0 [ 399.852123] nvme_scan_ns_list+0x2cc/0x390 [ 399.852134] nvme_scan_work+0x421/0x9f0 ... With BLK_CGROUP the disk's root blkg holds the queue until a grace period later, which hides this for NVMe namespaces. It's still open without BLK_CGROUP, and from reading the code also for queues freed without a disk (e.g., SCSI device queues on a UFS host). Take quiesce_lock around the list_del_rcu() as well so that the walk either finishes with a queue before it leaves the list or never sees it, and say so in the comment of quiesce_lock. With the fix, KASAN doesn't report the use-after-free anymore. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development. The C reproducer below however hits it about once every 20 minutes on a PREEMPT_RT kernel. Fixes: 59e25ef2b413 ("block: Use RCU in blk_mq_[un]quiesce_tagset() instead of set->tag_list_lock") Cc: stable@vger.kernel.org Reviewed-by: Mohamed Khalfella Signed-off-by: Mani Tofigh Reviewed-by: Christoph Hellwig Reviewed-by: Nilay Shroff Link: https://patch.msgid.link/20261106-blk-mq-del-quiesce-lock-v2-1-cd4f72a6eb03@columbia.edu Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit 20401d3a2a551512c5bdc2cf02311ef1eec475af Author: Theodor Arsenij Larionov Trichkine Date: Mon Nov 16 14:38:45 2026 +0300 fou: reserve headroom before pushing the encap header commit bcb42672751a8786dce871a35bde363b041cb2f7 upstream. ip_tunnel_xmit() and ip_md_tunnel_xmit() push the encap header before reserving headroom. A packet redirected into the tunnel (tc mirred, nft fwd/dup) keeps the headroom of its original device, so fou_build_udp() panics: kernel BUG at net/core/skbuff.c:214! Call Trace: skb_push+0xcc/0xf0 fou_build_udp+0x2f/0x380 gue_build_header+0xfa/0x150 ip_tunnel_xmit+0x87f/0x21c0 With a mirred mirror, the push overwrites the original packet instead. Reachable with CAP_NET_ADMIN in a user namespace. Reserve the headroom in fou_build_header() and gue_build_header(); GUE sizes and builds the header from one copy of the encap fields. The skb head may move, so reload inner_iph after ip_tunnel_encap() and read tnl_params, which points into the head for GRE with header_ops, before the call. sit's ipip6_tunnel_xmit() holds no head pointer across it. Fixes: 56328486539d ("net: Changes to ip_tunnel to support foo-over-udp encapsulation") Fixes: ac931d4cdec3 ("ipip,ip_tunnel,sit: Add FOU support for externally controlled ipip devices") Reported-by: Chengfeng Ye Closes: https://lore.kernel.org/netdev/20260801060115.3538849-1-nicoyip.dev@gmail.com/ Cc: stable@vger.kernel.org Signed-off-by: Theodor Arsenij Larionov Trichkine Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261116113845.166280-1-theodorlarionov@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 8622258bb57e2bbd987b4a84ec6a0efbe9585c67 Author: Karl Mehltretter Date: Tue Oct 6 05:41:47 2026 +0200 iio: trigger: Return an error when the trigger has no free irq commit dff701806ab6252f6a0fccba880c47cd09602625 upstream. iio_trigger_attach_poll_func() prints an error when all CONFIG_IIO_CONSUMERS_PER_TRIGGER irqs of the trigger are in use, but returns 0. The buffer of the extra consumer is enabled without a poll function. Disabling that buffer calls clear_bit() with a negative bit number and drops a module reference for the second time. On arm and arm64 the clear_bit() goes about 512 MB past the pool bitmap. That is an oops if the address is not mapped, and a bit cleared in unrelated memory if it is. Return the error from iio_trigger_get_irq(). Fixes: 995438233579 ("iio: Fix error handling in iio_trigger_attach_poll_func") Cc: stable@vger.kernel.org Signed-off-by: Karl Mehltretter Reviewed-by: Joshua Crofts Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 856d04fd8fbddb768166f46421b1cbbd30cf2ef2 Author: Changyul Lee Date: Fri Nov 6 12:47:37 2026 -0500 iio: trigger: free the trigger ID after device_del() commit d32bf759801e6df23038dc834622a122ec76a4dd upstream. iio_trigger_unregister() returns the trigger ID to iio_trigger_ida before device_del() removes the "trigger" device. A trigger registered in between can get the same ID, and its device_add() fails: sysfs: cannot create duplicate filename '/bus/iio/devices/trigger0' For example, adding a sysfs trigger while an hrtimer trigger is being removed through configfs, or the other way around, hits this because the two paths do not share a lock. Free the ID after device_del(), as the error path of iio_trigger_register() already does, and drop the "Possible issue in here" comment. Fixes: 1637db44413e ("Staging: IIO: Trigger support added to core.") Signed-off-by: Changyul Lee Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 112369d5098ac713da2e769f7267ca948a4d7f47 Author: Salah Triki Date: Thu Sep 17 12:01:20 2026 +0100 iio: temperature: mlx90614: Fix dual channel probe condition check commit 4d4e75b3074bc29525c963a81c19471528f29a45 upstream. In mlx90614_probe_num_ir_sensors(), the check on chip_info->dual_channel is inverted. Currently, if dual_channel is true (MLX90614), the function returns 0 immediately without checking op_eeprom_config1. This forces all MLX90614 devices to be registered as single sensor (num_channels = 2), making the second object temperature channel inaccessible. Conversely, if dual_channel is false (MLX90615), the function skips the early return and performs an unnecessary SMBus read on EEPROM CONFIG1 even though MLX90615 does not support dual channel operation. Fix this by negating the condition so that single-channel chips return early with 0, while dual-channel capable chips (MLX90614) proceed to read the EEPROM configuration register to detect whether 1 or 2 object channels are present. Fixes: 3d5ead238bc8 ("iio: mlx90614: Factor our register IO and constants into model specific descriptor") Signed-off-by: Salah Triki Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 2ad1c3e70c826892fc3a19b6c9a26489ee1f14cf Author: Christopher Hoover Date: Sun Oct 18 19:34:19 2026 -0700 iio: temperature: hid-sensor-temperature: Use per-instance callbacks commit 36eeb26031e90eeb81bbac3d3acad61d23fcbdf3 upstream. hid-sensor-temperature keeps a single static struct hid_sensor_hub_callbacks for all instances and overwrites its pdev in every probe. With two temperature sensors, input reports for one are delivered with the other's platform device; once that device is removed, platform_get_drvdata() returns NULL and temperature_capture_sample() dereferences it: BUG: kernel NULL pointer dereference, address: 00000000000003a8 RIP: 0010:temperature_capture_sample+0xd/0x50 [hid_sensor_temperature] The oops happens in sensor_hub_raw_event() with the hub's spinlock held, so the hub's removal then hangs. It reproduces with two uhid devices that each declare a temperature sensor, one destroyed while the other still sends input reports. Keep the callbacks in struct temperature_state, as the other HID sensor drivers (accel, gyro, als, ...) do. Fixes: 59d0f2da3569 ("iio: hid: Add temperature sensor support") Cc: stable@vger.kernel.org Signed-off-by: Christopher Hoover Reviewed-by: Joshua Crofts Acked-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 8ef4aa4afc4997d571305628e1d25c316cd332bc Author: Arnav Kapoor Date: Sat Oct 24 23:26:53 2026 +0530 iio: proximity: sx9500: ignore event config writes that don't change state commit b8ed9165906597b69a46fabf39ab41690721ebe8 upstream. sx9500_write_event_config() adjusts the channel and close/far user counts on every write, even when the event is already in the requested state. Writing 0 to a disabled event and then 1 leaves the counts at 0, so the channel and its interrupts stay off while the event reads as enabled. As channel_users[] is shared with raw reads, those can then wait forever for a conversion. Writing 1 twice and then 0 has the opposite effect. Return early when the state doesn't change, as sx_common_write_event_config() does. Fixes: 4193c0f1d863 ("iio: driver for Semtech SX9500 proximity solution") Signed-off-by: Arnav Kapoor Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 5b6802d275cbad1025a5d10bdfc4358993bcca7c Author: Arnav Kapoor Date: Mon Oct 26 03:42:38 2026 +0530 iio: proximity: sx9360: fix sampling frequency write and available range commit d252425c1533bfacd5940faa3371af82196bff5b upstream. GNRL_CTRL1/2 hold the scan period in units of 8192 / FOSC, but sx9360_set_samp_freq() computes freq * 8192 / FOSC and mis-scales val2, which is in micro units. Any integer frequency then programs a period of 0, and fractional parts above ~0.26 Hz overflow the int, writing 0x10 to GNRL_CTRL1 outside the SCANPERIOD field. Compute FOSC / (freq * 8192), rounded to the closest value, and reject frequencies outside the 1..2047 period range. The available range doesn't match the limits in the comments next to it either: 4 MHz / 8192 is 488.28125 Hz, not 448.28125 Hz, 4 MHz / (8192 * 2047) is 0.238535 Hz, and (max - min) / 2047 is 0.238419 Hz. Use those values. Fixes: 1cdb4c47f7f5 ("iio:proximity:sx9360: Add sx9360 support") Signed-off-by: Arnav Kapoor Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit be18f02c4c5ae031edb82f46c9c7b2279aca656e Author: Arnav Kapoor Date: Sat Oct 24 00:56:51 2026 +0530 iio: proximity: sx9324: fix out-of-bounds read of scan period table commit 7b5f54280f8e6ef07664f6705dd005feefbe87d1 upstream. The scan period of the SX9324 is selected by the 5 bit wide SX9324_REG_GNRL_CTRL0_SCANPERIOD field, so it has 32 possible values. sx9324_scan_period_table[] however only has 16 entries, it was copied over from the SX9310 driver where the field is only 4 bits wide. sx9324_wait_for_sample() indexes the table with the raw field value, so all the codes from 16 to 31 read past the end of the array. The default value of the register is SX9324_REG_GNRL_CTRL0_SCANPERIOD_100MS (0x16, i.e. 22), so the out-of-bounds read happens with the default configuration of the device. It is only avoided when the device has an interrupt line, as the wait is only done in the polling case. The value read is then used as the duration of an msleep() call, so the sensor is polled with a completely random delay. Fill the table with the scan periods of all 32 codes, which are the periods documented for the corresponding sx9324_samp_freq_table[] entries, and add a static assertion to keep both tables in sync. Fixes: 4c18a890dff8 ("iio:proximity:sx9324: Add SX9324 support") Cc: stable@vger.kernel.org Signed-off-by: Arnav Kapoor Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 315eeb3e697e1dd101db19266ad490f9e2bc4a26 Author: Myeonghun Pak Date: Thu Oct 15 22:47:35 2026 -0400 iio: proximity: hx9023s: Allocate trigger before requesting IRQ commit bfa3b177d839bb303d0187335115b572a2644920 upstream. An IRQ handler that already read trigger_enabled can poll data->trig after buffer disable. Detaching the virtual IRQ does not join this physical IRQ, and trigger deselection can drop the consumer reference. Devres may then free the trigger before joining the handler. Allocate the trigger before requesting the IRQ so devres joins the handler before dropping the allocation reference. This issue was identified as part of our ongoing research while reviewing kernel code. Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Joshua Crofts Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 94d1f14c5095c42168314c20ab77729a83172ca8 Author: Viral Patel Date: Wed Oct 14 23:07:36 2026 +0530 iio: magnetometer: tlv493d: fix magnetic field scale commit ef5c183a863bb69bf019a2d2ae0e1bfdaebe6222 upstream. The TLV493D-A1B6 datasheet specifies a magnetic resolution of 98 uT/LSB (0.098 mT/LSB). IIO reports magnetic field in Gauss (1 mT = 10 G), so the scale should be 0.98 G/LSB. The driver currently reports 98/1000 = 0.098 G/LSB, which under-reports the magnetic field by a factor of 10. The comment also gives the resolution as 0.0098 mT (9.8 uT), mixing up units. Correct the scale value and the comment. Fixes: 106511d280c7 ("iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor") Signed-off-by: Viral Patel Reviewed-by: Joshua Crofts Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit f78197b4c5e8936442e8f684cfe935b36e2f7f8f Author: Shashank Mohan Jain Date: Mon Oct 12 10:30:55 2026 +0530 iio: magnetometer: mmc5633: leave cache-only mode before the cache sync commit c794a0a82fb189d98c635c5791c67c672ad80eb8 upstream. mmc5633_resume() marks the register cache dirty and calls regcache_sync_region() while the regmap is still in cache-only mode. It calls regcache_cache_only(false) only after the sync. This ordering has been wrong since the driver was added; it happened to work until regmap started rejecting a sync in cache-only mode. Since commit afc8e3ee8307 ("regcache: Validate cache_only state in regcache_sync_region()") a sync in cache-only mode is refused with a WARN and -EINVAL. Every resume now gives WARNING: drivers/base/regmap/regcache.c:536 at regcache_sync_region+0x1a4/0x1c0 ... mmc5633_resume+0x2d/0x70 dpm_run_callback+0x7d/0x1c0 device_resume+0x175/0x270 ... mmc5633_i2c 1-0030: Failed to restore control registers and the control registers are not written. If the chip lost its state during suspend, it runs with the reset value of CTRL1 while the cache, and with it the sampling frequency attribute, still has the configured value. Writing the same frequency again does not repair this, because regmap_update_bits() finds no difference to the cache. Leave cache-only mode first, then mark the cache dirty and sync it. Reproduced in qemu with the I2C driver bound to an i2c-stub device: set in_magn_sampling_frequency to 3.5 (CTRL1 = 0x02), clear CTRL0 and CTRL1 of the stub behind the driver's back to emulate the power loss, and run a suspend/resume cycle with "devices" in /sys/power/pm_test. Without this change CTRL1 is still 0x00 after resume and the warning is printed. With it, and also with the regcache commit reverted, CTRL1 is 0x02 again and there is no warning. Not tested on real hardware. Fixes: 6e5f6bf2e3f0 ("iio: magnetometer: Add mmc5633 sensor") Signed-off-by: Shashank Mohan Jain Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit acc38eaddcfe548730b30aaa3c85f93b1227ba59 Author: Shashank Mohan Jain Date: Mon Oct 12 10:30:54 2026 +0530 iio: magnetometer: mmc35240: leave cache-only mode before the cache sync commit 38e05cf38df705b7fa9e8ada931589fa96816f09 upstream. mmc35240_resume() marks the register cache dirty and calls regcache_sync_region() while the regmap is still in cache-only mode. It calls regcache_cache_only(false) only after the sync. This ordering has been wrong since the resume support was added; it happened to work until regmap started rejecting a sync in cache-only mode. Since commit afc8e3ee8307 ("regcache: Validate cache_only state in regcache_sync_region()") a sync in cache-only mode is refused with a WARN and -EINVAL. Every resume now gives WARNING: drivers/base/regmap/regcache.c:536 at regcache_sync_region+0x1a4/0x1c0 ... mmc35240_resume+0x30/0x70 dpm_run_callback+0x7d/0x1c0 device_resume+0x175/0x270 ... mmc35240 1-0030: Failed to restore control registers and the control registers are not written. If the chip lost its state during suspend, it runs with the reset value of CTRL1 while the cache, and with it the sampling frequency attribute, still has the configured value. Writing the same frequency again does not repair this, because regmap_update_bits() finds no difference to the cache. Leave cache-only mode first, then mark the cache dirty and sync it. Reproduced in qemu with the driver bound to an i2c-stub device: set in_magn_sampling_frequency to 25 (CTRL1 = 0x02), clear CTRL0 and CTRL1 of the stub behind the driver's back to emulate the power loss, and run a suspend/resume cycle with "devices" in /sys/power/pm_test. Without this change CTRL1 is still 0x00 after resume and the warning is printed. With it, and also with the regcache commit reverted, CTRL1 is 0x02 again and there is no warning. Not tested on real hardware. Fixes: 553a776b7908 ("iio: magnetometer: mmc35240: Add PM sleep support") Signed-off-by: Shashank Mohan Jain Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit e417e89eb99ce42f7ed40b7d38f28a15ada009fb Author: Alexander Sarmanow Date: Mon Oct 12 16:43:15 2026 +0200 iio: light: vcnl4035: Fix reversed ALS mode bit commit 6bcabc30b89f31e2925647d1ffa5a0e4b7919829 upstream. According to the datasheet (table 2) the ALS_SD bit behaves the opposite way the current ALS mode defines are set, writing 0 powers the sensor and writing 1 shuts it down. The current driver thinks the ALS is up while it's actually shut down and it's down when the systems powers it up. Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035") Cc: stable@vger.kernel.org Signed-off-by: Alexander Sarmanow Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 3c8c2d9b88a38b92a38b3b4c74f15994cd23ce97 Author: Jan Remes Date: Thu Oct 22 20:56:40 2026 +0200 iio: light: tsl2591: don't divide by zero commit bd63c89aac5672f40cdc123a856493b628fc1abb upstream. The TSL2591 has two raw light channels - CH0 and CH1. The algorithm for calculating illumination from the raw channels requires division by CH0 (which can be zero) and by "counts per lux" (CPL) value which is also zero for (gain = LOW, integration time <= 400 ms). Furthermore, the algorithm assumes CH0 > CH1, which can be violated in almost complete darkness. As a result, reading from 'in_illuminance_input' results in division-by-zero whenever CH0 is 0 (complete darkness) or whenever the parameters result in CPL being zero. This results in kernel oops on x86_64 and in reading the value as 0 on arm64. Fix that by: - reporting CH0 <= CH1 as zero (catches also CH0 = 0) - updating the lux algorithm to only do the division at the end Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation") Cc: stable@vger.kernel.org Reported-by: Martin Triska Reviewed-by: Andy Shevchenko Signed-off-by: Jan Remes Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 820fe49c813e3b1fb09d2b0f725ac9cfb8fac015 Author: Jean-Baptiste Maneyrol Date: Tue Oct 20 17:26:00 2026 +0200 iio: inv_sensors: prevent timestamps going back in time in transitions commit 3785dffc7c68751a8429ae6dd75804c14a5a7c7a upstream. Ensure when computing first timestamp and when applying odr change, that the next timestamp will not be lower than the previous one. This way there is no risk to have a timestamp going back in time, meaning being lower than the previous one. It already can never happen without a transition because we are generating timestamps by adding the period to the last timestamp. Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit b027e8310c4594202c3e7f597281aa6644020017 Author: Jean-Baptiste Maneyrol Date: Tue Oct 20 18:28:47 2026 +0200 iio: inv_sensors: do not compute period estimation when updating odr commit 0d695709ed380f1bc9303a91f57525d33766a07e upstream. When odr is updated, the delta between the interrupts will change and it will lead to a bad period estimation. Avoid this by preventing the period estimation in this case. Fixes: 82bd09ce4fd3 ("iio: inv_sensors: improve period measurement by using a longer delay") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit a96b69f730ff2145bc468e1a64c24290a3eb08e5 Author: Jiale Yao Date: Fri Sep 25 22:10:05 2026 +0800 iio: imu: kmx61: reject duplicate event disable commit 9a60b35fe45801d45454e1efe90569c9cc6ea736 upstream. The IIO core does not filter duplicate writes to the event enable attribute. kmx61_write_event_config() already ignores repeated enable requests, but a repeated disable request still calls kmx61_set_power_state(data, false, KMX61_ACC), dropping a runtime PM reference that was not acquired for this request. This can underflow the runtime PM usage count and trigger a "Runtime PM usage count underflow" warning. Return early when the requested state already matches ev_enable_state. Fixes: fd3ae7a9f21c ("iio: imu: kmx61: Add support for any motion trigger") Signed-off-by: Jiale Yao Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 8a0a3e1c87e63de27b5ca83c89f5fa361432997a Author: Arnav Kapoor Date: Sun Oct 11 10:27:04 2026 +0530 iio: imu: inv_mpu6050: fix swapped accel and gyro startup times commit 3a5e2ca34cadd9d5993064884aa5b9c4f6d71dff upstream. struct inv_mpu6050_hw declares startup_time as { accel, gyro }, but every entry of hw_info[] initializes it positionally as { *_GYRO_STARTUP_TIME, *_ACCEL_STARTUP_TIME }, so the two values are swapped for all chips. inv_mpu6050_switch_engine() waits for startup_time.gyro after enabling the gyroscope, so it waits for the accelerometer startup time instead, e.g. 20 ms instead of 60 ms on MPU6050 and 20 ms instead of 100 ms on ICM20602, and the first gyroscope samples can be read before the sensor has settled. Enabling only the accelerometer waits longer than needed. Use designated initializers, so each value is assigned to the member it is named after. Fixes: e46a36d92da0 ("Add startup time for each chip using inv_mpu6050 driver") Signed-off-by: Arnav Kapoor Acked-by: Jean-Baptiste Maneyrol Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit debd21c487dc90645d05ad98c0ddd1cf06656a60 Author: Arnav Kapoor Date: Sun Oct 11 10:26:17 2026 +0530 iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes commit e5f7a6684a23d9b20184a81b4ebded3b3504ccdc upstream. inv_mpu_magn_get_scale() returns st->magn_raw_to_gauss[chan->address], where magn_raw_to_gauss[] holds one coefficient per axis, computed in inv_magn_init() from the per-axis factory sensitivity adjustment values (ASAX, ASAY, ASAZ) of the AK8975/AK8963 magnetometer. However INV_MPU9X50_MAGN_CHAN() never sets .address, so it is 0 for all three magnetometer channels. As a result the Y and Z channels report the scale computed from the X axis adjustment value, and userspace scales the Y and Z readings with the wrong per-axis calibration. Set .address to the axis index (0 for X, 1 for Y, 2 for Z) in the channel macro, matching the order used to fill magn_raw_to_gauss[]. Fixes: b1392de06184 ("iio: imu: inv_mpu6050: add MPU925x magnetometer support") Signed-off-by: Arnav Kapoor Acked-by: Jean-Baptiste Maneyrol Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit ec0be1adeebf629b2b65f53b3fe19946ec070350 Author: Jean-Baptiste Maneyrol Date: Mon Oct 19 15:37:33 2026 +0200 iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change commit 4a141623442888458d147f4e61fe47411c0e4e17 upstream. For getting all odr change events, we need to parse all FIFO frames in each iio device. Fix this correctly by sending effectively all frames to all iio devices. Previously only batches of frames containing a matching sensor event were sent to the corresponding iio device. Fixes: f670d4d34773 ("iio: imu: inv_icm42600: fix odr change not caught in certain cases") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit b7fbfe0c814b6c13f2d793765b08dc2ad64547d6 Author: Christopher Hoover Date: Sun Oct 18 19:34:20 2026 -0700 iio: humidity: hid-sensor-humidity: Use per-instance callbacks commit bbe4f3f668babc9443fc1f075695e43e17ca7976 upstream. hid-sensor-humidity keeps a single static struct hid_sensor_hub_callbacks for all instances and overwrites its pdev in every probe, so with two humidity sensors, input reports for one are delivered with the other's platform device, and a NULL dereference follows once that device is removed. The same bug was found in hid-sensor-temperature, which shares this code. Keep the callbacks in struct hid_humidity_state, as the other HID sensor drivers (accel, gyro, als, ...) do. Fixes: d7ed89d5aadf ("iio: hid: Add humidity sensor support") Cc: stable@vger.kernel.org Signed-off-by: Christopher Hoover Reviewed-by: Joshua Crofts Acked-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 21189821e36b0d8d7734d0d6d556d30767a80645 Author: Vidhu Sarwal Date: Mon Sep 28 19:54:50 2026 +0530 iio: humidity: am2315: fix negative temperature decoding commit 0a570feeca37d85fbfd6b4f6e3d9f33e1461c634 upstream. The AM2315/AM2320 report temperature as a sign-magnitude value, with bit 15 as the sign and bits 14-0 as the magnitude. am2315_read_data() stores the raw value directly in an s16, causing negative temperatures to be interpreted as two's complement. Both the read_raw and the triggered buffer paths are affected. Decode the sign bit before storing the temperature value. Positive readings are unaffected. Fixes: 366a3270c1c5 ("iio: humidity: Add support for AM2315") Signed-off-by: Vidhu Sarwal Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 03190df3a1839aafd9ecc80ba7e95ce88ba458d3 Author: Srinivas Pandruvada Date: Wed Nov 4 08:53:19 2026 -0800 iio: hid-sensors: fix fractional part for unit exponents -7 and -8 commit 79c8dffd84e9784ec05bea68dbe5e71f7ec9941a upstream. split_micro_fraction() scales the remainder to micro units by multiplying it by 10^(6 - exp). The unit exponent of a HID field goes down to -8, so exp can be 7 or 8 here. Then the argument of int_pow() is negative, which the unsigned parameter turns into a huge power of ten: 0 modulo 2^64. As a result, the fractional part of a value read from the hysteresis attributes is always reported as 0. Divide by 10^(exp - 6) in these two cases. This matches the reverse conversion in convert_to_vtf_format(). Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Pandruvada Tested-by: Semyon Maryasin Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit eb2872920b64973c2aa00b05e0cf2824b87fd8a9 Author: Maximilian Czirr Date: Wed Oct 7 02:01:07 2026 +0200 iio: hid-sensor: Fix scale for magnetic north heading commit c72dcaeaabd60e164e7324f80ccb037e879eefdd upstream. hid_sensor_format_scale() applies the HID unit exponent only when the usage and unit match an entry in unit_conversion[]. Rotation-from-north support uses HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH, but that usage has no entry in the conversion table. As a result, the unit exponent is ignored and the heading can be exposed with a scale of 1 instead of the scale specified by the HID descriptor. Add a unitless conversion entry so the HID unit exponent is applied to the magnetic north heading. A sensor reporting an exponent of -5 then correctly exposes a scale of 0.00001 instead of 1. Fixes: abea9c62c32f ("iio: hid-sensor-magn-3d: Add support for rotation from north") Cc: stable@vger.kernel.org Signed-off-by: Maximilian Czirr Acked-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 3b20ae4582d9b8aefe2c6aed94e40fe531c41e50 Author: Jiale Yao Date: Fri Sep 25 22:09:54 2026 +0800 iio: gyro: bmg160: reject duplicate event disable commit d0c8bd5d18a492d64d05482f4b1700e14df7ff84 upstream. The IIO core does not filter duplicate writes to the event enable attribute. bmg160_write_event_config() already ignores repeated enable requests, but a repeated disable request still calls bmg160_set_power_state(data, false), dropping a runtime PM reference that was not acquired for this request. This can underflow the runtime PM usage count and trigger a "Runtime PM usage count underflow" warning. Return early when the requested state already matches ev_enable_state. Fixes: 22b46c45fb9b ("iio:gyro:bmg160 Gyro Sensor driver") Signed-off-by: Jiale Yao Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 436f3581184b77026843c06981e47305f996c806 Author: Baek Kyu, Kim Date: Sun Oct 25 23:13:51 2026 +0900 iio: dac: mcp4725: Update the cached DAC value only on success commit 098a4c37dc8815ea941866179220394e4d182c67 upstream. mcp4725_write_raw() updates dac_value even if mcp4725_set_value() rejects the requested value or reports an I2C transfer error. After writing 1000, a rejected write of 4096 returns -EINVAL without an I2C transfer, but out_voltage0_raw reports 4096. A later powerdown exit sends 00 00 instead of the 03 e8 frame for the last successful value. The EEPROM store path uses the same cache. Return the setter error before updating dac_value. This keeps the last successful software value for readback, powerdown exit and EEPROM writes. Fixes: cf35ad61aca2 ("iio: add mcp4725 I2C DAC driver") Signed-off-by: Baek Kyu, Kim Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 08b6d97a5d51d7204c99be9b6a5e7edc808adbb3 Author: Arnav Kapoor Date: Tue Oct 6 10:22:41 2026 +0530 iio: common: scmi_sensors: fix truncating 64-bit divisions commit 043ececf147863fbd253687aa0b9edcac358a711 upstream. do_div() divides a 64-bit dividend by a 32-bit divisor: the divisor is stored in a uint32_t on all architectures. The driver passes 64-bit divisors to it in several places, so they are silently truncated: - scmi_iio_set_odr_val() divides by uHz, which exceeds 32 bits for sampling frequencies above ~4294 Hz. - convert_ns_to_freq() divides by interval_ns, which exceeds 32 bits for update intervals of ~4.29 s and above. If its low 32 bits happen to be zero, this is a division by zero. - scmi_iio_get_odr_val(), scmi_iio_convert_interval_to_ns(), scmi_iio_sensor_update_cb() and scmi_iio_get_raw_available() divide by int_pow(10, n), which returns u64 and exceeds 32 bits for n >= 10. The SCMI exponent fields allow values down to -16. Truncation results in wrong sampling frequency, timestamp and raw_available values being reported to userspace. Use div64_u64() and div64_u64_rem(), which take a 64-bit divisor. Fixes: f774117c96f9 ("iio/scmi: Adding support for IIO SCMI Based Sensors") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202606040245.XfmRpBhA-lkp@intel.com/ Signed-off-by: Arnav Kapoor Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 3e85abc81b76f4a058efabd3c26b2cf20607b4c5 Author: Nikhil Gautam Date: Mon Oct 12 17:15:53 2026 +0530 iio: atlas-ezo: Fix humidity channel read support commit 0cb3fc8987038a26ac0f581bfa26b16daf6ca6a7 upstream. The atlas_ezo_read_raw() function rejects channels that are not of type IIO_CONCENTRATION, preventing the relative humidity channel from reading raw and scale values. Remove the early channel type check to allow both concentration and relative humidity channels to reach the mask-specific handling. Fixes: dc3ebfcaa51f ("iio: chemical: atlas-ezo-sensor: add humidity sensor support") Signed-off-by: Nikhil Gautam Reviewed-by: Joshua Crofts Reviewed-by: Matt Ranostay Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit a7168673f30a4183b136ec7182b12f87b605540d Author: Andrea Amer Date: Mon Oct 26 11:57:38 2026 +0100 iio: afe: rescale: expose offset if rescaler or source has one commit c293f0db308fe76a0a9b0f6674cd2dea149b03aa upstream. A rescale channel advertises IIO_CHAN_INFO_OFFSET only when its own offset is non-zero. A child rescale therefore hides a source offset, and consumers apply raw * scale and drop it, even though rescale_read_raw() folds the source offset in. Expose the attribute when either the rescaler or the source channel provides an offset. Fixes: a29c3283653b ("iio: afe: rescale: add offset support") Signed-off-by: Andrea Amer Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit f901740c74244c8084435c7b71bcdee7b3ad7544 Author: Billy Tsai Date: Mon Oct 5 18:22:54 2026 +0800 iio: adc: aspeed: Use syscon phandle for trimming data when available commit 4e7007317fdf83b5201f39afff5adfa0292fc707 upstream. aspeed_adc_set_trim_data() locates the SCU holding the ADC's reference-voltage trimming data with of_find_node_by_name(NULL, "syscon"), a global search that matches the first device-tree node named "syscon" regardless of which SCU instance it actually is. On AST2700, which splits its SCU into "syscon0" (soc0) and "syscon1" (soc1), both nodes share the same node name "syscon" and only differ by label and unit address, so the lookup always resolves to syscon0 even though the ADC's trimming data lives in syscon1. Use the new "aspeed,trim-syscon" phandle property when present to look up the correct regmap directly, falling back to the old global by-name search when the property is absent so existing device trees keep working. Fixes: 9d8b88ffb773 ("iio: adc: aspeed: Add AST2700 ADC support") Signed-off-by: Billy Tsai Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 2dd089f96125ce2333f16c899e13172f0bb1e0e5 Author: Yu-Hsiang Tseng Date: Mon Oct 12 15:41:44 2026 +0800 iio: acpi: Accept comma separated values in ROTM strings commit dd53f1841ecfa2da152cbc31038a5f125b2b9e57 upstream. The ROTM method of the MXC6655 accelerometer on the Higole F9B, an Alder Lake-N handheld (AMI BIOS F9D_16G_P800217, DMI strings are all "Default string"), separates the values with a comma and a space: Method (ROTM, 0, NotSerialized) { Name (SBUF, Package (0x03) { "-1, 0, 0", "0, 1, 0", "0, 0, 1" }) Return (SBUF) } iio_read_acpi_mount_matrix() only accepts the space separated form used in Microsoft's example ("0 1 0"). It rejects this matrix and mxc4005 falls back to the identity matrix: mxc4005 i2c-MXC6655:00: Incorrect ACPI mount matrix string format mxc4005 i2c-MXC6655:00: mounting matrix not found: using identity... With the X axis not inverted, iio-sensor-proxy reports left-up when the device is held right-up and vice versa, so the desktop turns the picture upside down whenever the handheld is held in landscape. It is not the only BIOS written this way. The BOSC0200 on the AYANEO Air Plus uses commas in its ROMS method as well, with a space before one of them, and its ROMK method has "1, 0,0": Method (ROMS, 0, NotSerialized) { Name (SBUF, Package (0x03) { "-1, 0, 0", "0, -1 , 0", "0, 0, -1" }) Return (SBUF) } The kernel's sscanf() does not support '%*[', so there is no clean way to take both separators in a single format string. That leaves either a second sscanf() call with a comma format, or normalizing the separator first. Do the latter: turn the commas into spaces before parsing, so the existing "%d %d %d" format, which already takes any amount of white space around the values, keeps working unchanged. The strings live in the buffer acpi_evaluate_object() allocated for us, so they can be modified in place. With this change in_accel_mount_matrix on the Higole F9B reads "-1, 0, 0; 0, 1, 0; 0, 0, 1" and, with no udev hwdb override, the desktop rotates correctly in all four orientations. The AYANEO Air Plus was not tested; systemd's hwdb has an entry for it, which iio-sensor-proxy prefers over the kernel's matrix. Link: https://github.com/hhd-dev/hwinfo/blob/d9508123bee46ae3a59dc24826030ef51ea95058/devices/ayaneo_airplus/acpi/decoded/dsdt.dsl Cc: stable@vger.kernel.org # 6.10.x Signed-off-by: Yu-Hsiang Tseng Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit bffe72f91259b9500823780c1d1bfc04ce70bded Author: Guangshuo Li Date: Sat Oct 31 21:05:38 2026 +0800 iio: accel: kxsd9: Fix potential use-after-free on removal commit fd7334314f63a3a2a4927f209b2ca0e33d111840 upstream. Unregistering an IIO device with an active triggered buffer detaches its poll function. Freeing the poll function first can therefore make iio_device_unregister() access freed memory. Unregister the device before cleaning up the triggered buffer. This issue was found by our static analysis tool under development. Fixes: 0427a106a98a ("iio: accel: kxsd9: Add triggered buffer handling") Signed-off-by: Guangshuo Li Reviewed-by: Joshua Crofts Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 68fb52affdd6a24e329878c3d6394566a474c79c Author: Alexis Bouzigues Date: Tue Oct 6 19:08:58 2026 -0500 iio: accel: adxl313: add missing buffer selections in Kconfig commit 4e9f192f997dc56f309090233352d62edbea42ce upstream. The FIFO support added to the ADXL313 core uses devm_iio_kfifo_buffer_setup() and iio_push_to_buffers(), but its Kconfig entry does not select the required buffer support. Enabling either frontend without IIO_BUFFER or IIO_KFIFO_BUF causes undefined references to devm_iio_kfifo_buffer_setup_ext() and iio_push_to_buffers(). Select IIO_BUFFER and IIO_KFIFO_BUF from the shared ADXL313 core symbol so both the I2C and SPI frontends have the required dependencies. Fixes: ff8093fa6ba4 ("iio: accel: adxl313: add buffered FIFO watermark with interrupt handling") Cc: stable@vger.kernel.org Signed-off-by: Alexis Bouzigues Tested-by: Joshua Crofts Reviewed-by: Joshua Crofts Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 533ca4c7e27732788fb7d6a8b96bc0c9c8b034dd Author: Billy Tsai Date: Mon Oct 5 18:22:53 2026 +0800 dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs commit 6ec0623a7c77bc2c383e9971d7b0c9df3ec988fb upstream. The ADC's reference-voltage trimming data lives in a System Control Unit (SCU) register. SoCs with a single SCU instance let the driver locate it without any additional information, but SoCs such as AST2700 that expose more than one SCU node need an explicit phandle to disambiguate which one holds the trimming data. Add an "aspeed,trim-syscon" phandle property, and require it for the AST2700 compatibles since they are the first multi-SCU SoCs supported by this driver. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Billy Tsai Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 75565129183c8e264913528aef558062bd417352 Author: Johan Hovold Date: Fri Oct 23 14:15:25 2026 +0200 USB: serial: io_edgeport: serialise MCR accesses commit 6e4629504d7e5a22dd26f3b262f0a0f80e3cad6a upstream. Add a mutex to serialise modem control register updates to prevent concurrent tasks from interfering with each other. Note that the register updates are currently asynchronous so a task may read back a value which has not yet taken effect. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit eccbee22bb481d734e4320a322111b4607d343cd Author: Johan Hovold Date: Fri Oct 23 14:15:24 2026 +0200 USB: serial: io_edgeport: fix potential use-after-free on disconnect commit 50613e6380db7a904ef15c60ed0c436baf308f0a upstream. The driver submits command URBs asynchronously but fails to stop them on disconnect, something which could lead to a use-after-free when accessing driver data in the completion handler after a port has been unbound. Add an URB anchor to track and kill outstanding command URBs on disconnect. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 6921daf4bb75baafaae612ee3873b2ea4801bbd7 Author: Johan Hovold Date: Fri Oct 23 14:15:23 2026 +0200 USB: serial: io_edgeport: fix potential fifo corruption commit 270f76c3b88c9cc3d6ca58c5c0c0f34c2373b27c upstream. The device buffer size is determined during open() and the driver allocates a TX FIFO of corresponding size. Add the missing sanity check to prevent memory corruption in case a malicious device sends a second open response with a different buffer size. This issue was flagged by Sashiko when reviewing a related fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 125e9d954e1fe99862050dab339df3b9e64c95c2 Author: Johan Hovold Date: Fri Oct 23 14:15:22 2026 +0200 USB: serial: io_edgeport: move initial termios update to open() commit febadc65a4ef8d08a12e76d6ec50834d72cc0e59 upstream. Explicitly update the terminal settings on open() instead of doing so from the interrupt completion handler when receiving an open command response, which in theory can be received after a failed open attempt. Note that this will be used to fix a FIFO corruption issue and also allows for switching to synchronous commands. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit a2a29e3f9bf91198d89e9705ef3c008635b1d729 Author: Johan Hovold Date: Fri Oct 23 14:15:21 2026 +0200 USB: serial: io_edgeport: fix potential NULL-deref at open commit a0403880a0a638f189e5187068244d9fd5bc8d4d upstream. Do not mark the port as open until after the write FIFO has been allocated and initialised to prevent a racing interrupt completion from attempting to send stale data and dereference the FIFO buffer pointer. Note that the open flag defaults to false and is cleared on close() so there is no need to reinitialise it on every open(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 4097ed4285d32c732650d328dfa5d1ba141e8703 Author: Johan Hovold Date: Fri Oct 23 14:15:20 2026 +0200 USB: serial: io_edgeport: fix potential close() use-after-free commit 839ff5fa30995c40cd5fba15fd976ad63416738a upstream. Add the missing open check on write() and locking when updating the port status during close() to prevent a racing interrupt completion handler from trying to submit more data for the port while its write URB and FIFO are being deallocated. This issue was flagged by Sashiko when reviewing a related fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit d2825ac981cc51d72e9ce65085aa1a2cda9b1570 Author: Johan Hovold Date: Fri Oct 23 14:15:19 2026 +0200 USB: serial: io_edgeport: fix NULL-deref on early status commit ae22e9b6412e5dc99e1cf8bd13c6176d44c7d42e upstream. The driver submits the interrupt-in URB during probe or on first port open, which on completion may submit the bulk-in URB before all ports have been opened and their waitqueues have been initialised. If a (malicious) device sends a status message for a port that has not yet been opened this may lead to a NULL-pointer dereference in the bulk-in completion handler when attempting to wakeup blocked tasks. Move waitqueue initialisation from open() to port_probe() to address this. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com Link: https://lore.kernel.org/6a8818d8.ae6ddae5.3da009.0031.GAE@google.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 6aacb6cbc27ac03379a5fb06be3ed723f2b325ba Author: Johan Hovold Date: Mon Oct 19 14:34:12 2026 +0200 USB: serial: upd78f0730: fix NULL-deref on hangup commit 0e0b1fcfb80c0490bda7f7eb633ebb5e431c2e16 upstream. The port tty pointer is cleared on hangup before deasserting the modem control signals and should not be used in the dtr_rts() callback. Factor out a new upd78f0730_port_tiocmset() helper that can be used in upd78f0730_dtr_rts() to avoid dereferencing a NULL-pointer on hangup (e.g. on disconnect). This issue was flagged by an LLM. Fixes: ea534e0b4047 ("USB: serial: add uPD78F0730 USB to Serial Adaptor Driver") Cc: stable@vger.kernel.org # 4.11 Cc: Maksim Salau Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 6f3ef3485a7df6fc3e6674cda2109ba4eccff919 Author: Tristan Madani Date: Mon Oct 19 10:38:49 2026 +0000 USB: serial: sierra: validate URB length in instat callback commit a3d43b39032cc5565a5693a10c581844342372cd upstream. sierra_instat_callback() reads request fields and one byte past the usb_ctrlrequest header without first checking that urb->actual_length is large enough. A short USB interrupt transfer could cause an out-of-bounds read. Add two length checks matching the pattern already present in the option driver (option_instat_callback): one for the request header before accessing bRequestType, and one for the line-state data byte inside the serial-state notification handler. Use dev_err() since failing these checks causes the interrupt URB not to be resubmitted. Fixes: 033a3fb980b041 ("USB: Sierra Wireless driver update") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani [ johan: use sizeof(*req_pkt) consistently ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit c6e790c0b9166e91d1c5d638c14f24c7b6dcec9e Author: Hui Peng Date: Wed Sep 30 07:52:47 2026 +0000 USB: serial: garmin_gps: validate packet data length in nat_receive() commit ca783a2d55b3361493917ad4a3573715ba902503 upstream. In nat_receive() (called from garmin_write() when userspace writes to /dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p->insize is less than GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into garmin_data_p->inbuffer. Once garmin_data_p->insize reaches GARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as: len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p->inbuffer); Because getDataLength() returns a signed int from __le32_to_cpup(), a 12-byte header with a negative 32-bit length field (such as 0xfffffff5, i.e., -11) causes len to underflow to a small positive value (12 + (-11) = 1) without any bounds check at that point. Then garmin_data_p->insize >= len (12 >= 1) evaluates to true and nat_receive() calls garmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab buffer via kmemdup() and immediately reads 4 bytes from it in getLayerId(buffer) (and again in garmin_write_bulk_callback() when the URB completes): BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500 Read of size 4 at addr ffff888002cc0ba0 by task init/1 Call Trace: dump_stack_lvl+0x70/0xa0 print_report+0x153/0x4c6 kasan_report+0xf1/0x120 garmin_write_bulk.constprop.0+0x3eb/0x500 garmin_write+0x60f/0x1450 serial_write+0x123/0x200 n_tty_write+0x8ea/0xeb0 file_tty_write.isra.0+0x44f/0x7a0 vfs_write+0x671/0xd20 Validate the unsigned 32-bit data length (dlen >= GPS_IN_BUFSIZ - GARMIN_PKTHDR_LENGTH, matching the existing len >= GPS_IN_BUFSIZ bound) in nat_receive() as soon as the 12-byte header is present, resetting insize and returning -EINVPKT on invalid lengths so garmin_write_bulk() is only ever called with a full valid packet header (12 <= len < GPS_IN_BUFSIZ). Tested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS device (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0 to MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native packet with data length 0xfffffff5: on the unfixed kernel this triggers KASAN slab-out-of-bounds reads in garmin_write_bulk() and garmin_write_bulk_callback(), whereas on the fixed kernel nat_receive() rejects the packet with -EINVPKT and 0 KASAN faults. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Hui Peng [ johan: move comment and dev_dbg(); add comment about redundant check ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 749ecb1a854421631e188c35bfc6804533c1fe52 Author: Jesse Zhang Date: Tue Nov 3 17:55:00 2026 +0800 drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() commit de0f2a6eabd019a3129025862bffca934a5d7180 upstream. When initializing the immediate entity fails, amdgpu_vm_init_entities() destroys that entity which was never set up, and when initializing the delayed entity fails, it returns without destroying the immediate one. On navi48, with the allocation of the immediate entity's scheduler list failing through failslab while opening the render node: Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] RIP: 0010:do_raw_spin_lock+0x7b/0x280 _raw_spin_lock+0x3c/0x50 drm_sched_rq_remove_entity+0x90/0x2a0 [gpu_sched] drm_sched_entity_kill+0x86/0x5a0 [gpu_sched] drm_sched_entity_fini+0x23/0x270 [gpu_sched] drm_sched_entity_destroy+0x24/0x30 [gpu_sched] amdgpu_vm_init_entities+0xc7/0x100 [amdgpu] amdgpu_vm_init+0x5d1/0x1480 [amdgpu] amdgpu_driver_open_kms+0x2b1/0xd10 [amdgpu] Only destroy the immediate entity once it exists and the delayed one failed. Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected") Reviewed-by: Christian König Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher (cherry picked from commit 2f538f57501a71baeb7116ff7485f9a7025e4fb9) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 9506c575720ccb171a3f11e3d0c4519bdafb849a Author: Jesse Zhang Date: Wed Nov 4 12:18:53 2026 +0800 drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings commit 1a5ca15b558bf0e6621602c84e0a633d237dd052 upstream. criu_checkpoint_bos() asks every device of the process whether a BO is mapped there, passing its drm_priv, which is NULL for the devices the process never acquired a VM on. On navi48 with its iGPU, checkpointing a process which acquired the VM of the dGPU only: Oops: general protection fault, probably for non-canonical address 0xdffffc000000002f: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000178-0x000000000000017f] RIP: 0010:amdgpu_amdkfd_bo_mapped_to_dev+0x35/0x160 [amdgpu] kfd_ioctl_criu+0x30d1/0x4aa0 [amdgpu] kfd_ioctl+0x767/0xb10 [amdgpu] Nothing can be mapped on such a device, skip it. Fixes: f9e292cbba21 ("drm/amdkfd: kfd_bo_mapped_dev support partition") Reviewed-by: Felix Kuehling Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher (cherry picked from commit 794381c358d344d8fcf8b9e6426aa2bac0a7d1f7) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 56cae0c7efa27bdf3a242c16a6809edc585d746c Author: Josef Bacik Date: Tue Oct 27 17:04:42 2026 +0100 w1: w1_therm: leave the slaves of other families alone commit c0eadd2e06e52563cae2b80491e56eb9712eb727 upstream. The file therm_bulk_read belongs to the bus master. Its callbacks walk all the slaves of the bus and look at sl->family_data as if every slave were a temperature sensor. A 1-wire bus can carry other devices too: - The family data of a slave which is driven by another driver, such as w1_ds2433, w1_ds250x, w1_ds28e04 or w1_ds28e17, is a structure of that driver. bulk_read_support() takes whatever is at the offset of specific_functions for a pointer and dereferences it, and if the result happens not to be 0, the callbacks write the state of the conversion into that foreign structure. - For a slave without family data, which is the case for most of the other drivers and for the default family, trigger_bulk_read() gives up with -ENODEV. A single serial number chip on the bus is enough to make the bulk read unusable for all the sensors. Only look at the slaves whose family is one of ours. A bulk conversion now works on a bus with other devices. Fixes: 57c76221d5af ("w1_therm: adding bulk read support to trigger multiple conversion on bus") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-9-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 715c04b8f07dda99e68f382e61ff31a4ae2edfb3 Author: Josef Bacik Date: Tue Oct 27 17:04:34 2026 +0100 w1: use the bus mutex for the "rw" file commit 8599e08648c0b4913ea7b202511f1294d176e793 upstream. Commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.") gave the bus a mutex of its own, because the lock which protects the list of slaves is held while a slave is removed, which waits for the sysfs callbacks of the slave, so these must not take it. It converted all the slave drivers, but not the "rw" file of the default family in w1.c, which still takes the mutex of the master to talk on the bus. That has two consequences: - A deadlock. w1_process() holds the mutex of the master while it searches the bus and detaches the slaves which have gone: w1_process() read() of .../rw mutex_lock(&dev->mutex) kernfs active reference w1_search_process() rw_read() w1_slave_detach() mutex_lock(&master->mutex) w1_unref_slave() waits device_unregister() waits for the reference The file is readable for everybody. - The accesses through this file are not serialised with those of the slave drivers, which take bus_mutex, so that two transactions can get mixed up on the wire. Take bus_mutex here as well. It also excludes the search, which takes it for every pass. Fixes: b02f8bede217 ("W1: split master mutex to avoid deadlocks.") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-1-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit a07b44d9a463f04928aa65b1d03dd42417c62ae6 Author: Josef Bacik Date: Tue Oct 27 17:04:35 2026 +0100 w1: remove the master's files before taking its locks commit dfc57752ec53c3cc6105656d3037fb2f5e80e9cc upstream. __w1_remove_master_device() calls w1_destroy_master_attributes() with both the mutex of the master and list_mutex held. Removing the files waits for the callbacks which are running, and nearly all of them take one of these two locks: __w1_remove_master_device() read() of .../w1_master_slaves mutex_lock(&dev->mutex) kernfs active reference mutex_lock(&dev->list_mutex) w1_master_attribute_show_slaves() w1_destroy_master_attributes() mutex_lock(&md->list_mutex) sysfs_remove_group() waits waits for the reference The files are readable for everybody, and a bus master goes away when, for instance, a DS2490 USB adapter is unplugged. Remove the files first, before the locks are taken. That has to be done before the slaves are detached and not afterwards: as long as the files exist, a write to w1_master_add could attach a new slave behind the back of this function, which would then wait for the reference count of the master for ever. And it is done before the thread is stopped, because a write to w1_master_search wakes the thread up. Fixes: c30c9b15187e ("W1: fix deadlocks and remove w1_control_thread") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-2-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 4187e08612650fbb597a998bc5889b46d887425c Author: Josef Bacik Date: Tue Oct 27 17:04:39 2026 +0100 w1: netlink: drop the slave after the bus is unlocked commit 847fa880a3e1b2fdbbf72d89e830566108457637 upstream. w1_process_cb() executes the commands of a netlink message with bus_mutex held, and drops the reference to the slave which the message was addressed to before it unlocks the mutex. If the slave has been detached in the meantime, this is the last reference, and w1_unref_slave() tears the slave down on the spot. That waits - in device_unregister(), for the sysfs callbacks of the slave which are running, and - in w1_therm_remove_slave(), for the readers which have taken a reference to the family data, and both kinds take bus_mutex to talk to the slave. Whoever is waiting for the mutex at that moment is never going to finish, and neither is the thread of the bus master. Unlock the bus first. The reference keeps the slave, and with it the master, alive until then. Fixes: d3a8a9dbb903 ("w1: hold bus_mutex in netlink and search") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-6-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 7b0171379709997b83f907b9554b96d007709cdd Author: Josef Bacik Date: Tue Oct 27 17:04:37 2026 +0100 w1: ds28e04: use the bus mutex to talk on the bus commit 5bc51235d0ad4a4991e38f4e9dc3440738296850 upstream. Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.") the slave drivers serialise their accesses to the bus with bus_mutex. This driver, which was merged shortly afterwards, takes the mutex of the master in the callbacks of its eeprom and pio files instead. That mutex is held while a slave which has disappeared from the bus is removed, which waits for the sysfs callbacks of the slave to return. A callback which is waiting for the mutex at that moment never does: both tasks are stuck, and with them the thread of the bus master. Besides, it does not keep the other slave drivers off the bus, so that two transactions can get mixed up on the wire. Fixes: fbf7f7b4e2ae ("w1: Add 1-wire slave device driver for DS28E04-100") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-4-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit b4ade43362a6634e0f84fe458dcf2a51f54227b6 Author: Josef Bacik Date: Tue Oct 27 17:04:38 2026 +0100 w1: ds2805: use the bus mutex to talk on the bus commit a2e52ccce044e13d2695bb1bbdc07942727f28dd upstream. Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.") the slave drivers serialise their accesses to the bus with bus_mutex. This driver takes the mutex of the master in the callbacks of its eeprom file instead. That mutex is held while a slave which has disappeared from the bus is removed, which waits for the sysfs callbacks of the slave to return. A callback which is waiting for the mutex at that moment never does: both tasks are stuck, and with them the thread of the bus master. Besides, it does not keep the other slave drivers off the bus, so that two transactions can get mixed up on the wire. Fixes: f6887531c0c6 ("drivers: w1: Add 1w slave driver for DS28E05 EEPROM") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-5-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 11722b558d4a8113ebb163304aebcb29b2de3c11 Author: Josef Bacik Date: Tue Oct 27 17:04:36 2026 +0100 w1: ds2482: set the strong pull-up with its byte commit e4f673632fa8292a2922bcfbb39519b08016b382 upstream. The eight channels of a DS2482-800 are eight independent 1-wire masters for the w1 core, but share one I2C device. Each bus operation consists of several I2C transfers: select the channel, send the command, poll the status, set the read pointer, read the result. access_lock keeps the operations of the channels apart. ds2482_w1_set_pullup() polls the status, writes the configuration and polls again without the lock. Polling sets the read pointer of the device to the status register. In the middle of a read on another channel, after that one has set the pointer to the data register, this makes the read return the status instead of the data. The cached copy of the pointer in pdev->read_prt can go wrong as well. The lock alone is not enough. The strong pull-up is a setting of the whole chip which is used up by the next byte. If an operation of another channel gets in before the byte it was meant for, that channel gets the pull-up, and the sensor converts without power. So only note the request in ds2482_w1_set_pullup(), and write the configuration in ds2482_w1_write_byte(), under the lock and after the channel has been selected. The w1 core calls the former right before the latter, under the bus mutex of the channel. Fixes: 9c95bb6f25ff ("w1: ds2482: Added 1-Wire pull-up support to the driver") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-3-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit e5081de9dd4f51c64ea2b1d73196f2a359c79777 Author: Josef Bacik Date: Tue Oct 27 17:04:40 2026 +0100 w1: don't hold list_mutex while a slave is torn down commit 7ef382cb0ae0b2d6df4fbc5c822cd80394308839 upstream. When the last reference to a slave is dropped, w1_unref_slave() holds list_mutex of the master until the slave has been freed. In between it calls the ->remove_slave() callback of the family driver and device_unregister(). Both wait for others: for the sysfs callbacks which are running, and in the case of w1_therm also for the file therm_bulk_read of the master and for everybody who is talking to the sensor. None of those can therefore take list_mutex, although the callbacks of therm_bulk_read walk the list which it protects. The mutex is only needed to make the decrement of the reference count and the removal from the list one step for w1_search_slave() and w1_slave_search_device(), which look the slave up in the list and, in the first case, take a reference. Once the slave is off the list, nobody can find it any more. Drop the mutex at that point. The callers which hold the mutex of the master, which serialises attaching and detaching, are not affected. The one which does not is w1_process_cb(), when it drops the last reference to a slave which has been detached while a netlink command for it was queued. Somebody who attaches a slave with the same ID through sysfs or netlink at that very moment used to wait until the old device was gone. Now the registration of the new device may fail because the name is still in use. This is a preparation for "w1: w1_therm: lock the list of slaves for the bulk read". Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-7-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 57d00d6d90f4ebfdf69d81a64e7de463db954f48 Author: Radhey Shyam Pandey Date: Mon Sep 28 17:30:15 2026 +0530 usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove commit 6c6508e742b47539224eb18cb23f7ed5d401dcb6 upstream. dwc3_xlnx_init_zynqmp() leaves the controller out of reset with the PHY powered on, but nothing undoes that if probe fails later or when the driver is removed. The resets stay deasserted and the PHY stays on with no driver bound. Register the teardown with devm_add_action_or_reset() once init has completed, so it runs on probe failure without the driver having to track how far init progressed. The teardown only undoes the reset cycle init performed, so it carries the same usb3-phy guard: with no PHY the resets were never asserted, and asserting them could break a USB3 configuration that is live but missing from the device tree. The resets have to be asserted while the clocks are still running, so both the probe error path and remove() run the teardown explicitly before gating the clocks rather than leaving it to devres, which would otherwise run it afterwards. devm_release_action() unlinks the action before calling it, so devres cannot run it a second time. Running it from remove() also covers .shutdown, which shares dwc3_xlnx_remove(): device_shutdown() does not call devres_release_all(), so a teardown left to devres would never run there. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Cc: stable Suggested-by: Philipp Zabel Assisted-by: Claude:claude-opus-5 Signed-off-by: Radhey Shyam Pandey Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20260928120015.3152461-4-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 1cc51fa79ab197916f512bfe735d90fa7b341692 Author: Radhey Shyam Pandey Date: Mon Sep 28 17:30:14 2026 +0530 usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths commit f33f0dd2eb014bffda02ecfd182de3ddab058596 upstream. If reset deassert or PHY setup fails partway through dwc3_xlnx_init_zynqmp(), re-assert the resets that were already released before unwinding the PHY. Only undo the reset cycle the function actually performed. The cycle is skipped when no usb3-phy is present, because asserting the core resets can break a USB3 configuration that is live but missing from the device tree, so the error path skips it for the same reason. Asserting an already asserted reset is harmless, so one block covers however far the deasserts progressed. Save the ZynqMP reset handles in driver private data so later probe teardown can re-assert released resets. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Cc: stable Assisted-by: Claude:claude-opus-5 Signed-off-by: Radhey Shyam Pandey Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20260928120015.3152461-3-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 56fbf3f92ff77e2ccf8a3926f015f304ffd5580e Author: Radhey Shyam Pandey Date: Mon Sep 28 17:30:13 2026 +0530 usb: dwc3: xilinx: fix system suspend and resume PHY handling commit 2fad8d241a6833d0c7aeafa0ab596e83c7b4ec9c upstream. System suspend and resume error paths do not handle PHY and clock resources correctly. Suspend calls phy_exit() without first powering off the PHY and ignores failures, while resume can leave clocks enabled if PHY reinitialization fails. Propagate errors to the PM core and unwind resources to ensure a consistent state on suspend and resume failures. Fixes: d6edcdc1ef06 ("usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure") Cc: stable Assisted-by: Claude:claude-opus-5 Signed-off-by: Radhey Shyam Pandey Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20260928120015.3152461-2-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit dcf34d1f7331d9ff3340d07327477d09f086d8c3 Author: Thinh Nguyen Date: Wed Oct 21 00:38:13 2026 +0000 usb: dwc3: gadget: Wait for End Transfer completion on ep disable commit 1338410c21a5710b7ba88057034d35367ba0f054 upstream. The End Transfer command on ep disable is issued without interrupt, and the endpoint flags are cleared right after a fixed delay. The command may not have completed by then. If the function driver re-enables the endpoint and queues a request, the next Start Transfer fails with "No Resource". Issue the End Transfer command with interrupt on ep disable, and keep DWC3_EP_END_TRANSFER_PENDING and DWC3_EP_TRANSFER_STARTED until the command completes. Defer the no-op Start Transfer of a stream endpoint re-enabled in the meantime to the command completion. Fixes: c5353b225df9 ("usb: dwc3: gadget: don't enable interrupt when disabling endpoint") Cc: stable Reported-by: Selvarasu Ganesan Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/ Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/24fa8adeb0222dab415c8c2799405188440bad4b.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 751d7b8c64ae9c0f704bd3da38f28bee80a4ff11 Author: Thinh Nguyen Date: Wed Oct 21 00:37:56 2026 +0000 usb: dwc3: gadget: Track a timed out End Transfer commit af91c6322e633504aa45de278f5d520f39d127be upstream. If an End Transfer command with CMDIOC times out, the driver clears the resource index but keeps DWC3_EP_TRANSFER_STARTED without setting DWC3_EP_END_TRANSFER_PENDING. The command is still outstanding, but a later stop issues another End Transfer with resource index 0, and the next Start Transfer fails with "No Resource". Mark the timed out End Transfer as pending so that no other command is issued to the endpoint until it completes. For any other failure, there is no outstanding command, so clear DWC3_EP_TRANSFER_STARTED. Fixes: e192cc7b5239 ("usb: dwc3: gadget: move cmd_endtransfer to extra function") Cc: stable Reported-by: Selvarasu Ganesan Closes: https://lore.kernel.org/linux-usb/3fdda532-8181-48e9-b58d-cad7289408e7@samsung.com/ Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/5815c41a7e7923edb114741f29697cf0161f523c.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit c8aafd2351a834df9f371219895505d9e7a20952 Author: Thinh Nguyen Date: Wed Oct 21 00:38:19 2026 +0000 usb: dwc3: gadget: Reset endpoint flags on controller start commit 7c9bc134e5b3315e0456cda9e8e59c752309ea78 upstream. The flags of a disabled endpoint may be preserved while its End Transfer command is pending. If the command never completes, the stale flags persist across a soft disconnect or an error recovery, and the endpoint can't be used again. Reset the flags of all non-control endpoints when starting the controller. Fixes: 76bff31c7fba ("usb: dwc3: gadget: Do not clear ep delayed stop flag during ep disable") Cc: stable Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/21cd189962b9d32a4f9df381df4947d35341d5a9.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 538d83fcd3c1914c04b54b4c9e381d6b3c7a93c5 Author: Thinh Nguyen Date: Wed Oct 21 00:37:51 2026 +0000 usb: dwc3: gadget: Reject requests to a disabled endpoint commit 5eb11b1647b0534b3a61a21473d77ebf4ffbed7c upstream. __dwc3_gadget_ep_disable() releases the lock while giving back requests, and DWC3_EP_ENABLED is only cleared afterward. A function driver can queue a new request in this window, and the driver would start a transfer on an endpoint that is already disabled in hardware. Clear DWC3_EP_ENABLED before giving back the requests, and reject requests queued to an endpoint that is not enabled. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Cc: stable Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/4ceab6aa5d6af0e4780f9d3a964fd5d8168a0a02.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit cb77cf17a170608517b3abea8bbd103313f20858 Author: Thinh Nguyen Date: Wed Oct 21 00:38:24 2026 +0000 usb: dwc3: gadget: Recover from End Transfer timeout commit 61575534fb05d52d36979f38976ece74649f091a upstream. If the End Transfer command times out, the endpoint resource is never released and every subsequent Start Transfer to the endpoint fails with "No Resource". Schedule an error recovery to reset the controller. Signed-off-by: Thinh Nguyen Cc: stable Link: https://patch.msgid.link/7523e9a11303a33acd0b92a092fb0e8218d509d2.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 80ac370d7c62b325335f94e5be52cdbb24e40b61 Author: Thinh Nguyen Date: Wed Oct 21 00:38:07 2026 +0000 usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints commit e616d91e02881983e5dadf6980c4aa08123800b3 upstream. The function driver may re-enable an endpoint before the End Transfer command issued on ep disable completes. The no-op Start Transfer issued on ep enable then fails with "No Resource". Only stream endpoints need the no-op Start Transfer to initiate a stream. Other bulk and interrupt endpoints start their transfer when a request is queued. Skip it for those endpoints, and move it to a helper to be reused. Fixes: a97ea994605e ("usb: dwc3: gadget: offset Start Transfer latency for bulk EPs") Cc: stable Reported-by: Selvarasu Ganesan Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/ Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/227e97e30d26a017c92d7008a8633c01f955d088.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit fd9fc1e7ce30a81155de66e65f6b56889e3e80f7 Author: Thinh Nguyen Date: Wed Oct 21 00:38:02 2026 +0000 usb: dwc3: gadget: Clear delayed stop on End Transfer completion commit f2bd20f92a7dc68980a6098397503067192ce63a upstream. When an End Transfer command times out outside of the SETUP phase, the driver sets DWC3_EP_DELAY_STOP to retry it on the next SETUP phase. If the command completes in the meantime, the flag is left set. Requests queued to the endpoint are then deferred, and the retry may end a transfer that is started later. Clear DWC3_EP_DELAY_STOP when the End Transfer command completes. Fixes: 4db0fbb60136 ("usb: dwc3: gadget: Don't delay End Transfer on delayed_status") Cc: stable Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/c28a9660f7b6bfa626077ddcfbadd50e6b503f86.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 6b770a6f02dd17b1629387ffd5cf8b5cfeaff9a9 Author: Thinh Nguyen Date: Wed Oct 21 00:47:17 2026 +0000 usb: dwc3: trace: Restore request name assignment commit d8090de52e0a8f1761ced4fc31d52a3e289e341c upstream. The commit 0a06917432a7 ("usb: dwc3: Log dwc3 address in traces") removed the __assign_str(name) call from dwc3_log_request. The name field still exists in the trace event, but nothing fills it in, so the endpoint name printed for these events is leftover garbage from the ring buffer. Put the __assign_str() call back so the endpoint name is logged again. Fixes: 0a06917432a7 ("usb: dwc3: Log dwc3 address in traces") Cc: stable Signed-off-by: Thinh Nguyen Link: https://patch.msgid.link/8bd045b136bfef8ce5de79f1fa2f09db639f0707.1792543567.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit e6a6b91739c1f81930457679d33d1f8be64aa81c Author: Krystian Kaniewski Date: Thu Oct 22 11:13:59 2026 +0200 usb: gadget: u_serial: pin ports while TTYs are installed commit 1981b53c2b52a00f0f4b9eb87183c9aedc8dac5d upstream. A slab-use-after-free can occur when gserial_free_line() frees struct gs_port while it is still reachable through an installed TTY. The port->port.count value tracks successful opens, but it is zero before gs_open() and again after gs_close(), before TTY cleanup has finished. Teardown can therefore free gs_port while tty_init_dev() or release_tty() still accesses its tty_port. Manage gs_port lifetime with tty_port references. Take a reference in gs_install(), drop it in gs_cleanup(), and move the final free to gs_port_destruct(). Unregister the TTY device before dropping the owner reference. Keep each minor reserved until the old port is destroyed so an installed TTY for one generation cannot overlap a replacement at the same minor. Publish the new port before device registration so the cdev and add uevent never expose a TTY before gs_install() can pin it. Since commit 8df07fe93573 ("tty: fix saved termios reset race"), u_serial registration no longer frees saved termios. On registration failure, unpublish the port before dropping its owner reference. Check in gs_open() that the installed port is still the published generation. Track failures after a successful install so close callbacks issued by the TTY core do not decrement port->port.count for opens that never incremented it. Fixes: 19b10a8828a6 ("usb: gadget: allocate & giveback serial ports instead hard code them") Assisted-by: Gemini:gemini-3.8-flash syzbot Reported-by: syzbot+fe63e4d633540f230624@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=fe63e4d633540f230624 Link: https://syzkaller.appspot.com/ai_job?id=ec789387-2e7b-4a8f-a7a1-a47bf7fa57f5 Cc: stable Signed-off-by: Krystian Kaniewski Tested-by: syzbot@syzkaller.appspotmail.com Tested-by: Mehmet Fide Reported-by: syzbot+bca09f5d8b843bbf7571@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=bca09f5d8b843bbf7571 Link: https://patch.msgid.link/20261022091359.1187468-1-krystianmkaniewski@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit d010585071193e268c4152df2b3281255280529b Author: Brian Ellis Date: Tue Oct 13 14:57:03 2026 -0600 usb: gadget: u_serial: fix NULL deref in gs_close() after failed open commit ea6cf69ad03c8d85138830c0d2c3b946b5ae231d upstream. gs_close() opens with struct gs_port *port = tty->driver_data; ... spin_lock_irq(&port->port_lock); and never checks port. gs_open() assigns tty->driver_data only on the port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL, and tty_open() calls tty_release(), and hence ->close(), when ->open() fails. syzbot hit exactly this on arm64. Fault injection failed the kfifo_alloc() of the write buffer in gs_open(): __kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44 gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636 tty_open+0x404/0x89c drivers/tty/tty_io.c:2137 and the tty core's close of the failed open then took port_lock through the NULL port: BUG: unable to handle kernel paging request in gs_close KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7] Call trace: spin_lock_irq include/linux/spinlock.h:372 [inline] gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698 tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745 tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146 Return early instead. There is nothing to release when the open never got far enough to claim the port. Unlike the check reverted by commit f6c7bc4a6823 ("Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io""), this is not hiding a race: the tty core calls ->close() for an ->open() that failed by design, so driver_data is legitimately unset on that path. Fixes: c1dca562be8a ("usb gadget: split out serial core") Reported-by: syzbot+782b2f1063e38ba8fa6e@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=782b2f1063e38ba8fa6e Cc: stable Assisted-by: LLM Signed-off-by: Brian Ellis Link: https://patch.msgid.link/20261013-u_serial-gs-close-null-v4-1-9ea038501994@gotenna.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit f02c502cf4d7ddaa4d42d5329a9949331ced245d Author: Cosmin Tanislav Date: Mon Aug 17 22:26:38 2026 +0300 usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty commit 78585f90feb3bbaf3b1c642294c8c47e451dc3cf upstream. ncm_wrap_ntb() aggregates datagrams into a pending NTB, which is sent either when it becomes full, or after 300us since the NTB was started, using ndo_start_xmit() (eth_start_xmit()). ndo_start_xmit() returns NETDEV_TX_BUSY when the TX freelist is empty. For regular packets this is fine since the networking core will requeue them, but for timer-flushed packets there is no logic to handle this situation, and HRTIMER_NORESTART is returned from ncm_tx_timeout() without checking eth_start_xmit()'s return value. Under sustained TX saturation the request freelist is empty most of the time. Since the timer is never restarted, small packets keep getting accumulated into the NTB, until either TX_MAX_NUM_DPE packets are stored or NTB_DEFAULT_IN_SIZE is reached, which is an unknown amount of time. Check the return value of ndo_start_xmit() and restart the timer after another 300us. Cc: stable Fixes: 6d3865f9d41f ("usb: gadget: NCM: Add transmit multi-frame.") Signed-off-by: Cosmin Tanislav Tested-by: Vladyslav Tymoshchuk Tested-by: Leonardo Costa Reported-by: Hiago De Franco Closes: https://lore.kernel.org/all/20231204183751.64202-1-hiagofranco@gmail.com/ Link: https://patch.msgid.link/20260817192638.437798-1-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit dc15fd316ac860b6904689941bb14527554e8a96 Author: Sonali Pradhan Date: Wed Oct 28 07:48:21 2026 +0000 usb: gadget: f_midi: fix UAF race during IN request handling commit 78a8d6537f1de34770e460edee360b556ef40427 upstream. f_midi_disable() drains and frees pre-allocated IN requests from in_req_fifo without holding midi->transmit_lock. If f_midi_transmit() runs concurrently on the workqueue, f_midi_do_transmit() can peek a request from in_req_fifo and write into its buffer while f_midi_disable() frees it, leading to a use-after-free. Additionally, when usb_ep_queue() fails in f_midi_do_transmit() (such as with -ESHUTDOWN when the endpoint is disabled concurrently), it resets req->length = 0 and returns active instead of the error code, causing the do-while loop in f_midi_transmit() to keep spinning under midi->transmit_lock until the substream is drained. Fix this by acquiring midi->transmit_lock in f_midi_disable() while releasing IN requests from in_req_fifo, and returning the error code from f_midi_do_transmit() when usb_ep_queue() fails so f_midi_transmit() aborts immediately and drops active substreams. Fixes: e1e3d7ec5da3 ("usb: gadget: f_midi: pre-allocate IN requests") Cc: stable Signed-off-by: Sonali Pradhan Link: https://patch.msgid.link/20261028074821.579450-1-sonalipradhan@google.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit efe2605be71f6f22dcdf08fa9a0b1669e41a68d2 Author: Yu Zhang Date: Tue Oct 20 12:30:50 2026 +1000 usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF commit 450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2 upstream. fsg_store_nofua() syncs the LUN's backing file when switching from async to sync mode: if (!nofua && curlun->nofua) fsg_lun_fsync_sub(curlun); fsg_lun_fsync_sub() dereferences curlun->filp (vfs_fsync(filp)). Unlike every other store that touches the backing file -- fsg_store_ro() and fsg_store_cdrom() (down_read), fsg_store_file() (down_write) -- fsg_store_nofua() holds no filesem while doing so. A concurrent close of the backing file runs under down_write(filesem) and does fput(curlun->filp) in fsg_lun_close() (fsg_store_file() with an empty path, the SCSI START_STOP eject in do_start_stop(), or forced_eject), so it can free the file while fsg_store_nofua() is dereferencing it: BUG: KASAN: slab-use-after-free in vfs_fsync+0x20/0xe0 vfs_fsync+0x20/0xe0 fsg_lun_fsync_sub+0xa0/0xd0 fsg_store_nofua+0x138/0x160 configfs_write_iter+0x1a7/0x250 vfs_write+0x5df/0x940 Allocated by task 3459: fsg_store_file+0x150/0x1f0 configfs_write_iter+0x1a7/0x250 Freed by task 3459: __fput+0x456/0x6c0 __fput_deferred+0x10d/0x330 fsg_store_file+0x9e/0x1f0 configfs_write_iter+0x1a7/0x250 Hold filesem for read around the fsync in fsg_store_nofua() so the backing file cannot be closed underneath it. The lock is only needed when the fsync actually runs, so it is taken only in that branch. Reproduced on a mass_storage gadget over dummy_hcd by writing lun.N/nofua (1 then 0) from one task while another task rewrites and clears lun.N/file. Cc: stable Signed-off-by: Yu Zhang Acked-by: Alan Stern Link: https://patch.msgid.link/20261020023050.87701-1-yuz08559@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 406e625de6d440f36200188e2bc8412130fcf96d Author: Niklas Neronin Date: Thu Nov 5 19:51:05 2026 +0200 usb: xhci: clear stale bandwidth data after hibernation commit d1ec1859f3b8641e3e5c5953cc7dd8e63b54339f upstream. Controllers using software managed bandwidth accounting maintain periodic endpoint bandwidth information in struct 'xhci_interval_bw_table'. Each root hub port owns a bandwidth table and a list of TT bandwidth domains, where each TT has its own bandwidth table. Virtual devices reference the bandwidth table of their current bandwidth domain through 'bw_table' or 'tt_info'. Historically, resume from S4 reinitialized the entire xHCI driver state, which implicitly cleared all bandwidth accounting data. After the hibernation resume path was optimized to preserve parts of the driver state, virtual devices and TT bandwidth information were freed and recreated, but the root hub bandwidth tables were left intact. As a result, stale bandwidth accounting data could remain in the root hub bandwidth tables across hibernation resume, leading to incorrect bandwidth calculations after devices were rediscovered. Fix this by resetting all bandwidth accounting data in xhci_rh_bw_cleanup() so that resume starts with a clean bandwidth state, and resetting the total active endpoints count. Fixes: 2a70e5dc0301 ("usb: xhci: optimize resuming from S4 (suspend-to-disk)") Reported-by: Harald Judt Link: https://bugzilla.kernel.org/show_bug.cgi?id=222071 Suggested-by: Lovekesh Solanki Tested-by: Harald Judt Cc: stable Signed-off-by: Niklas Neronin Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261105175106.241182-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit d60e92dbea2b4b963e3c4a889eb4352a2679ecd5 Author: Xu Rao Date: Thu Nov 5 19:51:03 2026 +0200 usb: xhci: disable the correct slot on alloc_dev failure commit 2f2fe3201029ffc215b46ac40a0a9587715bc43a upstream. xhci_alloc_dev() stores the Slot ID returned by the Enable Slot command in the local slot_id variable. udev->slot_id is updated only after xhci_alloc_virt_device() succeeds. If endpoint resource reservation or virtual device allocation fails before that update, the error path passes udev->slot_id to xhci_disable_and_free_slot(). During initial enumeration this is slot 0. When reallocating a device whose virtual device is missing or belongs to another usb_device, udev->slot_id may contain a stale Slot ID. The newly enabled slot can therefore remain active, or the wrong slot can be disabled. Pass slot_id, which identifies the slot enabled by this invocation. xhci_disable_and_free_slot() already handles a missing xhci->devs entry. Fixes: 3ffbba9511b4 ("USB: xhci: Allocate and address USB devices") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao Reviewed-by: Niklas Neronin Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261105175106.241182-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 1955ce135090cfc323a584026c1727ebbcf56e95 Author: Uttkarsh Aggarwal Date: Tue Sep 29 14:59:39 2026 +0530 usb: typec: ucsi: Set ucsi->connector before enabling notifications commit 5b4b83c2ffe8740f6f3e54ea4d4962a62c063ef1 upstream. In ucsi_init(), ucsi->connector is assigned only after the UCSI_SET_NOTIFICATION_ENABLE command completes. But once that command is sent, the PPM is free to raise a connector change notification at any time, which is handled through: ucsi_notify_common() -> ucsi_connector_change() ucsi_connector_change() indexes into ucsi->connector to get the connector and schedule its work item. If this notification arrives before ucsi_init() reaches the "ucsi->connector = connector;" line, ucsi->connector is still NULL and the driver crashes dereferencing it. Fix this by setting ucsi->connector right after the connectors are registered, before notifications are enabled, so it is always valid by the time a connector change event can be delivered. Also clear ucsi->connector in the err_unregister path so it isn't left pointing at freed memory if a later step in ucsi_init() fails. Fixes: 0482c34ec6f8 ("usb: ucsi: Fix ucsi->connector race") Cc: stable Signed-off-by: Uttkarsh Aggarwal Reviewed-by: Peter Chen Reviewed-by: Heikki Krogerus Link: https://patch.msgid.link/20260929092939.1806907-1-uttkarsh.aggarwal@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 990feab53fa8ffdc1f5ce9358a15566a8d65a116 Author: Ali Ahmet Memiş Date: Sat Oct 24 20:44:41 2026 +0300 usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0 commit 7cfb037005c04b9dee5b0c4626e56e2eddeef157 upstream. Since the debugfs response buffer grew to 24 bytes, every GET command fails with -EINVAL on UCSI < 2.0, where the data length is limited to 16 bytes. Clamp the length to UCSI_MAX_DATA_LENGTH(). Fixes: d9dc19910321 ("usb: typec: ucsi: Fix debugfs response truncation beyond 16 bytes") Cc: stable Signed-off-by: Ali Ahmet Memiş Reviewed-by: Heikki Krogerus Link: https://patch.msgid.link/20261024174441.878903-1-aliamemis@disroot.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 1cb74f8eeba1ee6bbbd69bbfdadb282f0787596c Author: Ihor Urazov Date: Mon Oct 26 01:47:52 2026 +0200 usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 commit 3ee1e1c3fca6fb5d0abbe0fc91539951ffa60aa7 upstream. The HP ZBook 8 G2i 14 (board 8ED9) exposes a working UCSI ACPI PPM, but its UCSI VERSION field reads zero until the first command completes. ucsi_register() rejects a zero version with -ENODEV, so no Type-C ports are registered. The firmware's _DSM READ function (2) is a stub. The mailbox VERSION field is written only by the EC response handler, after a command completes, after which it reads 0x0100 (UCSI 1.0). The mailbox is 48 bytes with 16-byte MESSAGE_IN/MESSAGE_OUT fields, the UCSI 1.x layout, and _DSM function 5 is not implemented. Add a DMI-specific read_version for this board that substitutes the version the firmware itself reports, UCSI 1.0, only when VERSION reads zero. A non-zero firmware version is used as is. The same firmware defect on the HP ZBook Fury G1i 16 was discussed in "[RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP systems with empty _DSM func 2" [1]. The defect was reported to HP as case 5166176673. Tested on an HP ZBook 8 G2i 14 with BIOS Y70 01.02.08, from a fresh boot where VERSION reads zero: three connectors register, the PD contract and alternate modes of a Thunderbolt dock are reported, and its DisplayPort output stays up across the PPM reset in ucsi_init(). Dock unplug/replug and s2idle suspend/resume update the connector state without errors. Link: https://lore.kernel.org/linux-usb/f3M_fpjtt8FxDqGKcA84vqXmRbKzCBfpCrIK4-jCWvIscER51zkD8qD8FYpz75qZw51rMDRSkUyYlrBvLvdM8CGRY2l8TFVvr4MC1LdTzbc=@interstellar.eu/ [1] Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface") Cc: stable Cc: Francesco Orro Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ihor Urazov Reviewed-by: Heikki Krogerus Reviewed-by: Huang Wei Link: https://patch.msgid.link/20261026-ucsi-hp-zbook-8-g2i-v1-1-91002e9ef073@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit e86108348f12dcd64d2cdaa8f59ea5f696d6f4a3 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Fri Oct 16 15:27:50 2026 +0800 usb: usbtest: prevent divide by zero in simple_io() with zero length commit fdaca138694111153f96c7d76877734b9dbf0e01 upstream. A divide error oops was observed in simple_io(): usbtest 1-1:1.0: TEST 3: write/1 0..0 bytes 16307 times Oops: divide error: 0000 [#1] SMP KASAN RIP: 0010:simple_io+0x2c4/0x540 drivers/usb/misc/usbtest.c:497 The variable-length tests (test 3 and test 4) compute the next URB size with "len %= max", where max is the original urb->transfer_buffer_length. However, when a zero-length transfer is requested (param->length == 0), simple_alloc_urb() still returns a valid URB with transfer_buffer_length set to 0. On the first vary update, "len %= max" divides by zero and the kernel oopses. Commit 564e69893c63 ("USB: usbtest: prevent a divide by zero bug") added the equivalent zero check to alloc_sglist(), which covers the scatterlist tests (test 7/8), but the single-URB variable-length path in simple_io() was left unprotected. Fix this by returning -EINVAL early from simple_io() when vary is requested but max is zero, so the divide by zero never occurs. Zero-length transfers without vary remain valid for the other callers of simple_io(). Cc: stable Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Reviewed-by: Alan Stern Link: https://patch.msgid.link/20261016072750.34256-1-25031212351@stu.xidian.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 76a21178b0ff0b465f6f0a121dc6aacd632d5b71 Author: Olivier Kaloudoff Date: Wed Oct 14 18:57:41 2026 +0200 usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) commit fafd23d61494461256d374f67c121f2712e1af2f upstream. The ASMedia chip detection in uas_use_uas_driver() assumes that every device with idVendor/idProduct 174c:5106 or 174c:55aa reporting a config.MaxPower of 0 is an ASM1153 with working UAS. ASMT135x bridges (iProduct "ASMT135x") share the same 174c:55aa id and also report MaxPower == 0, so they take the "ASM1153, do nothing" path — but their UAS implementation is broken: - The first READ(16) issued by sd probing times out after 30 s; enumeration only completes after a uas_eh_abort_handler plus a full uas_eh_host_reset_handler cycle: scsi 3:0:0:0: Direct-Access ASMT ASMT135x 0 PQ: 0 ANSI: 6 sd 3:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN sd 3:0:0:0: [sdb] tag#26 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 scsi host3: uas_eh_host_reset_handler start usb 6-2: reset SuperSpeed USB device number 2 using xhci_hcd scsi host3: uas_eh_host_reset_handler success - Under concurrent load the bridge stalls: all inflight commands (20+ UAS tags in the captured incident, mixed READ(16)/WRITE(16)) hit the 30 s UAS timeout in the same event, forcing repeated abort/reset cycles and eventually a USB disconnect. Writes dropped mid-flight during these resets returned zeros to the filesystem (observed as XFS metadata corruption on the mounted volume). - Sequential-write throughput is ~45 MiB/s under UAS versus ~136 MiB/s after disabling UAS (usb-storage BOT mode), which is fully stable: several tens of GiB written without a single error. - Bulk reads of healthy LBA ranges do work under UAS (~190 MiB/s, no errors); the failure pattern is command-timeout at enumeration and under queue depth / write load, not a broken transfer path. Since 174c:55aa is shared across several ASMedia bridges and enclosure rebrandings, distinguish the ASMT135x by its product string — the same approach used for the HIKSEMI MD202 check a few lines below. The product strings of working bridges using the same id ("ASM1053E", "ASM1153", "ASM1153E", "ASM1351", vendor rebrands such as "YZWY_TECH") do not contain "ASMT135", so the match is safe. Verified on an ORICO enclosure (iManufacturer "ASMT", iProduct "ASMT135x", bcdDevice 1.00) attached through an Alpine Ridge TB3 dock: with the equivalent usb-storage quirks parameter (174c:55aa:u) the device is completely stable. Signed-off-by: Olivier Kaloudoff Cc: stable Acked-by: Alan Stern Link: https://patch.msgid.link/20261014165741.35758-1-olivier.kaloudoff@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 738258fcd7677e1807e6e33ae454ea5a6254a8c2 Author: Chaz Bailey Date: Fri Oct 16 13:20:45 2026 +0100 usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove commit 2022b10726be78849626ea3fa33038ee96a54e46 upstream. nb7vpq904m_probe() allocates struct nb7vpq904m, but client data is not set during probe. In nb7vpq904m_remove(), i2c_get_clientdata(client) returns NULL, leading to a NULL pointer dereference when accessing nb7->retimer or nb7->sw. Set client data upon successful allocation in probe. Fixes: 88d8f3ac9c67 ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") Cc: stable Signed-off-by: Chaz Bailey Reviewed-by: Krishna Kurapati Reviewed-by: Heikki Krogerus Link: https://patch.msgid.link/20261016122045.187862-1-charles.s.bailey@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 0d3c5cf682dc88d46446c8f6bbe41ee89c071779 Author: Joonhoe Kim <26rote@gmail.com> Date: Fri Oct 23 01:51:43 2026 +0900 usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes commit 89aaaa26f6985d55676fc5c90440f279733fa132 upstream. DisplayPort pin assignments C and E give all four SuperSpeed lanes to DisplayPort, but the USB 2.0 D+/D- pair is not part of the pin assignment and stays available. The FSA4480 sits on that pair, and in these modes the driver turns its USB switch off, so a USB 2.0 hub or device behind a DisplayPort sink is disconnected as soon as the DisplayPort mode is set. Configure the USB switch the same way in all DisplayPort modes. Fixes: c7054c31c1c9 ("usb: typec: fsa4480: rework mux & switch setup to handle more states") Cc: stable Signed-off-by: Joonhoe Kim <26rote@gmail.com> Reviewed-by: Konrad Dybcio Acked-by: Heikki Krogerus Link: https://patch.msgid.link/20261022165143.1327-1-26rote@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 00dafa5677fad18633320221fc6ae87e3007e925 Author: Josef Bacik Date: Tue Oct 27 15:31:26 2026 +0100 USB: serial: oti6858: fix the teardown order in close commit f184ae84a5d19554d980a918a9c8baaef87ac301 upstream. The driver passes a baton around: the completion handler of the interrupt urb either resubmits the urb, submits the read urb or schedules one of the two delayed works, and the works and the bulk completion handlers submit the interrupt urb again. oti6858_close() cancels the works first and kills the urbs afterwards. An interrupt urb that completes in between schedules a work again: oti6858_close() cancel_delayed_work_sync(setup) cancel_delayed_work_sync(write) oti6858_read_int_callback() schedule_delayed_work(setup) usb_kill_urb(interrupt_in_urb) /* not in flight */ setup_line() usb_submit_urb(interrupt_in_urb) The port is now closed with the baton still going round. The next open fails because the interrupt urb is already submitted, and if the device is unplugged, oti6858_port_remove() frees the private data while a work may be pending or running. Poison the interrupt urb first: that waits for the handler and makes all further submissions fail, so nothing schedules the works any more. Then cancel the works, after which only the bulk urbs are left, kill those, and make the interrupt urb usable again for the next open. Don't print an error for the submissions that fail with -EPERM in this window, as oti6858_read_bulk_callback() already does. Fixes: 49cdee0ed0fc ("USB: oti6858 usb-serial driver (in Nokia CA-42 cable)") Cc: stable Cc: Johan Hovold Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 58a3212ce0a3ec89b214eb6a04610466e2522831 Author: Johan Hovold Date: Thu Oct 29 11:18:28 2026 +0100 USB: serial: garmin_gps: fix deadlock on reset request commit ab89a9dab02d9553eb0cc27fd3e4a4998acbc8e9 upstream. The garmin_gps driver has a reset feature that is supposed to reset the device when writing a private reset request packet. The reset is however done synchronously from the write() callback (and without holding the required device lock) which leads to a deadlock in the line discipline when hanging up the port as part of disconnect. Switch to using the asynchronous reset interface while dropping the redundant and synchronous stopping of the interrupt urb (write() callbacks are supposed to be atomic and USB core, USB serial core and the driver itself will unlink and kill all URBs during disconnect). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Josef Bacik Link: https://lore.kernel.org/2026102733-prayer-drainer-56f3@gregkh Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 2d181665cbb93f89c6f6db052683e59c580bac70 Author: Rishabh Jain Date: Thu Nov 5 19:51:04 2026 +0200 usb: pci-quirks: always assert xHCI OS ownership commit 5550405351199fe78f4a3cd606c07f5ad7220e1b upstream. The xHCI ownership protocol requires the OS driver to assert the HC OS Owned semaphore before using the host controller, then wait for HC BIOS Owned to clear if firmware owns it. quirk_usb_handoff_xhci() currently asserts OS Owned only when BIOS Owned is already set. If firmware leaves BIOS Owned clear, Linux uses the xHC while both ownership semaphores remain clear. The timeout fallback also clears BIOS Owned using the original register value, which can clear OS Owned at the same time. On an AMD PROM21 xHCI controller (1022:43fc), this caused every S3 resume to terminate Controller Restore State with USBSTS 0x401. Linux then reset the host controller, both root hubs and the USB Bluetooth adapter. The controller entered resume ready and halted with USBSTS 0x1. Endpoint state, 100 ms save/restore delays, scratchpads, the DCBAA, device contexts and command, event and transfer rings were verified not to cause the restore error. Across four S3 cycles, asserting only HC OS Owned changed USBLEGSUP from 0x00000801 to 0x01000801 and eliminated the restore failure. Testing included the unmodified 7.1.8-ogc1.1.fc44.x86_64 distribution kernel using a test module that set the HC OS Owned semaphore. The same test was repeated after review with the same result. Clearing USBLEGCTLSTS was independently verified to be unnecessary. Always assert OS Owned for controllers using the standard xHCI handoff, and leave the existing TI/Renesas forced handoff unchanged. Keep OS Owned asserted after the standard handoff, including when forcing BIOS Owned clear after a timeout, to prevent firmware from reclaiming the controller during subsequent suspends. Fixes: 66d4eadd8d06 ("USB: xhci: BIOS handoff and HW initialization.") Cc: stable@vger.kernel.org Reviewed-by: Mario Limonciello (AMD) Tested-by: McKenna Fan Tested-by: Quinn Schive Tested-by: Bruno Filipe Tested-by: Maciej Zonski Signed-off-by: Rishabh Jain Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261105175106.241182-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 5c3fedbe2c742a26ce7cce93fa119e940da31d86 Author: Johan Hovold Date: Mon Oct 19 14:37:55 2026 +0200 USB: cdc-acm: fix NULL-deref on hangup commit bc9dd21ec61acd152d9e7c12cb07db37c63ad41a upstream. Make sure to take a reference to the port tty when processing carrier detect changes to avoid dereferencing a NULL pointer when the port is being hung up. Fixes: 3b563b901eef ("usb: cdc-acm: add PPS support") Cc: stable Cc: Dan Drown Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20261019123755.2008384-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 78aab6aa9792bd6b49bcb951e383cd8505d6588c Author: Jiri Slaby (SUSE) Date: Tue Nov 3 12:16:39 2026 +0100 tty: fix misapplied compat_ptr() in tty_compat_ioctl() commit 895dc0eaa2779ff46a0b2a20b5ce9eb0b1125cb2 upstream. Since commit f0193d3ea73b below, `cmd` was converted with compat_ptr(), while `arg` was passed to ld->ops->ioctl() unmodified. Fix it so `cmd` stays `cmd` and `arg` gets converted through compat_ptr() as intended. Notes: 2) compat_ptr() did nothing to `cmd`, provided it is uint, 1) compat_ptr() is no-op everywhere (was different on s390 before 8e0b986c59c6 ("s390: Remove compat support")), 3) `arg` might not have been chopped correctly until 8e0b986c59c6. But I am not sure why noone noticed all those (7) years (from f0193d3ea73b to 8e0b986c59c6)? Fixes: f0193d3ea73b ("change semantics of ldisc ->compat_ioctl()") Signed-off-by: Jiri Slaby (SUSE) Cc: stable@vger.kernel.org # applicable from 4.20 to 6.18 incl Assisted-by: LLM Link: https://patch.msgid.link/63e9d84a1e8e23852423206cf3f8907aafc88f17.1793704520.git.jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit d48e1cef8158e3f221eac0d56761a6829221f1ce Author: Josef Bacik Date: Tue Oct 27 15:24:52 2026 +0100 thunderbolt: stream: Undo more if the start fails commit 03e3c33fe074ba57ae4457894fe5b6a90e3be6ee upstream. If the receive buffers cannot be allocated or mapped, tbstream_dev_start() stops and frees the rings, but - leaves the DMA paths through the XDomain connection enabled, with the hop IDs of rings which no longer exist; - does not release the frame array and the pages which tbstream_dev_alloc_rx_buffers() had allocated and mapped before it failed. Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM") Cc: stable Cc: Andreas Noever Cc: Mika Westerberg Cc: Yehezkel Bernat Cc: Alan Borzeszkowski Signed-off-by: Josef Bacik Acked-by: Mika Westerberg (Intel) Link: https://patch.msgid.link/2026102751-nibble-synapse-d406@gregkh Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 290582b73e3ac10ac413b25f5a6275207bfd1fe7 Author: Josef Bacik Date: Tue Oct 27 12:06:48 2026 +0100 serial: samsung: put the previous baud clock commit eedf2cf3505c1562a2fb24f8b997056f023d242b upstream. s3c24xx_serial_getclk() returns the best baud clock with the reference which clk_get() has taken. s3c24xx_serial_set_termios() stores it in ourport->baudclk and disables the clock which was there before, but does not put it. clk_get() hands out a new handle on every call, so the new clock never equals the old one, and every call of ->set_termios() leaks a handle: a struct clk and a copy of the connection name. Whoever has the port open can repeat that at will with tcsetattr(). Put the old clock when it is replaced, and the new one in case it is not stored. Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup") Cc: stable Cc: Krzysztof Kozlowski Cc: Peter Griffin Cc: Alim Akhtar Cc: Jiri Slaby Cc: Kukjin Kim Cc: Thomas Abraham Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-22-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 58499e9827d70b266e268b994d784507badd076b Author: Josef Bacik Date: Tue Oct 27 12:06:47 2026 +0100 serial: samsung: don't leak the tty on an RX IRQ commit 7ada442f5ef77f8d53f608a0141a5e88a888ca9f upstream. s3c24xx_serial_rx_chars_dma() starts by taking a reference to the tty. If the interrupt is not a receive timeout, it switches the port from PIO back to DMA and leaves through the "finish" label, which does not drop the reference. A port with RX DMA changes to PIO on every receive timeout, that is at the end of every burst of data, and comes back this way when the next burst starts. So each burst takes a reference which is never dropped, and the tty structure is not freed when the port is closed for the last time. Drop the reference on both paths. Fixes: b543c301c2c5 ("serial: samsung: add DMA support for RX") Cc: stable Cc: Krzysztof Kozlowski Cc: Peter Griffin Cc: Alim Akhtar Cc: Jiri Slaby Cc: Robert Baldyga Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-21-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 60d568799315e54bd852bf9274ed767f564c9bd9 Author: Josef Bacik Date: Tue Oct 27 12:06:46 2026 +0100 serial: rda: free the interrupt on shutdown commit 859f7c56709b161a72b629b6f2f1384dcd374404 upstream. rda_uart_startup() requests the interrupt, and nothing ever frees it. It is not shared, so once the port has been closed, the next startup fails with -EBUSY and the port cannot be opened any more. Free it in rda_uart_shutdown(). Fixes: c10b13325ced ("tty: serial: Add RDA8810PL UART driver") Cc: stable Cc: Jiri Slaby Cc: Arnd Bergmann Cc: "Andreas Färber" Cc: Olof Johansson Signed-off-by: Josef Bacik Reviewed-by: Manivannan Sadhasivam Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-20-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit f0617addedb05c2e917508e26bbebc48c1fdfb9b Author: Josef Bacik Date: Tue Oct 27 12:06:45 2026 +0100 serial: imx: fix the tty reference of the wakeup event commit 6d7fbd5a28d092ab61ec0092cf1e085d2bb9ed7e upstream. To report a wakeup event, imx_uart_enable_wakeup() gets the tty with tty_port_tty_get() and never puts it: each wakeup by the UART leaks a reference, and the tty is not freed when it is closed. Fixes: 0cfadf4bcd28 ("tty: serial: imx: Add missing wakeup event reporting") Cc: stable Cc: Jiri Slaby Cc: Frank Li Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: Robin Gong Cc: Petr Mladek Cc: John Ogness Cc: Pan Chuang Cc: Karl Mehltretter Cc: Sherry Sun Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-19-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 4f494aa9c549d7229c431781b0618c113fb612c8 Author: Josef Bacik Date: Tue Oct 27 12:06:44 2026 +0100 serial: fsl_lpuart: fix tty ref of wakeup event commit 0f0664a63efdfd70d1c555080781f4e8464445aa upstream. To report a wakeup event, lpuart_resume_noirq() gets the tty with tty_port_tty_get() and never puts it: each wakeup by the UART leaks a reference, and the tty is not freed when it is closed. With no_console_suspend, the function also gets there for a console which is not open. Then tty_port_tty_get() returns NULL, which is dereferenced. Fixes: 18bdfccf3c30 ("tty: serial: fsl_lpuart: Add missing wakeup event reporting") Cc: stable Cc: Jiri Slaby Cc: Frank Li Cc: Peng Fan Cc: Shitalkumar Gandhi Cc: Sherry Sun Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-18-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 0c6a8aab5d69b330bcbdcaf670a93afcc185b0da Author: Josef Bacik Date: Tue Oct 27 12:06:28 2026 +0100 serial: core: respect runtime PM when sending x_char commit 84da8238f7bd3025fc16da32c4cd9992c95a783b upstream. __uart_start() calls the start_tx operation only if the port is runtime active. Otherwise it asks for a resume, and serial_port_runtime_resume() starts the transmitter. uart_send_xchar() calls start_tx at once, under the port lock, whatever the state of the device. With 8250_omap, serial8250_start_tx() then calls pm_runtime_get_sync() for a suspended device: that sleeps, and omap8250_runtime_resume() takes the port lock again. A tcflow(TCIOFF) on an idle port is enough, if autosuspend has been enabled. It was allowed as long as that driver used pm_runtime_irq_safe(). Share the part of __uart_start() that deals with runtime PM. A stopped transmission still does not hold up an XON or XOFF character. Let a pending x_char count as work for serial_port_runtime_resume(), and keep the port from being suspended with it. Fixes: 8700a7ea5519 ("serial: 8250_omap: Drop pm_runtime_irq_safe()") Cc: stable Cc: Jiri Slaby Cc: Hugo Villeneuve Cc: Johan Hovold Cc: Karl Mehltretter Cc: John Ogness Cc: "Uwe Kleine-König (The Capable Hub)" Cc: Tony Lindgren Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-2-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 42c99ce53f3c28b45f42ce9299327a5ccc940c82 Author: Josef Bacik Date: Tue Oct 27 12:06:43 2026 +0100 serial: 8250_mxpcie: handle hangup during break commit 899e3c6e30ff34cf7a260b806fdedb56749e36e9 upstream. Ending a software break on a Moxa PCIe port in RS-485 2-wire mode dereferences a NULL tty pointer if the port was hung up while the break was being sent. send_break() calls ->break_ctl(tty, -1), sleeps for the break duration and then calls ->break_ctl(tty, 0), without excluding a concurrent hangup. A hangup (a modem DCD drop, or the session leader exiting while another process of the session is in TCSBRK/TCSBRKP) runs uart_hangup(), which shuts the port down and clears port->state->port.tty. The second call still reaches mxpcie8250_software_break_ctl() through uart_break_ctl(), which then does: struct tty_struct *tty = port->state->port.tty; ... baud = tty_get_baud_rate(tty); with tty == NULL. The bug was found by code inspection and has not been reproduced. Fix by taking a reference to the port's tty with tty_port_tty_get() and only restoring the divisor when a tty is still attached; a hung up port is shut down, and the next open programs the divisor again through set_termios(). Fixes: ade78d3d253c ("serial: 8250_mxpcie: add break support for RS485 using MUEx50 features") Cc: stable Cc: Jiri Slaby Cc: Crescent Hsieh Cc: Andy Shevchenko Cc: Linmao Li Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-17-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 7d7102b81406cf84a180699a07287eb093dce703 Author: Josef Bacik Date: Tue Oct 27 12:06:42 2026 +0100 serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud commit 08daebfd63e9054e097eb2653eff9381de43a422 upstream. byt_set_termios() derives the clock of the UART from the baud rate in the termios, which nobody has looked at yet: fuart = baud * 16; ... fuart *= rounddown_pow_of_two(fref / fuart); ... p->uartclk = fuart; fref is 100 MHz. For a baud rate above 6250000, which BOTHER allows, fref / fuart is 0, and rounddown_pow_of_two(0) shifts 1UL by -1. On x86 that is 1UL << 63, the product with a multiple of 16 is 0, and so is uartclk. serial8250_get_baud_rate() then passes 0 for both limits, uart_get_baud_rate() finds no rate which fits, WARNs and returns 0, and uart_get_divisor() or dw8250_get_divisor() divide by 16 * 0. Everybody who may open the tty can oops the kernel with one TCSETS2. Don't ask for more than fref. The limits are those of a 100 MHz clock then, and uart_get_baud_rate() falls back to the old rate as for any other rate that the port cannot do. 8250_mid, which has the same formula, treats this case separately. Fixes: 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula") Cc: stable Cc: "Ilpo Järvinen" Cc: Andy Shevchenko Cc: Jiri Slaby Cc: Heikki Krogerus Cc: Peter Hurley Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-16-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 07de184d9bf160efeb183e219172c39b99678c16 Author: Jiri Slaby (SUSE) Date: Tue Nov 3 12:16:37 2026 +0100 serial: 8250_exar: check priv->gpio properly commit 0353b51965883cf70dad162908e07395f242000f upstream. priv->gpio is set by platform_device_register_full(), which returns error-encoded pointers on failure, not NULL. Sashiko reported: > Does __xr17v35x_register_gpio() return an ERR_PTR if > platform_device_register_full() fails? > > If it does, we might be storing an error pointer directly into > priv->gpio in xr17v35x_register_gpio() without validating it with > IS_ERR(). Because the error is ignored, the device probe > successfully continues. Before commit 1145d1a0703f ("serial: 8250_exar: use platform_device_register_full()"), __xr17v35x_register_gpio() returned NULL on any failure (platform_device_alloc(), device_add_software_node() or platform_device_add() failing were all turned into a NULL return). The plain truthy check in xr17v35x_unregister_gpio() matched that convention. That commit switched registration to platform_device_register_full(), which reports failure as an ERR_PTR() instead of NULL, but the unregister check was never updated to match. As a result, a failed registration left an error pointer in priv->gpio, and unbind would tear it down as if it were a real platform_device, dereferencing the encoded error value in device_remove_software_node() and platform_device_unregister(). Use IS_ERR_OR_NULL() instead, so both the unset (non-EXAR vendor, priv->gpio never assigned) and failed-registration (ERR_PTR) cases are skipped. Fixes: 1145d1a0703f ("serial: 8250_exar: use platform_device_register_full()") Signed-off-by: Jiri Slaby (SUSE) Cc: stable@vger.kernel.org Assisted-by: LLM Link: https://lore.kernel.org/all/sashiko-outbox-170895@kernel.org/ Link: https://patch.msgid.link/28c09cf858795491f66667781bf79fb6a603f159.1793704520.git.jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 5ef59aa7e67cc1dfc8aa24ebea7128eb0b397ea3 Author: Josef Bacik Date: Tue Oct 27 17:58:16 2026 +0100 misc: vmw_vmci: wait for callbacks in event unsubscribe commit 824a27d391cf934d3232e8e2dabee221fc4e18ae upstream. event_deliver() calls the callbacks of the subscribers inside an RCU read side critical section. vmci_event_unsubscribe() used to call synchronize_rcu() before it freed the subscription. This did more than to protect the struct vmci_subscription: when the function returned, no callback was running any more, and its callers rely on that. vmci_transport_free_resources() unsubscribes from VMCI_EVENT_QP_PEER_DETACH and frees the struct vmci_transport, which is the callback data, a few lines later: CPU0 CPU1 event_deliver() rcu_read_lock() vmci_transport_peer_detach_cb() vmci_event_unsubscribe() list_del_rcu(&s->node) kvfree_rcu_mightsleep(s) kfree(transport) spin_lock_bh(&trans->lock) The event is sent when the peer of the queue pair detaches, so the other end of a vsock connection chooses the time. vmci_transport_exit() and vmci_guest_remove_device() unsubscribe callbacks which are gone with their module. kvfree_rcu_mightsleep() only waits for a grace period if it cannot allocate memory. Bring the synchronize_rcu() back. The cleanup work of the vmci transport now waits for one grace period per socket again. Fixes: 6da3f33770e0 ("misc: vmw_vmci: Switch to kvfree_rcu() API") Cc: stable Cc: Bryan Tan Cc: Vishnu Dasa Cc: Broadcom internal kernel review list Cc: Arnd Bergmann Signed-off-by: Josef Bacik Link: https://patch.msgid.link/2026102715-escapable-quaintly-8530@gregkh Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit f8f07ec800b514bfa5d0fa0823994d96173aa206 Author: Jiale Yao Date: Wed Oct 28 12:48:24 2026 +0800 misc: ibmvmc: initialize HMC state before device registration commit 2022f170e5655c40b93ed98629f7d0adb98cea49 upstream. misc_register() exposes the IBM VMC device before the HMC state and spinlocks are initialized. A userspace operation racing module initialization can therefore access an HMC through an uninitialized spinlock. Initialize all HMC state before registering the misc device. Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)") Cc: stable Signed-off-by: Jiale Yao Link: https://patch.msgid.link/20261028044828.96177-5-yaojiale02@163.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 279a7a7071214221858144fc097f3751ef9dbbe8 Author: Guangshuo Li Date: Tue Oct 27 23:09:21 2026 +0800 misc: bcm-vk: fix DMA allocation memory leak commit a36b3db60466d44eefcc5c252ce927c043429922 upstream. bcm_vk_dma_alloc() leaks dma->pages and pinned user-page references when page pinning or coherent SG allocation fails. DMA mapping failures can also leave the SG list and earlier mappings unreleased, as bcm_vk_sg_alloc() skips the partially initialized slot. This issue was found by our static analysis tool under development. Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Link: https://patch.msgid.link/20261027150921.137189-1-lgs201920130244@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit fa91d8b5fcbc8b3433b777d249fa0c9161dc007f Author: Antonio Vázquez Blanco Date: Thu Oct 29 09:48:59 2026 +0100 mei: me: add ice lake point LP iTouch DID commit 73383d06da9a1ded4c85845407cb4029aeecca39 upstream. Add the device ID for the Intel Precise Touch & Stylus (iTouch) function on Ice Lake Point LP. It appears as PCI device 8086:34e4, next to the regular MEI function at 8086:34e0, on Microsoft Surface Pro 7 and Surface Laptop 3. Without this entry mei_me does not bind, the touch controller is unreachable, and neither the touchscreen nor the pen work. Users currently work around this by binding the device by hand at boot: echo "8086 34e4 ffffffff ffffffff 0 0 9" > \ /sys/bus/pci/drivers/mei_me/new_id where the trailing 9 is the mei_me_cfgs[] index of MEI_ME_PCH12_CFG. That is fragile by construction, since the index is positional and any reordering of the config array silently changes which config the device gets. This ID was first reported in June 2020, together with Sunrise Point's 0x9d3e, in "mei: me: Add itouch device IDs for SPT / ICP" [1]. That submission was declined over the server platform ID conflict, and the Sunrise Point half was subsequently added in commit 372a829862e5 ("mei: me: add MEI device for SPT with ITPS capability"). Ice Lake Point was never added. Use MEI_ME_PCH12_SPS_ITOUCH_CFG, so that the device is reported with the correct kind and the SPS firmware exclusion applies. Note this is not the config the manual new_id workaround above selects: it reports kind "itouch" rather than "mei", and it does not set up a DMA ring. Link: https://lore.kernel.org/all/20200601155954.764558-1-dorian.stoll@tmsp.io/ [1] Cc: stable Signed-off-by: Antonio Vázquez Blanco Acked-by: Alexander Usyskin Link: https://patch.msgid.link/20261029084859.4537-1-antoniovazquezblanco@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit c65d42535c55da7eda785e8fc703a28dc9412958 Author: Josef Bacik Date: Tue Oct 27 17:27:40 2026 +0100 mei: lb: read the MTU once commit 1115120f89f5c22bf49f7423cf158a04a474dd93 upstream. mei_cldev_mtu() returns 0 if the client is not connected. A link reset disconnects all clients at any time, from the reset work. mei_lb_push_payload_v2() asks for the MTU to allocate the request buffer and asks again for every chunk. If the reset comes in between, chunk_size = min(payload_size - sent_data, 0 - sizeof(*req)); makes the chunk the whole rest of the payload, and the memcpy() behind it writes over the end of the buffer. If the reset comes before the first call, kzalloc(0) returns ZERO_SIZE_PTR, which passes the NULL check and is dereferenced. An MTU not bigger than the request header has the same effect as 0. Read the MTU once and refuse one which leaves no room for payload. If the client has gone, sending the chunk fails. Fixes: 773a43b8627f ("mei: lb: add late binding version 2") Cc: stable Cc: Alexander Usyskin Cc: Arnd Bergmann Signed-off-by: Josef Bacik Acked-by: Alexander Usyskin Link: https://patch.msgid.link/2026102739-boil-startup-145b@gregkh Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 522324d3dababe79bd254867588e81b176bb8ac7 Author: Josef Bacik Date: Tue Oct 27 17:19:19 2026 +0100 iio: sx9310: use the data of the I2C table commit f3fc8718af9189aad13a2ad7f5b256475bb14b21 upstream. sx9310_check_whoami() takes the chip information from device_get_match_data(), which only looks at the OF and ACPI tables, and dereferences it. For a client which was bound through the i2c_device_id table, for instance one created with echo sx9310 0x28 > /sys/bus/i2c/devices/i2c-1/new_device it returns NULL, and the kernel oopses as soon as something at that address answers the read of the WHOAMI register. The I2C table has the same pointers. Use i2c_get_match_data(), which falls back to it. Fixes: 21fd3b1373f6 ("iio: proximity: sx9310: Convert enum->pointer for match data table") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit c2d74cae0186709767df39ce8ca1143c94ff109d Author: Josef Bacik Date: Tue Oct 27 17:19:15 2026 +0100 iio: hid-sensors: fix a division by zero commit fd4c92bbd3a64556e81042ff8d30545b15a3b93a upstream. convert_to_vtf_format() divides the micro part of a value by 10^(6 + exp). The unit exponent of a HID field is a nibble and goes down to -8. For -7 and -8 the argument of int_pow() is negative, which the unsigned parameter turns into a huge power of ten: 0 modulo 2^64. The division by it is a divide error. The exponent comes from the report descriptor of the sensor hub, the value from a write to the hysteresis attribute of the IIO device. Multiply by 10^(-exp - 6) in these two cases. Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Acked-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit eb27b6ac832d83cb3fb4ab2bbcd4fc2f5105e4f2 Author: Josef Bacik Date: Tue Oct 27 17:19:11 2026 +0100 iio: addac: ad74413r: fix the values of set_multiple commit e6dfbd84b833ed595a5236b027357e917de28260 upstream. ad74413r_gpio_set_multiple() walks over the lines in the mask and looks up the new value of each with if (*bits & offset) offset is the number of the line, not a bit mask. Line 0 is always driven low, line 1 gets the value meant for line 0, line 2 the one meant for line 1, and line 3 is driven high if either of these two is. Test the bit which belongs to the line. Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit caa9f7c8444bb7e1a23154a1edd6039146c91776 Author: Josef Bacik Date: Tue Oct 27 17:19:09 2026 +0100 iio: adc: check the result of ad_sd_init() commit 905b5d93b795b0e2311a8c855c1cdd97c9cc2989 upstream. ad_sd_init() asks for the optional "rdy" GPIO and returns the error if that fails, for instance -EPROBE_DEFER. The binding of the AD7780 describes such a GPIO. ad7780, ad7791, ad7793 and max11205 ignore the result. The function has then returned before it set the driver data of the IIO device, which devm_ad_sd_setup_buffer_and_trigger() dereferences a few lines further down in these probe functions, and sigma_delta->rdy_gpiod holds an ERR_PTR() which ad_sigma_delta_clear_pending_event() takes for a GPIO. Return the error, as the other users of the library do. Fixes: a87ef09b1fdf ("iio: adc: ad_sigma_delta: Add support for reading irq status using a GPIO") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 5c8d9efb57b8f11fbbf6ec69d6bab73e1ad40572 Author: Josef Bacik Date: Tue Oct 27 17:19:10 2026 +0100 iio: adc: ad7923: add the AD7927 to the SPI ID table commit 594157b4f3f64db5833dee679194c33a5968f92e upstream. The binding describes the AD7927 as compatible = "adi,ad7927", "adi,ad7928"; The OF match takes the second string. The modalias of the SPI device is made from the first one, "ad7927", which is not in the spi_device_id table: spi_get_device_id() returns NULL and ad7923_probe() dereferences it for the chip information. The module is not loaded automatically either, as the uevent of an SPI device says "spi:ad7927". Add the name, with the data of the AD7928. Fixes: 1140f96cd4af ("dt-bindings: iio: adc: ad7923: adjust documentation") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 5faff398c66f9e7ec9df4bc56ea1f9fa44322f9d Author: Josef Bacik Date: Tue Oct 27 17:19:08 2026 +0100 iio: accel: adxl380: don't stay in standby on -EINVAL commit 4c56180167ea4d419a0578545bf62110494b563d upstream. adxl380_set_act_inact_threshold() puts the sensor into standby, writes the threshold and switches the measurement on again. A threshold above 8191 is refused in between, and the sensor stays in standby: no samples and no events until the next write that succeeds. adxl380_set_range() has the same problem and a worse one. It rescales both thresholds for the new range. If one no longer fits it returns -EINVAL with the sensor in standby, the new range in the chip, the old one in st->range and rescaled thresholds in the driver's state: from the next successful write on the samples are reported with the wrong scale. Switch the measurement on again if the threshold is refused. In adxl380_set_range() see whether the thresholds fit before anything is changed. Fixes: df36de13677a ("iio: accel: add ADXL380 driver") Cc: stable Signed-off-by: Josef Bacik Signed-off-by: Greg Kroah-Hartman Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 751f8fe98d2b3b7ba4666ea5650270574f74359d Author: Josef Bacik Date: Tue Oct 27 17:43:32 2026 +0100 comedi: vmk80xx: report failed transfers of the K8061 commit 92fa93505576188acc22c5de1999db9a1c70c09b upstream. For the K8061 board vmk80xx_read_packet() and vmk80xx_write_packet() call vmk80xx_do_bulk_msg(), which ignores the result of its two bulk transfers, and return 0. After a timeout, a stall or an unplug the instruction handlers therefore go on and hand the old content of usb_rx_buf to user space as a fresh sample (analog and digital inputs, counters, PWM and output read-back), and writes to the outputs are reported as done. All callers check the result already, because the K8055 branch of the two functions returns that of usb_interrupt_msg(). Return the error of the bulk transfers as well, and don't wait for an answer to a command that could not be sent. Fixes: 985cafccbf9b ("Staging: Comedi: vmk80xx: Add k8061 support") Cc: stable Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-5-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 7347aabcbabfb066de776f5166305cfcacfc0c93 Author: Josef Bacik Date: Tue Oct 27 17:43:31 2026 +0100 comedi: ni_tio: Fix overflow of the clock period commit ec214735bb113be747454812035b83010892e0d2 upstream. ni_tio_set_clock_src() stores the period of the clock source, which the user passes in nanoseconds, in picoseconds: counter->clock_period_ps = period_ns * 1000; period_ns is an unsigned int, so that the product is computed in 32 bits, although clock_period_ps is a u64. It wraps for periods above 4294967 ns, that is for external clocks slower than 233 Hz. INSN_CONFIG_GET_CLOCK_SRC then reports a wrong period, and ni_tio_set_sync_mode() decides on a wrong one: 4294968 ns become 704 ps, which is below the limit of 25 ns under which the alternate synchronization mode for fast clocks is switched on. The multiplication was done in 64 bits until the constant pico_per_nano, a uint64_t, was replaced by a literal. Widen again. Fixes: 3e90b1c7ebe9 ("staging: comedi: ni_tio: tidy up ni_tio_set_clock_src() and helpers") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Ian Abbott Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-4-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit caeb4970abc8f67aed5b64e8e71ce2d582301a95 Author: Josef Bacik Date: Tue Oct 27 17:43:30 2026 +0100 comedi: ni_660x: don't poll without a DMA channel commit 5a0c88567a5ebbe24ecb7828e200f63ed972718f upstream. A counter command owns a MITE DMA channel from ni_660x_cmd() to ni_660x_cancel(). A command does not only end by COMEDI_CANCEL: when the reader is too slow mite_sync_input_dma() sets COMEDI_CB_OVERFLOW, and counter errors set COMEDI_CB_ERROR, and comedi_handle_events() then calls ->cancel() from the interrupt handler. That releases the channel and clears counter->mite_chan, but s->busy stays set until the owner has read the rest of the data and seen the end of the acquisition. do_poll_ioctl() only looks at s->busy, so a COMEDI_POLL in that state ends in mite_sync_dma(NULL, s), which dereferences the channel. Test the channel like ni_pcidio_poll() and ni_sync_ai_dma() do. The pointer only changes under dev->mutex, which the ioctl holds, or in the interrupt handler under interrupt_lock, which is taken here. Fixes: 894db1197347 ("Staging: Comedi: ni_600x: Added support for comedi_poll.") Cc: stable Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-3-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 311fb211ab60d64d2474457d1ee0fac719597776 Author: Josef Bacik Date: Tue Oct 27 17:43:28 2026 +0100 comedi: fix endless recursion in comedi_event() commit d432e5d3dbd98589029905e898bfe7005be69b68 upstream. When comedi_event() was split into a wrapper which takes a reference on the running command and _comedi_event(), which does the work, the wrapper ended up calling itself: if (comedi_get_is_subdevice_running(s)) { comedi_event(dev, s); comedi_put_is_subdevice_running(s); } As long as the command is running every level takes another reference and recurses, until the stack is used up. Most drivers go through comedi_handle_events(), which calls _comedi_event(). usbdux, usbduxfast and usbduxsigma cannot use that and call comedi_event() from their URB completion handlers, i.e. for every completed URB of a running acquisition. Fixes: 51495254fda4 ("comedi: Use reference count for asynchronous command functions") Cc: stable Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-1-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 8cf925f7b2e1b91eb9b08fd3c9e23166047c44cd Author: Josef Bacik Date: Tue Oct 27 17:43:29 2026 +0100 comedi: addi_apci_1500: fix clearing of the gate enable commit ade85ceef46892425a08f3ee52ca06729ee4922e upstream. INSN_CONFIG_SET_GATE_SRC reads the mode register of the counter/timer, is meant to clear the External Gate Enable bit, sets it again if the external gate was asked for, and writes the register back. The mask lacks its '~': all the bits but EGE are cleared instead. So - the external gate can be enabled but never be disabled again, and - the instruction wipes the mode (continuous or single cycle, external output, count and trigger enables, retrigger, duty cycle) which INSN_CONFIG_SET_COUNTER_MODE has programmed: the timer silently falls back to a single cycle pulse. With the right mask, the instruction only changes the gate bit. An application which sets the gate source after the counter mode now keeps the mode it has asked for. Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") Cc: stable Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-2-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 75003fbe02202236df8b960bd2d915bbb6c4ef21 Author: Chris Mason Date: Tue Oct 27 12:06:27 2026 +0100 vt: serialise the producers of the flip buffer commit 5d1d814408c1c8e797031eac8ddd40de1a9e8e93 upstream. Typing on a virtual console while the console replies to an escape sequence can make the kernel write past the end of a buffer. A user who can write to the foreground console can cause this on purpose if they can also inject key events, through /dev/uinput or by writing to the /dev/input/event* node of a keyboard. Input for a tty goes through the flip buffer of its port. A driver inserts the data with tty_insert_flip_*() and then calls tty_flip_buffer_push() to pass it on to the line discipline. The insert functions take no lock: they check that the current struct tty_buffer has room, copy the data to offset ->used, and then advance ->used. So a flip buffer supports only one producer at a time, and a driver that has several must serialise them. Four functions feed the flip buffer of a virtual console: - put_queue(), puts_queue() and fn_send_intr() insert typed characters and breaks for the keyboard handler. They run under kbd_event_lock. - respond_string() inserts the reply when a program writes an escape sequence that requests one, such as a cursor position report. It runs under the console lock. The keyboard handler gets its events from the input layer and feeds the foreground console. Key events that a program writes to /dev/uinput or to an event node reach it in the same way as typed keys. The keyboard handler and respond_string() share no lock, so they can interleave: keyboard handler respond_string() ================ ================ room check passes room check passes memcpy() to offset used used += len memcpy() to offset used used += len /* used > size of the buffer */ The room check subtracts ->used from the size, and both are unsigned. Once ->used exceeds the size, the result wraps, so the check always passes, and each later insert lands further past the buffer. Reproduced as root, with keys from a uinput keyboard and cursor position reports on the same console: KFENCE reported an out-of-bounds write 1,024 bytes past the buffer in under 10 s. Fix this by taking port->lock, with interrupts disabled, around the insert and the push in these four functions. kbd_keycode() already takes port->lock under kbd_event_lock, so this lock ordering is not new. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Cc: Jiri Slaby Cc: Nicolas Pitre Cc: Kees Cook Cc: Joshua Rogers Cc: Chris Mason Cc: Helge Deller Cc: Thomas Zimmermann Cc: Mingyu Wang <25181214217@stu.xidian.edu.cn> Cc: Randy Dunlap Cc: Ronan Pigott Cc: Liav Mordouch Signed-off-by: Chris Mason Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/20261027-tty-llm-v1-1-99b0202ae546@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 7043e8bd6be99ad91a5201ca3115bd7f880ef245 Author: Mikulas Patocka Date: Fri Nov 6 19:44:19 2026 +0100 dm-thin: fix parsing of feature arguments commit c557fa19a83efad1e20eb733df821b745a4589ff upstream. "struct dm_arg _args" limits the number of arguments to 4, but there are 5 possible arguments that can be specified. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 787a996cb251 ("dm thin: add error_if_no_space feature") Signed-off-by: Greg Kroah-Hartman commit 8ce69cdee171bd66817f8204636018601336b6a3 Author: Mikulas Patocka Date: Fri Nov 6 19:43:14 2026 +0100 dm-thin: fix leak if __set_snapshot_details fails commit dfb95816cf6f2f2660af2ec64c65dc204c60b5e7 upstream. If __set_snapshot_details fails, the variable td is leaked - this prevents any other snapshot with the same id from being created. Fix this by removing it from the list and freeing it. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 991d9fa02da0 ("dm: add thin provisioning target") Signed-off-by: Greg Kroah-Hartman commit 18bb782c7c10536360042eeba37da9e9268e82df Author: Mikulas Patocka Date: Fri Nov 6 19:41:56 2026 +0100 dm-thin: fix data corruption if discard races with regular I/O commit 62ee9c09366cad69410330087d990e469dd92314 upstream. In the function break_up_discard_bio, if a discard hits the same block as regular I/O, it was intended to skip the discard for the affected range. However, the skip code only advances "data_begin", it doesn't advance "virt_begin". So, the data_begin and virt_begin variables become unsynchronized. process_prepared_discard_passdown_pt1 calculates "data_end = m->data_block + (m->virt_end - m->virt_begin);" - if m->data_block is incremented and m->virt_begin isn't, it will overshoot the intended discard range. Cc: stable@vger.kernel.org Fixes: e2dd8aca2d76 ("dm bio prison v1: improve concurrent IO performance") Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Signed-off-by: Greg Kroah-Hartman commit e8860e5773569fa297e1906747e770b7afe8bea4 Author: Li Youhong Date: Thu Nov 12 17:12:05 2026 +0800 dm-raid: fix use-after-free in raid_dtr() commit 46af2c975958119290ddcd984a98491966123a7b upstream. raid_dtr() currently flushes event_work only if work_pending() is true. This is insufficient because once a worker has dequeued the work, the PENDING bit is cleared while do_table_event() is still running. In that window raid_set_free() can free the raid_set, leading to a use-after-free when do_table_event() accesses rs->ti->table. Flush event_work whenever it has been initialized, so raid_set is not freed while the event handler is still running. The .func guard skips the flush for mddev instances where INIT_WORK has not run yet. Fixes: db29d79b34d9 ("dm-raid: delay flushing event_work() after reconfig_mutex is released") Cc: stable@vger.kernel.org Signed-off-by: Li Youhong Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 727686c4e145b41594f064f0ed712ee778d9f892 Author: Jay Vadayath Date: Thu Oct 22 11:19:34 2026 -0700 dm-raid: bound array_position before indexing failed_devices commit 11b5cd14c0eecae458cecbe53d21a3dbc10190f5 upstream. super_init_validation() reads role = le32_to_cpu(sb2->array_position) out of an on-disk dm_raid_superblock and then uses it as a bit index into the failed_devices bitmap via test_bit(role, (void *)failed_devices). failed_devices is a uint64_t[DISKS_ARRAY_ELEMS] (DISKS_ARRAY_ELEMS == 4, i.e. 256 bits) living on the stack. The only guard is role < 0, so any on-disk array_position >= 256 makes test_bit() read past the end of the stack array (array_position == 256 reads failed_devices[4], 8 bytes past the object). For a raid1 set the role != raid_disk reorder branch falls through to the same test_bit(). A crafted dm-raid superblock therefore causes a stack out-of-bounds read during table load. Reachable by anyone able to issue a dmsetup create with attacker-controlled metadata (CAP_SYS_ADMIN in the target namespace); the crash fires in the constructor / analyse_superblocks path, before any md_run or array sizing. BUG: KASAN: stack-out-of-bounds in super_validate+0x1cd0/0x3390 Read of size 8 at addr ffff888007b17828 by task poc/152 Call Trace: dump_stack_lvl+0x64/0x80 print_report+0xd0/0x630 kasan_report+0xe5/0x120 kasan_check_range+0x105/0x1b0 super_validate+0x1cd0/0x3390 (super_init_validation, inlined) raid_ctr+0x2c4b/0xa0f0 dm_table_add_target+0x66f/0xf80 table_load+0x2ee/0x780 ctl_ioctl+0x362/0x9f0 dm_ctl_ioctl+0x9/0x10 __x64_sys_ioctl+0x134/0x1c0 do_syscall_64+0xe2/0x4b0 entry_SYSCALL_64_after_hwframe+0x77/0x7f role is a device position that must refer to an actual member of the array, so reject anything outside [0, rs->raid_disks) instead of only the negative case. rs->raid_disks is always <= the 256-bit capacity of failed_devices, so this both closes the out-of-bounds access and matches the intended semantics. This bug was discovered by Artiphishell's vTriage pipeline, which generated a crafted raid1 superblock (magic "DmRd", compat_features=1, num_devices=2, array_position=256, level=1) and a dmsetup-create reproducer that reliably triggers the KASAN report on an unpatched kernel (the precursor DMINFO "raid device #256 now at position #0" is visible in the serial log just before the splat). The fix below was drafted with the Claude coding assistant; a userspace reproducer is available on request. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Jay Vadayath Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit ff738a559c64849a5eab7485601bbaf63ec251c4 Author: Mikulas Patocka Date: Wed Nov 11 18:51:26 2026 +0100 dm-integrity: don't attempt to commit journal on disabled device commit e5e03918fbec31f0c896f4f43c2bd2aadf35d43d upstream. If the device is disabled due to an error, we shouldn't attempt to flush the journal. We jump straight to the label release_flush_bios, that will call do_endio on all queued bios. do_endio will terminate the bios with the error. This fixes WARN_ON in the function pad_uncommitted reported by syzkaller. Reported-by: syzbot+94dac3c75477e184f0b0@syzkaller.appspotmail.com Closes: https://syzbot.org/bug?extid=94dac3c75477e184f0b0 Fixes: 7eada909bfd7 ("dm: add integrity target") Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 765077a40b93cb7f417a5fb7d393559ac9533590 Author: Sinan Polat Date: Mon Nov 2 20:21:51 2026 +0000 dm-integrity: don't recalculate with HMAC because of a dirty bitmap commit 875a7161fe1574205293c36f7bbd0815023e48a1 upstream. Commit 5c02406428d5 ("dm integrity: conditionally disable "recalculate" feature") refuses a superblock with SB_FLAG_RECALCULATING if a keyed hash is used without "legacy_recalculate". Otherwise someone who can write to the device, but does not know the key, could modify data and have the kernel compute valid tags for it. dm_integrity_resume() can still start the same recalculation in J or D mode: if SB_FLAG_DIRTY_BITMAP is set and the bitmap is not clear, or log2_blocks_per_bitmap_bit does not match, it sets SB_FLAG_RECALCULATING and recalc_sector = 0. The superblock is not authenticated unless fix_hmac and journal_mac are both used, so the flag can be set offline. Resume also runs on the first activation. Apply the constructor's policy there. If recalculation is not allowed, log an error and keep the existing tags, so modified blocks fail verification. This also avoids queueing recalc_work on a NULL recalc_wq when internal_hash is not used. Fixes: 5c02406428d5 ("dm integrity: conditionally disable "recalculate" feature") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Sinan Polat Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 5d8858b8e0daf9323caa88e7093fdf97bad5673c Author: Josef Schlehofer Date: Thu Nov 5 08:27:08 2026 +0100 dm-crypt: defer async write submission to write thread commit 6fed9e26810f0b466dbcebe35a73d1fd48793ff5 upstream. With no_write_workqueue, kcryptd_crypt_write_io_submit() submits the bio directly, even when called from kcryptd_async_done(). An async cipher may run this callback in softirq or with BH disabled, where submit_bio_noacct() must not be called because it can sleep. Submit inline only when async is false. Async completions are sent to the write thread, as is already done for submit_from_crypt_cpus. Use the async flag rather than in_interrupt(), since callback context depends on the cipher driver. Sync ciphers still submit inline. Tested with cryptd in QEMU (x86_64 and arm64) with CONFIG_DEBUG_ATOMIC_SLEEP, and on a P2020 running 6.18.55 without it. In QEMU: - 4k writes logging "sleeping function called from invalid context": 100/100 unpatched, 0/155 patched. - nr_requests=4 on a loop device: 0/6 unpatched runs completed, 4/4 patched runs completed. On the P2020, a warning in blk_mq_run_hw_queue() appeared in the 6th unpatched run and did not appear in 30 patched runs. Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues") Cc: stable@vger.kernel.org Signed-off-by: Josef Schlehofer Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 5e56ce2fc11793962012da290bf709d7da7d8371 Author: xietangxin Date: Sat Oct 31 15:15:08 2026 +0800 dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers commit bd93c4e59c5132282c01f142806e307c7380e7ea upstream. When integrity_key_size parameter is paired with a pure AEAD cipher that is not an authenc composite, crypt_ctr_auth_cipher() returns 0 early without allocating cc->authenc_key, but cc->key_mac_size remains non-zero because CRYPT_KEY_MAC_SIZE_SET was set during option parsing. As a result crypt_copy_authenckey() dereferences NULL crashes the kernel. Reject the contradictory configuration explicitly instead of silently returning 0, so userspace gets a clear -EINVAL. Fixes: 4441686b24a1 ("dm-crypt: Allow to specify the integrity key size as option") Cc: stable@vger.kernel.org Reported-by: syzbot+ff132cb52bce4f44ecc9@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ff132cb52bce4f44ecc9 Assisted-by: LLM Signed-off-by: xietangxin Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 93c36ca6ba0c2d376ca42084500982045327bec5 Author: Mikulas Patocka Date: Fri Nov 6 19:39:54 2026 +0100 dm-cache: fix ending a cursor that never began commit 421420758be348cb90715bfaa26e1211a12ff1d0 upstream. If dm_bitset_cursor_begin fails, dm_array_cursor_end(&cmd->hint_cursor) is called. However, cmd->hint_cursor was only initialized if the variable hints_valid is true. Thus, we must also destroy hint_cursor only if hints_valid is true. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 629d0a8a1a10 ("dm cache metadata: add "metadata2" feature") Signed-off-by: Greg Kroah-Hartman commit 2380047e8fa5f9cee8204e0099ab620d5d446b03 Author: Mikulas Patocka Date: Fri Nov 6 19:38:45 2026 +0100 dm-cache: fix NULL pointer dereference on open failure commit d12afc2f9ed6e14019fed9c02a74ad699915dc85 upstream. When __begin_transaction_flags in metadata_open fails, dm_cache_metadata_close is called. dm_cache_metadata_close attempts to execute list_del(&cmd->list);, but the "cmd" object is not on any list yet, thus it crashes with NULL pointer dereference. Fix this by initializing cmd->list after cmd is allocated. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 9b1cc9f251af ("dm cache: share cache-metadata object across inactive and active DM tables") Signed-off-by: Greg Kroah-Hartman commit fb49cab7623693db1652f1dc9ba7a8321b414f5e Author: Kyrylo Biryuk Date: Tue Nov 3 23:04:38 2026 +0100 dm zoned: do not reclaim a random zone into another random zone commit dab527d83462a618d99bfc96370ce45ae3428706 upstream. dmz_reclaim_rnd_data() falls back to a random destination zone when no free sequential zone is available and the target has cache zones. When the target is idle and the cache zone list is empty, dmz_get_rnd_zone_for_reclaim() selects random zones of the zoned device as well, so a random zone is then copied into another random zone. That frees nothing: the next pass picks the next random zone and copies it again, for as long as the target stays idle. Seen on a two-device target (256 GiB regular cache device plus a 27 TB host-managed drive) used as an md RAID5 member: after a full rebuild every chunk was mapped and no sequential zone was free, and the idle drive kept reading and writing while the free zone counters in "dmsetup status" did not change. Only switch to a random destination zone when the zone being reclaimed is a cache zone: moving it to the zoned device still frees cache space. This depends on "dm zoned: back off when reclaim cannot make progress": without it, dmz_reclaim_work() would retry the resulting -ENOSPC at once, and run dmz_check_dev(), for as long as the target stays idle. Tested on 7.4-rc1 together with the previous patch, on a two-device target (a 512 MiB RAM-backed regular cache device plus a 1 GiB scsi_debug host-managed drive) filled until no sequential zone was free, then idle for 60 seconds: the stock module made 877 random-to-random copies; with this series it made none, and each pass failed with -ENOSPC once per DMZ_IDLE_PERIOD without a device check. Fixes: c5c788595292 ("dm zoned: start reclaim with sequential zones") Cc: stable@vger.kernel.org Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Kyrylo Biryuk Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 98fbb24bd625127dfc9a4476bd0b3577d202c4f5 Author: Kyrylo Biryuk Date: Tue Nov 3 23:04:37 2026 +0100 dm zoned: back off when reclaim cannot make progress commit 9bb1d14877f4929be17f7fdbeb4cfdf5025d464b upstream. When a reclaim pass cannot make progress, dmz_reclaim_work() still ends with dmz_schedule_reclaim(). If the target is idle, dmz_should_reclaim() keeps returning true, the work is queued again with no delay and the worker spins on the same failing pass. This patch handles two such cases: - dmz_do_reclaim() fails with -ENOSPC because no free zone is available to copy the data into, for example on a target without cache zones that has no free sequential zone left. The next patch also makes this the expected result when an idle target with cache zones has random zones but no free sequential zone. - dmz_do_reclaim() finds no zone it can lock for reclaim and returns -EBUSY. Since commit 90a9b8693f1b ("dm zoned: reclaim random zones when idle"), dmz_should_reclaim() returns true on an idle target whenever the total number of random (and cache) zones is non-zero, whether or not any of them holds data. Each pass then also runs dmz_check_dev(), which checks every device for media events (a TEST UNIT READY on SCSI disks). The -EBUSY loop lasts as long as the target stays idle; it ends when a pass finishes while the target is busy and has enough free zones. On three 27 TB host-managed SATA drives used as md RAID5 members (7.2.10 with the module built out of tree, all random zones free, target idle for 300 seconds, kprobes attached, two other drives on the controller being zero-filled), each member's SCSI device counted about 108,000 requests per second with the stock module and the system used about 915 s of CPU time, against about 46 s with this series. libata completes TEST UNIT READY in software, so these counters do not measure commands sent to the drives; the cost is CPU time. When a pass fails with -ENOSPC or -EBUSY, retrying at once is unlikely to make progress: re-arm the idle poll instead, so that reclaim is retried after DMZ_IDLE_PERIOD unless a zone allocation or a "reclaim" message queues it earlier. On a busy target, zone allocations can restart reclaim immediately when free space is low enough to require reclaim. Re-arming also keeps the poll running after a complete idle drain. The poll can still stop after a pass that ends while reclaim is not needed; that is unchanged. Skip the device check for these two results: they normally mean that there is no zone to copy into or no zone to reclaim, not that a device failed, and the I/O paths check the devices themselves. Use queue_delayed_work() so that work an allocation has already queued is not postponed. A pass that fails with an I/O error, for example on an unreadable block of a device that stays online, is still retried at once while the target is idle; this patch does not change that. Tested on 7.4-rc1 with this patch and the next one, on three emulated host-managed drives (scsi_debug, 1 GiB, 32 MiB zones) each under dm-zoned as md RAID5 members, all random zones free and the target idle for 300 seconds. With the stock module each member's SCSI device counted about 70.2 million requests and the reclaim workers used 726 s of CPU. With this series: 75 requests per member, 30 passes per worker (one per DMZ_IDLE_PERIOD) and 0.08 s of CPU. Data written during the tests read back with matching checksums, and no kernel warnings were logged. Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target") Fixes: 90a9b8693f1b ("dm zoned: reclaim random zones when idle") Cc: stable@vger.kernel.org Signed-off-by: Kyrylo Biryuk Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 0c661d80fdbeea980d3e03b528ecb51e38f0d85e Author: Chen Cheng Date: Fri Oct 30 17:21:29 2026 +0800 dm snapshot: fix discard writing into the next COW chunk commit 73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f upstream. zero_exception() zeroes one chunk of the COW device and takes the start sector from bio->bi_iter.bi_sector. remap_exception() has already set that to the COW chunk start plus the offset inside the chunk. That offset is needed for reads and writes, but for a discard it is wrong: the zeroing window is shifted, so the head of the target chunk keeps its old data and the tail lands in the next COW chunk, which holds a different exception. io_overlaps_chunk() should have caught this, but it only compares the length. "maps to entire chunks" in snapshot.rst also means the discard has to start on a chunk boundary. A discard that is not a full chunk has a second problem: after remap_exception() it is sent to the COW device, where it hits a chunk that still backs a live exception. After a discard the contents are undefined, but the exception stays in the table and keeps pointing at that chunk, so a later read returns whatever the discard left instead of the snapshot's data. Reproducer: truncate -s 4M o.img c.img o=$(losetup -f --show o.img) c=$(losetup -f --show c.img) dmsetup create snap --table \ "0 8192 snapshot $o $c P 512 1 discard_zeroes_cow" # write two chunks, this creates two exceptions head -c 256K /dev/zero | tr '\000' '\252' > pat dd if=pat of=/dev/mapper/snap bs=256K seek=1 count=1 conv=notrunc dd if=pat of=/dev/mapper/snap bs=256K seek=2 count=1 conv=notrunc # shift the snapshot by 8 sectors, so a discard that is aligned on # top is unaligned inside the snapshot dmsetup create top --table "0 8184 linear /dev/mapper/snap 8" blkdiscard -o 262144 -l 262144 /dev/mapper/top sync echo 3 > /proc/sys/vm/drop_caches # chunk 1 dd if=/dev/mapper/snap bs=512 skip=512 count=8 | od -An -tx1 -N1 # chunk 2 dd if=/dev/mapper/snap bs=512 skip=1024 count=8 | od -An -tx1 -N1 Before: aa 00 <- chunk 2 was zeroed although it was not discarded After: aa aa <- nothing written, a discard is only a hint Fix it by requiring the discard to start on a chunk boundary in io_overlaps_chunk(), and by finishing a discard that is not a full chunk with bio_endio() instead of passing it down to the COW device. Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features") Cc: stable@vger.kernel.org Signed-off-by: Chen Cheng Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit a41d5f0b410a0f7752e6050cadd8ee68ba4f5a31 Author: Chen Cheng Date: Fri Oct 30 17:21:28 2026 +0800 dm snapshot: split discards on chunk boundaries commit 4fe2c2baad01da64d47f1a0c8fc093df994bcef5 upstream. dm-snapshot did not set ti->max_discard_granularity when it allows discards, so a discard could reach the target unaligned, or spanning several chunks. Set the flag, so dm splits discards on chunk boundaries. Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features") Cc: stable@vger.kernel.org Signed-off-by: Chen Cheng Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 7049ec6f8b4b8d1eabfceaf80fbf6be93075a910 Author: wuyuehong Date: Mon Oct 26 17:35:00 2026 +0800 dm snapshot: fix discard_granularity unit in snapshot_io_hints commit d7216d7be2bbfdf3312695b6e41a4fc7c5e22902 upstream. snapshot_io_hints() copies the snapshot store's chunk_size, which is in 512-byte sectors, into queue_limits.discard_granularity, which, like all other members of struct queue_limits, is in bytes. For snapshots with a chunk size smaller than 512 sectors, e.g. the 16 KiB (32-sector) chunks created by the syzkaller reproducer, the resulting granularity is smaller than a single sector. When dm_calculate_queue_limits() then stacks the target limits into the table limits: blk_stack_limits(limits, &ti_limits, 0) queue_limit_discard_alignment() truncates that granularity to zero sectors and sector_div() divides by zero: Oops: divide error: 0000 [#1] SMP KASAN NOPTI RIP: 0010:queue_limit_discard_alignment block/blk-settings.c:645 [inline] RIP: 0010:blk_stack_limits+0x1105/0x2d00 block/blk-settings.c:916 Call Trace: dm_calculate_queue_limits+0x70c/0x1510 drivers/md/dm-table.c:1823 dm_setup_md_queue+0x199/0x4f0 drivers/md/dm.c:2618 table_load+0x4fd/0x8a0 drivers/md/dm-ioctl.c:1661 The divide fault itself only became reachable when commit e924da7d6622 ("block: Drop granularity check in queue_limit_discard_alignment()") removed the check for a sub-sector granularity in v6.13. Kernels before that returned a zero discard alignment instead of faulting, but they still advertised a granularity 512 times too small. Use the same chunk_size << SECTOR_SHIFT conversion that io_overlaps_chunk() already applies to turn chunk_size into bytes. Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features") Reported-by: syzbot+1288484b13bf6af3620d@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1288484b13bf6af3620d Cc: stable@vger.kernel.org Signed-off-by: wuyuehong Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 48d25ded6a78130e095f87f2fe094a9325eb6e81 Author: Mikulas Patocka Date: Fri Nov 6 19:49:33 2026 +0100 dm persistent data: don't leak bufio buffer if find_leaf fails commit b27523a0781aae0b51ac13f29dc65373d14b8434 upstream. If find_leaf fails, the function dm_btree_cursor_begin would return an error, but it would keep the dm-bufio buffers held. This would result in a memory leak and a warning when releasing the dm-bufio cache. This commit fixes it, so that dm_btree_cursor_begin releases the buffers on error. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 7d111c81fa29 ("dm btree: introduce cursor api") Signed-off-by: Greg Kroah-Hartman commit c8f0e981521f65817f8f73dc54f179f4f0120f22 Author: Mikulas Patocka Date: Fri Nov 6 19:48:02 2026 +0100 dm persistent data: don't ignore writeback errors commit fa887f2ebee7aff97eb87b3365939616ade09774 upstream. An error returned by ie_cache_writeback could be silently overwritten by another successful ie_cache_writeback. This commit fixes disk_ll_commit, so that it doesn't ignore the error and returns it immediatelly. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: 6b06dd5a9722 ("dm space map disk: cache a small number of index entries") Signed-off-by: Greg Kroah-Hartman commit 7efcc4838643127aacc8e6f2fb113bfaf67fefae Author: Mikulas Patocka Date: Fri Nov 6 19:46:24 2026 +0100 dm persistent data: test return value of node_copy commit 624d146d97c5fbe7200ef4b2dd5350ecf57d6b79 upstream. There were 3 places where the return value of node_copy was not tested. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-5 Cc: stable@vger.kernel.org Fixes: c671ffa55d8b ("dm btree remove: change a bunch of BUG_ON() calls to proper errors") Signed-off-by: Greg Kroah-Hartman commit b5aa89c94db5f5d92d2dddbf5e60a40451c55adb Author: Weijiang Zhou Date: Wed Nov 11 20:24:42 2026 +0100 dm-verity: don't restart or panic on errors during system shutdown commit 47930d1236d2988cdc580c10d3af21b6b02d7ece upstream. Commit 252bd1256396 ("dm verity: skip verity work if I/O error when system is shutting down") stopped I/O errors during shutdown from triggering a restart, since devices may legitimately be gone by then. Errors that reach verity_handle_err(), e.g. through a failed hash block read followed by a failed FEC attempt, are not covered and still call kernel_restart() or panic(). During a reboot that is both wrong (nothing is corrupt) and harmful: it races with the reboot already in progress and replaces its reason with "dm-verity device corrupted", which bootloaders such as Android's treat as a verity failure and switch the device to EIO mode. Apply the same shutdown check in verity_handle_err(). Corruption is still logged, recorded in hash_failed and reported via uevent, and the I/O still fails. Signed-off-by: Hongyu Jin Signed-off-by: weijiang.zhou Signed-off-by: Mikulas Patocka Fixes: 252bd1256396 ("dm verity: skip verity work if I/O error when system is shutting down") Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit b1c8bb1867a9bfaf7c4dd3ad890a9ed621a96005 Author: Mikulas Patocka Date: Thu Nov 5 16:11:37 2026 +0100 dm-sysfs: fix misbehavior if kobject_init_and_add fails commit 406d576cc457203cf86eac7f17839b2efec81db4 upstream. If kobject_init_and_add fails, we must call kobject_put (see the comment at kobject_init_and_add). Before calling kobject_init_and_add, we must zero the kobject (see https://lwn.net/Articles/52085/). If the first call to dm_sysfs_init failed, it may be called again, and that second call would see an uninitialized kobject. Cc: stable@vger.kernel.org Fixes: 784aae735d9b ("dm: add name and uuid to sysfs") Signed-off-by: Mikulas Patocka Reported-by: Wentao Liang Signed-off-by: Greg Kroah-Hartman commit 4b18793197878a0744b8d2ae5ef4878967a8c1b8 Author: guolingxing Date: Wed Oct 14 03:11:50 2026 +0000 dm-pcache: do not advance dirty_tail after backing flush failure commit b1310cb291935c788f34ed6eb1e7e9b42cfac045 upstream. After all writeback bios for a kset complete, writeback_ctx_end() flushes the backing device and then advances the persistent dirty_tail. However, backing_dev_flush() discards the error returned by blkdev_issue_flush(), so dirty_tail is advanced even when the written data is not known to be durable. dirty_tail points to the first kset that still requires writeback. Advancing it causes recovery to treat the preceding kset as clean and allows its cache copy to eventually be reclaimed by garbage collection. If the backing device flush failed, a subsequent power failure may therefore result in data loss. Make backing_dev_flush() return the flush status and handle a flush failure like a writeback I/O failure. Leave dirty_tail unchanged so that the same kset will be retried. Fixes: 1d57628ff95b ("dm-pcache: add persistent cache target in device-mapper") Cc: stable@vger.kernel.org Signed-off-by: guolingxing Signed-off-by: Mikulas Patocka Reviewed-by: Dongsheng Yang Signed-off-by: Greg Kroah-Hartman commit af80fc0de048e453b5984823ceda7fe02319c39b Author: Yingjie Wang <1075151112@qq.com> Date: Tue Nov 3 00:34:29 2026 +0800 dm thin: avoid wrapping no_space_timeout commit bcb78d49620f666b4a9d62997691e8d031fd4ebc upstream. set_pool_mode() converts the no_space_timeout module parameter with READ_ONCE(no_space_timeout_secs) * HZ. The usual arithmetic conversions evaluate the product as unsigned int, so it can wrap before being stored in the unsigned long delay. With HZ=1000, 4294968 seconds becomes 704 jiffies: a pool that runs out of data space switches to error_if_no_space and fails queued writes with -ENOSPC after about 0.7 seconds. Widen the value before the multiplication and cap it at MAX_JIFFY_OFFSET / HZ, so large timeouts no longer wrap into short delays. On 32-bit kernels, values beyond the supported jiffies range saturate at the largest whole-second delay not exceeding MAX_JIFFY_OFFSET. The timer wheel's existing handling of very long delays is unchanged. Fixes: 80c578930ce7 ("dm thin: add 'no_space_timeout' dm-thin-pool module param") Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang <1075151112@qq.com> Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit c448d356b585c81cd0113124871e5d1c1a11b174 Author: Yingjie Wang Date: Thu Nov 5 15:49:27 2026 +0000 dm mpath: cap queue_if_no_path_timeout_secs commit ae5b40accbc06f93e6a513e0e9a07fd32b197e49 upstream. enable_nopath_timeout() arms the no-path timer with jiffies + queue_if_no_path_timeout_secs * HZ. The module parameter is an unbounded unsigned long, so the delay can exceed what mod_timer() handles: a delay above LONG_MAX is treated as already expired, and values above ULONG_MAX / HZ also wrap in the multiplication. The timer then clears queue_if_no_path right away, and I/O queued after the last path fails gets -EIO instead of waiting for the configured time. On x86-64 with HZ=1000, 9223372036854776 seconds failed a write after 124 ms while one second less remained queued throughout a 4.2-second observation window. A value of 18446744073709552 seconds wrapped to 384 jiffies and failed the write after 455 ms. On 32-bit kernels with HZ=1000 the delay passes LONG_MAX above 2147483 seconds, a little under 25 days. Cap the seconds value at the largest whole-second delay not exceeding MAX_JIFFY_OFFSET before multiplying by HZ. This prevents signed-delta overflow and multiplication wrap. The timer wheel's existing handling of very long delays is unchanged. Fixes: be240ff5e402 ("dm mpath: Add timeout mechanism for queue_if_no_path") Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 09661f71e3d7949a1de07703c44294e9bf31187c Author: shao.mingyin@zte.com.cn Date: Tue Nov 3 18:53:40 2026 +0800 dm mpath: fix buffer overflow in parse_hw_handler() commit 8f611fe94a781c6fb658488cc7eab4e4923e6df6 upstream. parse_hw_handler() builds the hw_handler parameter string in a buffer sized with len = 4; plus one byte per argument. Those four bytes were meant for the decimal form of the parameter count, three digits plus the terminating NUL. dm_read_arg_group() accepts up to 1024 arguments and the count written is 'hw_argc - 1', so a count of 1000 or more needs four digits plus the NUL and sprintf() writes one byte past the allocation. Size the buffer from the actual string length instead. Fixes: 2bfd2e1337f0 ("[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit d9f0547f149110fb4403e21491af4f292c56b141 Author: Zhao Feng Date: Mon Nov 9 10:37:53 2026 +0800 dm crypt: fix use of uninitialized percpu_counter in ctr error path commit 8ba1ade3e6b595b9091040feaa3341d7e45ba95d upstream. If percpu_counter_init() fails in crypt_ctr() (e.g. when the underlying percpu allocation fails under memory pressure or fault injection), the error path jumps to "bad", which calls crypt_dtr(). crypt_dtr() then evaluates WARN_ON(percpu_counter_sum(&cc->n_allocated_pages) != 0) and calls percpu_counter_destroy() on a counter that was never initialized, because __percpu_counter_init_many() returns -ENOMEM before calling raw_spin_lock_init() on fbc->lock. With lockdep enabled this triggers "INFO: trying to register non-static key" in __percpu_counter_sum(), as reported by syzbot. The console additionally shows "crypt: Unknown error (-ENOMEM)" because this failure path sets no ti->error. Move percpu_counter_init() to right after the allocation of cc, before ti->private is set and before any "goto bad" can happen. On failure, set ti->error and free cc directly, so that crypt_dtr() is only ever called with an initialized counter. Reported-by: syzbot+4b232570d625662eaab4@syzkaller.appspotmail.com Closes: https://syzbot.org/bug?extid=4b232570d625662eaab4 Fixes: 5059353df86e ("dm crypt: limit the number of allocated pages") Cc: stable@vger.kernel.org Signed-off-by: Zhao Feng Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 30084cba42d2123810d5eb797b61f5b584a5ab65 Author: Kirtikumar Anandrao Ramchandani Date: Thu Nov 5 20:48:07 2026 +0100 dm cache: validate the discard block size before narrowing commit df8daa4d916c88ef7888c738e0eb3b6f11714a6f upstream. The discard block size doubles until the origin fits within the discard bitset limit. too_many_discard_blocks() passes this sector_t size to sector_div(), whose divisor is only 32 bits. Once the size exceeds that range, the division uses a truncated divisor, which can become zero. Use a 64-bit divisor when checking the block count. The selected size is stored in a u32, so reject sizes that cannot be represented before the assignment and before calculating the bitset size. This prevents a truncated zero size from reaching dm_sector_div_up(). An earlier proposal checks whether the mapped length exceeds the origin device. This fix also covers an origin device whose valid size requires a discard block size beyond the field's range. Reported-by: syzbot+c8564fc0a96e3ecbe4d4@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=c8564fc0a96e3ecbe4d4 Cc: stable@vger.kernel.org Fixes: 08b184514f65 ("dm cache: revert 'prevent corruption caused by discard_block_size > cache_block_size'") Signed-off-by: Kirtikumar Anandrao Ramchandani Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 56e8c6075385425e1574c267a6872d382d7b4756 Author: Edward Adam Davis Date: Mon Oct 26 12:21:37 2026 +0800 dm cache: reject kcopyd client destory if it setup failed commit 8b97b168eb4d3affcf23d2980a0c3f35ed9262e2 upstream. The value of cache->copier is -EINTR when failed to create a rescuer kthread for wq kcopyd, in cache_create(), the code jumps directly to __destroy(cache), it merely performs a simple check to see whether copier is NULL, potentially hitting: BUG: KASAN: null-ptr-deref in dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980 Read of size 4 at addr 0000000000000174 by task syz.2.19/6560 Call Trace: dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980 __destroy+0x172/0x2f0 drivers/md/dm-cache-target.c:1973 cache_create drivers/md/dm-cache-target.c:2604 [inline] cache_ctr+0x1674/0x2bf0 drivers/md/dm-cache-target.c:2649 dm_table_add_target+0x58d/0xc70 drivers/md/dm-table.c:749 populate_table drivers/md/dm-ioctl.c:1602 [inline] table_load+0x325/0x8a0 drivers/md/dm-ioctl.c:1645 ctl_ioctl drivers/md/dm-ioctl.c:2221 [inline] Set copier to NULL to avoid destroying a invalid kcopy client. Cc: stable@vger.kernel.org Fixes: c6b4fcbad044 ("dm: add cache target") Reported-by: syzbot+a2626a25eb2595e3ec3c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=a2626a25eb2595e3ec3c Signed-off-by: Edward Adam Davis Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 2b91c492f2e1708088074b04f725e4d831afcf6b Author: Kirtikumar Anandrao Ramchandani Date: Thu Nov 5 20:32:23 2026 +0100 dm: Reject table setup after queue or disk teardown commit ae310e4ad872a42f4707a596e66417f2aaa52826 upstream. A failed table load can leave a mapped device in a state where its queue has already been initialized or its disk has been removed, while md->type is still DM_TYPE_NONE. A later table load then calls blk_mq_init_allocated_queue() on the same queue. If del_gendisk() exited the old hardware contexts, blk_mq_exit_hctx() dereferences their cleared flush queue pointer. Reject setup attempts after queue initialization or disk removal. A failed request queue initialization still leaves md->tag_set NULL and can be retried. Set the request-based disk operations only after that initialization succeeds, so an unsuccessful attempt cannot leave a bio-based retry with request-based operations. Reported-by: syzbot+5307e3bcacec2ce4c2f0@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=5307e3bcacec2ce4c2f0 Cc: stable@vger.kernel.org Signed-off-by: Kirtikumar Anandrao Ramchandani Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit fc0e745c74a4344c330e38cde824ef611a15d219 Author: Ming-Hung Tsai Date: Fri Nov 6 19:59:22 2026 +0100 dm: fix use-after-free when dm_get_device() widens the open mode commit c834161ded1a141a58d5f03b24f6894291222c96 upstream. There's an UAF bug in dm_get_device(): when a table construction calls dm_get_device() on the same device twice with widen access mode (e.g., read-only first then read-write), the second dm_get_device() calls upgrade_mode(), which reopens the device in upgraded mode, making previously returned dm_dev* a stale pointer. Fixing approaches: - Add per-mode views (dm_dev_ref) from a per-device dm_dev_internal to multiple table_devices. - Keep reusing the dm_dev_ref when the requested mode is included, i.e., a read-only reference can reuse the read-write opened device within a table. - Maintain a canonical block_device pointer in dm_dev_internal for handling the DM_TABLE_DEPS ioctl. Also tweak the way of mode sharing check in find_ref() to "(x & mask) == mask". The result stays the same to the previous upgrade_mode() guard "(x | mask) == x". Pros: keep the relationship between dm_dev_internal and table_device: one dm_dev_internal per device, regardless the mode, so the output of DMM_TABLE_DEPS ioctl unchanged. Cons: extra dm_dev_ref allocation. Note that now the table_device's count not necessarily mean the number tables referecing this pair, since we're allowing multiple references within a table. Signed-off-by: Ming Hung Tsai Signed-off-by: Mikulas Patocka Co-Authored-By: Claude Opus 5 Fixes: 86f1152b117a ("dm: allow active and inactive tables to share dm_devs") Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 71af77c3cbfcd61764e5d65d7fdb227d4e623ad6 Author: Mark Bundschuh Date: Mon Oct 19 19:28:19 2026 +0000 dm: fix infinite loop in dm_blk_do_report_zones() commit 648320de920b30ae1730bbf0e8b86c0df0fb490a upstream. If the device underlying a zoned target is removed, its capacity is set to 0 and blkdev_report_zones() returns 0 without reporting any zones. The mapped device keeps its old capacity, so args->zone_idx and args->next_sector never advance and dm_blk_do_report_zones() loops forever. On non-preemptible kernels this causes soft lockups and RCU stalls. The following sequence of commands triggers the hang: modprobe scsi_debug zbc=managed dev_size_mb=1024 zone_size_mb=64 udevadm settle echo '0 2097152 linear /dev/sda 0' | dmsetup create lin echo 1 > /sys/block/sda/device/delete blkzone report -o 0 -c 1 /dev/mapper/lin Fix this by returning -EIO when a target reports no zones. The target always maps args->next_sector, so a zero return means the underlying device no longer covers that sector. Fixes: d41003513e61 ("block: rework zone reporting") Cc: stable@vger.kernel.org Signed-off-by: Mark Bundschuh Signed-off-by: Mikulas Patocka Reviewed-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman commit 9fe1bb021d09b04bf7328b013470741978b9d4d4 Author: Daejun Park Date: Thu Nov 12 10:35:29 2026 +0900 dm: fail a REQ_PREFLUSH bio with data when its preflush fails commit e92cd41e8e5ee5616c6c7cd4378661d942f0a7c0 upstream. For a bio with REQ_PREFLUSH and data, dm core may send an empty flush first. If the flush fails, __dm_io_complete() still reissues the bio without REQ_PREFLUSH and drops the error. When that write succeeds, the XFS log keeps running and fsync() can return 0. End the bio with the flush error instead of writing the data, as blk-mq does. Fixes: 6a8736d10cb4 ("dm: relax ordering of bio-based flush implementation") Cc: stable@vger.kernel.org Signed-off-by: Daejun Park Acked-by: Tejun Heo Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 10da6a6f2e952462fb89bddb9803fd6866a9dd44 Author: Yaohan Li Date: Wed Nov 4 17:15:42 2026 +0800 dm: avoid double-dropping the zone reset submission reference commit c4965effbe15f837a8089e79c0fc17ab19363cce upstream. On an error in __send_zone_reset_all(), the submission reference held by the dm_io can be decremented there and again by the caller's error path. If another clone is still outstanding, the second drop can release the dm_io before that clone completes. Only drop the submission reference in __send_zone_reset_all() on success. On failure, leave the reference for the caller's existing error handling to release once. The error path was reproduced under KASAN with an injected GFP_NOIO allocation failure while another zone-reset clone remained in flight. With the change, the same failure was reported normally, without the observed use-after-free, and ordinary zone resets continued to work. Fixes: 81e7706345f06 ("dm: handle REQ_OP_ZONE_RESET_ALL") Cc: stable@vger.kernel.org Assisted-by: ZCode:GLM-4 Signed-off-by: Yaohan Li Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit c4fb45611877818aab889006d88e9f87db7cac02 Author: shao.mingyin@zte.com.cn Date: Tue Nov 3 18:53:42 2026 +0800 dm log userspace: drop the device reference on error commit 0550d3b14e008b033b02cfce668008ec6addffe4 upstream. userspace_ctr() takes a reference on the log device with dm_get_device(). When the integrated-flush workqueue allocation fails it jumps to the shared error path, which frees the log context without dropping that reference, so the device stays busy and cannot be removed. userspace_dtr() drops the reference correctly; do the same here. Fixes: 5066a4df1f42 ("dm log userspace: allow mark requests to piggyback on flush requests") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Mikulas Patocka Signed-off-by: Greg Kroah-Hartman commit 0c17b9275fa515e9a3348fbedfe722f4c8e0fdc9 Author: Paulo Alcantara Date: Sun Nov 1 13:02:11 2026 -0300 smb: client: don't write back through O_DIRECT handles commit 0e85145af984f7cae2aadaa694cb8612009027ac upstream. Writeback uses the first writable handle of the inode, which may have been opened with O_DIRECT. Such handles are opened with FILE_NO_INTERMEDIATE_BUFFERING, for which Windows rejects any unaligned I/O with STATUS_INVALID_PARAMETER. Writeback of partly dirty pages and of the unaligned tail of a file through one of them fails, so netfs ends it with the folios clean and the data never reaches the server. xfstests generic/051, where fsstress mixes both kinds of opens, loses about 1% of its writes this way: smb3_write_err: ... offset=0xde90d7 len=0xbd0b rc=-22 All the rejected writes in a network capture were unaligned writes on a no-buffering handle; none of the aligned ones, and none of the unaligned ones on regular handles, were. Prefer a handle that was not opened with O_DIRECT, and use one that was only if there is no other. Fixes: 1013e760d10e ("SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit f65e74999b0bca76d5b824272292dbeceacc9864 Author: Paulo Alcantara Date: Fri Nov 6 15:49:46 2026 -0300 smb: client: don't spend read retries on reads cut short by a reconnect commit 1d4fcbfad120ddc30b81651f12096bfc84052f9a upstream. smb2_readv_callback() always retries a read cut short by a reconnect, but still asks cifs_io_should_replay() whether to mark it as a replay. On a soft mount that spends one of the mount's retransmissions and grows the backoff, so a later replayable error on the reissued read can fail it early. Mark such reads as replays without consulting the mount's retries, as already done for writes. Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 22561146f810eee83f4447fe900a48923f85e3dc Author: Paulo Alcantara Date: Wed Oct 28 23:07:14 2026 -0300 smb: client: don't retry failed writes forever regardless of mount options commit bb203c9af62adb59d82e8ecb715e778329e3b771 upstream. smb2_writev_callback() marks a write for retry whenever the server fails it with a replayable status, ignoring smb2_should_replay() and so the hard and retrans mount options. The latter is only used to decide on a backoff, so on a soft mount with no retrans, a server that keeps failing a write with e.g. STATUS_INSUFFICIENT_RESOURCES gets it resent forever, thousands of times per second, hanging anything waiting on its writeback: smb3_write_err: R=005c359e[2] ... offset=0x27000 len=0xfdf0 rc=-11 (569410 times in 255 seconds, same subrequest, no growing delay) Only retry such writes when cifs_io_should_replay() allows it, as already done for send errors in smb2_async_writev(), otherwise let them fail. Writeback thus keeps retrying them with backoff, within its retry window. Base the decision on the result of this attempt rather than on wdata->result, which is never reset on success and may hold the error of a previous attempt. Writes cut short by a reconnect get retried regardless too. Have writeback ones go through cifs_io_should_replay() as well, so that they back off and soft mounts give up on them after the retry window, as on other replayable errors. Other writes cut short keep being retried, without spending the mount's retries, but as replays, since they may have reached the server, unless umount -f stopped them, which fails them with -EIO. Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit e106a6e2f060f43d1ce12e943e42d8a6a02b2731 Author: Paulo Alcantara Date: Thu Oct 29 13:40:39 2026 -0300 smb: client: don't give up writeback on the first replayable error commit 274dec866f0882ee5a0f3d58d4d5c31af0c02417 upstream. Read and write retries follow the hard and retrans mount options, and mounts are soft with no retrans by default. For writeback this means that a single replayable error, e.g. a reconnect while sending, fails the subrequest and netfs ends writeback with its folios clean: the data is gone, possibly long after write(2) succeeded, with only fsync(2) left to notice. NFS soft mounts, by comparison, wait minutes for a server to answer before failing a request. Keep retrying writeback on replayable errors, with exponential backoff: forever on hard mounts, and on soft mounts for max(3, retrans) echo intervals from the first failure - 3 minutes by default, the time after which a silent server is considered unresponsive. The window applies to each write sent to the server, not to the whole writeback. umount -f or a shutdown still stops it right away. Direct and unbuffered writes, whose callers get the error, keep following the mount options. Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 8814ab12de4868b137e9048f95ba5de23d99d42a Author: liuyong Date: Fri Nov 6 18:48:35 2026 +0800 smb: client: validate descriptor headers before query result allocation commit ffb59029c0d52bf76fdd2678f5d6fd13e26220dd upstream. query_info() uses the server's returned length instead of the caller's minimum when a dynamic result is requested. A zero-length ACL response can therefore return ZERO_SIZE_PTR to id_mode_to_cifs_acl(), whose ownership-change path reads dacloffset before checking the header size. A KASAN-enabled test shows a read at address 0x20 and a kernel Oops. Validate the returned range and the caller's minimum before allocating the dynamic result. Keep the reported length zero if validation fails. Use the security descriptor header size as the minimum in SMB2_query_acl(). DACL-only and SACL-only xattr queries do not require owner and group SIDs, so enforcing MIN_SEC_DESC_LEN would reject short descriptors that these queries could previously return. The rewrite paths validate the required owner/group SIDs and DACL separately before using their contents. These issues were discovered and fixed by Qihoo 360's Tulongfeng multi-agent system. Fixes: 9ee2afe5207b ("cifs: prevent copying past input buffer boundaries") Cc: stable@vger.kernel.org Signed-off-by: liuyong Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 319ed39077dddcced202fc5f3aeda513a0e6ca05 Author: Joseph Qi Date: Tue Nov 3 17:15:58 2026 +0800 smb: client: skip NULL channel in __cifs_put_smb_ses() commit 8deaf64a59a263161dfc5128f8398fb3dcba4fac upstream. cifs_chan_skip_or_disable() clears a secondary channel's slot in the session (ses->chans[chan_index].server = NULL) without lowering chan_count when the server stops supporting multichannel. When the session is later released, __cifs_put_smb_ses() walks every slot up to chan_count and calls cifs_put_tcp_session() on it, which dereferences the server pointer immediately, so a slot left NULL by the skip path makes the release crash with a NULL pointer dereference. Clearing a slot without lowering chan_count is older than cifs_chan_skip_or_disable(): cifs_chan_update_iface() could already do the same since commit b54034a73baf9 ("cifs: during reconnect, update interface if necessary"), and the release loop has been unguarded since then. Commit 12d1e301bdfd1 ("cifs: do not let cifs_chan_update_iface deallocate channels") later removed that trigger, but the crash is reachable through it on older kernels. cifs_decrease_secondary_channels() already guards the same put with if (server). Add the same guard to the release loop so a skipped channel slot is left alone. Fixes: b54034a73baf9 ("cifs: during reconnect, update interface if necessary") Cc: stable@vger.kernel.org Signed-off-by: Joseph Qi Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 96cccc086e5874742fdbb37150507415944f1440 Author: Paulo Alcantara Date: Wed Oct 28 22:41:59 2026 -0300 smb: client: retry writes that couldn't be issued due to a reconnect commit 64db0dc1f3e689145e698bc1b20ee70b1724b945 upstream. __cifs_issue_write() fails a subrequest with -EAGAIN when its handle got invalidated or its credits belong to a session from before a reconnect, both before sending anything. netfs used to retry any -EAGAIN by itself, but now only retries subrequests marked for it, so these writes fail and their folios end writeback clean, losing the data. Mark them for retry instead. The retry gets the handle reopened and fresh credits in cifs_prepare_write(). Fixes: 82e8885bd763 ("netfs: when subreq is marked for retry, do not check if it faced an error") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 9233d7c08a14bc05600f7175812035ea85d3a165 Author: Paulo Alcantara Date: Wed Oct 28 23:09:16 2026 -0300 smb: client: retry writeback on interrupts and allocation failures commit fb39fbd782bcd2dccd05f633bc6ac348209dc272 upstream. Issuing writes from a worker only helps when the task is already dying at issue time. A fatal signal can still arrive after that check and before __smb_send_rqst() checks again, or while waiting for a credit in cifs_call_async(), or in the middle of a send. The write then fails with -ERESTARTSYS, which isn't a replayable error, so netfs marks the subrequest failed and drops its folios clean: netfs_sreq: R=000041f6[2] UPLD SUBMT ... s=400000 0/400000 smb3_write_err: R=000041f6[2] ... offset=0x400000 len=0x400000 rc=-512 netfs_failure: R=000041f6[2] UPLD ... upload e=-512 losing 4MiB of a 64MiB file closed by a task killed meanwhile. A failed memory allocation while building or sending a write drops its data the same way. No server status maps to an interrupt error or to -ENOMEM, so for writeback such errors always mean the client gave up locally. Mark the subrequest for retry, with backoff and giving up on umount -f, as cifs did with is_retryable_error() before switching to netfslib and as NFS does for these errors. netfs collects writeback from a workqueue, so the retry gets prepared and issued with no signals pending. Only the SMB2 read and write paths sleep before replaying, so SMB1 would resend such writes right away. Move the sleep to cifs_issue_read() and __cifs_issue_write(). Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit bced8b4c8ed74dfdb46eebc596d49e50aa2292d8 Author: Paulo Alcantara Date: Wed Oct 28 23:06:28 2026 -0300 smb: client: let umount -f abort retried reads and writes commit adeb82ac455582eac1894d1ca1b0aba110a65cc3 upstream. umount -f only wakes up tasks waiting on the server's queues. Reads and writes being retried - forever on hard mounts - keep going, so with the server gone the unmount still hangs in sync_filesystem() waiting for their writeback. NFS kills outstanding RPCs on umount -f instead. Count umount -f attempts per superblock and have each read and write request remember the count it started with. Fail with -EIO, rather than retry, reissue, issue or wait for credits, any subrequest of a request that predates a umount -f once it is a retry or the server or share is disconnected; a kworker doing writeback can't be signalled out of the credit wait otherwise. First attempts on a connected server still go ahead, and requests started later aren't aborted (but see below), so I/O on a healthy server keeps working if the unmount then fails with -EBUSY or only detaches one of several mounts. retry_count is not bumped yet when netfs_retry_write_stream() calls prepare_write() for the first retry, so don't rely on it alone to tell a reissue from a first attempt: treat a subrequest as a retry when it already carries an xid (it has been prepared before) in prepare_write()/prepare_read(), or when its replay flag is set in cifs_io_aborted(), and abort it when the mount is going away even if the connection still looks healthy. Requests created after umount -f - writeback kicked off by the background flusher, an oplock break or sync_filesystem() during the final teardown - snapshot the already bumped count and would otherwise retry forever on a hard mount, hanging cifs_kill_sb(). Once a superblock that saw a umount -f reaches cifs_kill_sb() the mount is going away for good, so flag it and stop retrying I/O on it too; one that never saw a umount -f still flushes as before. A sync(2) or syncfs() waiting under s_umount for writeback started after umount -f would still keep the unmount from reaching cifs_kill_sb(), so also stop retrying such I/O while s_umount is contended. After a failed umount -f, that also stops reads and writes retrying while a remount, freeze or new mount of the same superblock waits on s_umount. Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 2562b6c137f6f4b4ef43d74e3a40f94ac5caee0f Author: Paulo Alcantara Date: Wed Oct 28 21:02:28 2026 -0300 smb: client: issue writes from a worker if the task is dying commit 1a747bacf250959703c68fed1bb643f888dd3ad2 upstream. A task with a fatal signal pending can't send on the socket: __smb_send_rqst() refuses it upfront with -ERESTARTSYS, as SIGKILL can't be blocked and a send interrupted halfway forces a reconnect. Writeback, however, runs in the context of whoever starts it, so when a dying task flushes dirty pages - close() racing with SIGKILL, or fd teardown during exit_group() - every write subrequest gets refused: smb3_write_err: ... offset=0x1400000 len=0x400000 rc=-512 cifs_flush_err: ino=... rc=-512 Since the switch to netfslib, a failed upload ends writeback with the folios clean, so the data is silently lost: the server ends up with 20MiB of a 64MiB file while stat(2) reports the full size. Issue writeback subrequests of dying tasks from a new cifswritebackd workqueue instead, like afs does for all of its writes, so they get sent from a context with no signals. Leave direct and unbuffered writes alone, as their callers get the error. Use a dedicated WQ_UNBOUND workqueue as the writes may block for long on credits, sends or reopens, e.g. on hard mounts with an unresponsive server, and must not hold up other cifs work such as reconnects, nor starve the WQ_MEM_RECLAIM rescuer of cifsiod_wq. Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit fd56b0cb4d71e3679214dc28f7d70bf740279478 Author: Joseph Qi Date: Tue Nov 10 17:48:29 2026 +0800 smb: client: hold the inode across cifs_oplock_break() commit fce78321f1b59531cf6fc94860550db1db8dec55 upstream. cifs_oplock_break() drops the handle reference in the middle of the handler and keeps using cinode afterwards, to send the break acknowledgment and again in cifs_done_oplock_break(). The reference cifs_queue_oplock_break() takes is the only pin: the handle holds the dentry and the dentry is what keeps the inode alive. When that put is the last reference, the dput() in cifsFileInfo_put_final() kills an unhashed dentry, drops the last i_count and evicts the inode, so the rest of the handler runs on an object whose free is only RCU-deferred. An unhashed dentry that a handle still references is an ordinary state: unlinking an open file leaves the dentry that way, and so does the dcache teardown at unmount. Take a reference on the inode for the lifetime of the handler and drop it once the break has been reported. This also covers the cifs_get_tlink() failure path, where the put is followed directly by the out label. Fixes: b98749cac4a6 ("CIFS: keep FileInfo handle live during oplock break") Fixes: 23b26f4408ac ("smb: client: avoid leaking refcount when cifs_sb_tlink() fails") Cc: stable@vger.kernel.org Signed-off-by: Joseph Qi Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 6d57e23dff80a7bdf9d29ba4ea082804278bab92 Author: Joseph Qi Date: Tue Nov 3 17:15:57 2026 +0800 smb: client: hold server ref while queueing reconnect work commit f02d249e9756b78990aaaa1635e47e06deb2cb51 upstream. When query_server_interfaces() returns -EOPNOTSUPP on a secondary channel, smb2_reconnect() calls smb3_update_ses_channels() which for a channel runs cifs_chan_skip_or_disable(). That clears the channel's slot in the session and calls cifs_put_tcp_session(), which can drop the last reference of the channel and tear it down. smb2_reconnect() then falls through to skip_add_channels and queues reconnect work on that server, using a server that may already be freed. The send path obtained the channel from cifs_pick_channel(), which does not take a reference, so the session's channel reference is the only one. Take our own reference on the channel before calling smb3_update_ses_channels() and drop it after the reconnect work has been queued, so the channel cannot be freed while it is still used. Fixes: f591062bdbf4 ("cifs: handle servers that still advertise multichannel after disabling") Cc: stable@vger.kernel.org Signed-off-by: Joseph Qi Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 39588fe16012699869905cac3bbef59110142d9e Author: Paulo Alcantara Date: Wed Nov 11 11:59:52 2026 -0300 smb: client: flush deferred handles of other names before a hard link open commit 25912ed3b75dcf5ff623dcb549b925dd0d0948f7 upstream. Opening a hard link of a file whose other name still holds a deferred, leased handle fails with EINVAL over SMB3. The client caches lease keys per inode, but the server ties a lease to the file name it was granted under, so reusing the inode's lease key to open a different name of the same inode is rejected with STATUS_INVALID_PARAMETER (MS-SMB2 3.3.5.9.11). Commit 262b73ef442e ("smb3 client: fix open hardlink on deferred close file error") already closes the inode's deferred handles before such an open so the new name can take a fresh lease, but cifs_get_hardlink_path() only triggered that flush when a cached handle had the same open flags as the new open, so a differently accessed name - written then read, say - slipped through and still failed. Match on the name instead: flush when a cached handle for another name of the inode is open, regardless of access mode. Reported-by: Giuseppe Piscitelli Closes: https://lore.kernel.org/r/CACmoRBbDZR3eyEM65j73sWMS7A=T89z1QAvCP=+u0WGzZhwW6g@mail.gmail.com Fixes: 262b73ef442e ("smb3 client: fix open hardlink on deferred close file error") Cc: stable@vger.kernel.org Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit e35ae3edae0f72bf2135c37d7eaee48106f7a008 Author: Fredric Cover Date: Sat Nov 7 02:02:56 2026 +0000 smb: client: fix out-of-bounds read in dfs_parse_target_referral() commit 86aacc2f3f6ba18e1d87feee24f37c94b3ce863a upstream. dfs_parse_target_referral() decides whether a prefix path remains after the consumed part of full_path with: if (strlen(full_path) - ref->path_consumed) strlen() returns size_t, so if path_consumed is larger than the length of full_path, the subtraction wraps around to a huge non-zero value. The branch is then taken, prepath is set to a pointer past the terminating NUL of full_path, and *prepath reads out of bounds. path_consumed can exceed strlen(full_path) when the mount charset is not utf8. The referral code derives path_consumed from the canonical path, which is in the DFS cache charset (utf8), but it is applied here to full_path, which is in the mount charset. Each non-ASCII character in the consumed part of the path that is longer in utf8 than in the mount charset makes the count too large by the difference. This was reproduced with iocharset=iso8859-1 against a Samba DFS root containing a link named "café", mounting with the single Latin-1 byte 0xe9 in the path. On an unmodified tree such a mount fails earlier with -ENOENT because the path is converted to utf8 twice in setup_dfs_ref(); with that fixed ("smb: client: fix double conversion of DFS path in setup_dfs_ref()"), the mount reaches this code. full_path was 29 bytes while path_consumed was 30: BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270 Read of size 1 at addr ffff88810db89d5f by task mount/1743 ... The buggy address is located 0 bytes to the right of allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f) Compare path_consumed against the string length instead of subtracting, so that no prefix path is used when the consumed count covers the whole string. With the bounds check in place the same mount succeeds and no KASAN report is produced. This only prevents the out-of-bounds access. path_consumed is still in the wrong units, so a non-ASCII link followed by a path component can still produce a wrong prefix path. That needs a separate fix. Signed-off-by: Fredric Cover Cc: stable@vger.kernel.org Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 40b21789cf79281bbb5ae008bd6e0a53c98ac99a Author: Andrey Misiurov Date: Fri Oct 30 22:38:27 2026 +0100 smb: client: fix OOB write when compounding SMB2_IOCTL with encryption commit 73a0060cb22a1d2bd8bff364c18a4259ec0cb528 upstream. On an encrypted ("seal") mount, SMB2_ioctl_init() keeps the IOCTL input in a separate iov (iov[1]); iov[0] is a 448-byte buffer from cifs_small_buf_get(). When such an IOCTL is not the last request of a compound, smb2_set_next_command() pads it for alignment by copying the whole request into iov[0]. A large enough input overflows that 448-byte buffer and corrupts the slab; the copy also sets rq_nvec to 1, so the input buffer is leaked too. An unprivileged user can trigger it by creating a symlink with a long target on such a mount: the native symlink is sent as FSCTL_SET_REPARSE_POINT + QUERY_INFO + CLOSE in one compound, so the IOCTL is not the last request. With slub_debug red zones on the cifs_small_rq cache, the overflow is caught on the next allocation from that cache in the same compound (the 0x61 bytes are the 'a' characters of the symlink target): BUG cifs_small_rq (Not tainted): Object corrupt [Left Redzone overwritten] 0xffff8a59c7790500-0xffff8a59c779053f First byte 0x61 instead of 0xbb Call Trace: check_object+0x1a8/0x350 alloc_debug_processing+0xab/0x110 ___slab_alloc+0x7e/0x2f0 kmem_cache_alloc_noprof+0x28d/0x4b0 mempool_alloc_slab+0x16/0x30 cifs_small_buf_get+0x1a/0x30 [cifs] SMB2_close_init+0x8a/0x100 [cifs] smb2_compound_op+0x2571/0x2b50 [cifs] smb2_create_reparse_inode+0x27e/0x490 [cifs] mknod_nfs+0x1ce/0x2e0 [cifs] create_reparse_symlink+0x119/0x180 [cifs] cifs_symlink+0x19f/0x8e0 [cifs] vfs_symlink+0xa3/0x1b0 __x64_sys_symlink+0x41/0x70 Pad the input to a multiple of 8 bytes when encryption is required. The request is then already aligned and smb2_set_next_command() no longer copies it; InputCount still carries the real length. Fixes: 90f7c100d2dd ("smb: client: fix compound alignment with encryption") Cc: stable@vger.kernel.org Signed-off-by: Andrey Misiurov Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 494d6f105a5d2766bcc2508a8fa7a46a503e2070 Author: Fredric Cover Date: Sat Nov 7 02:02:57 2026 +0000 smb: client: fix double conversion of DFS path in setup_dfs_ref() commit 92509ce64ffff02d05fe9f3c82b889e1cc500076 upstream. setup_dfs_ref() converts the path from the mount charset to the DFS cache charset (utf8) via dfs_get_path(), and then passes that already converted string to dfs_get_referral(). dfs_cache_find() converts its input again, assuming it is still in the mount charset. When the mount charset is not utf8 (iocharset=iso8859-1, or a kernel built with a non-utf8 CONFIG_NLS_DEFAULT) and the DFS path contains non-ASCII characters, the utf8 bytes are interpreted as mount-charset characters and encoded a second time. For example, "é" is sent as c3 83 c2 a9 instead of c3 a9. The server then fails the second-level referral with STATUS_OBJECT_PATH_NOT_FOUND and the mount fails with -ENOENT, even though the path exists. Pass the unconverted path to dfs_get_referral() so that it is converted exactly once. Such mounts now get past the second-level referral and reach dfs_parse_target_referral(), which is why this change depends on "smb: client: fix out-of-bounds read in dfs_parse_target_referral()". Tested with a Samba DFS root containing a link named "café", mounted with iocharset=iso8859-1 and the single Latin-1 byte 0xe9 in the path: before, the mount failed with -ENOENT; with both patches applied, it succeeds. Signed-off-by: Fredric Cover Cc: stable@vger.kernel.org Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit a9434342c34ec6813c7d9beab597e99007b4b611 Author: Paulo Alcantara Date: Wed Oct 28 21:06:31 2026 -0300 smb: client: don't block dying tasks waiting for writeback on fsync commit 0df0f24803061b6c2bef0d24de7c63c9cce46a49 upstream. cifs_fsync() and cifs_strict_fsync() wait uninterruptibly for writeback through file_write_and_wait_range(). As with close, a task killed in fsync(2) on a hard mount with an unresponsive server is stuck in D state until the server comes back. Wait killably instead, using the same helper as cifs_flush(). The writeback keeps going and its errors stay in the mapping; only the dying caller stops waiting for it. Signed-off-by: Paulo Alcantara Reviewed-by: David Howells Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 9d377a9e28f9f8497784d75f14c502dcea8670fd Author: Paulo Alcantara Date: Wed Oct 28 20:35:11 2026 -0300 smb: client: don't block dying tasks waiting for writeback on close commit 15ea186abbcd04157c62e0901701870b812bb2bd upstream. cifs_flush() waits uninterruptibly for the writeback it starts. A task that gets killed while closing a file on a hard mount with an unresponsive server is stuck in D state until the server comes back. It also consumes any writeback error for a caller that is about to exit, hiding it from everyone else. Wait killably instead. If the closer gets killed, stop waiting and leave the error bits in the mapping for others to see; writeback already in flight completes on its own. Don't wait at all, nor check for errors, if it is already dying. This is also needed before letting dying tasks issue their writes from a worker, which would otherwise make them wait for every one of them. Fixes: d3f1322af8f8 ("cifs: wait for writeback to complete in cifs_flush") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 2748602e8a0083766a791c0343db2cc25ca4a1d2 Author: liuyong Date: Fri Nov 6 18:48:36 2026 +0800 smb: client: compare owner and group SIDs using their encoded lengths commit a2dabe73ea05ad3b3f8e1cc08fb2e7c2ddc5564b upstream. populate_new_aces() compares owner and group SIDs over sizeof(struct smb_sid), including storage for all 15 possible subauthorities. Received SIDs contain only their encoded subauthorities. The comparison can read past the security descriptor, as shown by the supplied KASAN report for a 44-byte descriptor during chmod. The input SIDs have already been checked by sid_from_sd(). Require equal subauthority counts, then compare only the fixed SID header and the encoded subauthorities with memcmp(). The count check ensures that both validated SIDs contain the number of bytes being compared. These issues were discovered and fixed by Qihoo 360's Tulongfeng multi-agent system. Fixes: 0f22053e811c ("cifs: Fix unix perm bits to cifsacl conversion for "other" bits.") Cc: stable@vger.kernel.org Signed-off-by: liuyong Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 2f4f231b924a13b175e350e4858c49097800c738 Author: Yifan Zhang Date: Tue Nov 3 10:45:19 2026 +0800 smb: client: bound invalid NTLMSSP signature diagnostic commit 0584b02669c3e76188097174b4f25ed13723e94c upstream. The NTLMSSP Signature field is an eight-byte binary value and need not be NUL-terminated. decode_ntlmssp_challenge() prints it with %s on the signature-mismatch path, so the diagnostic can continue beyond the received blob until it encounters a zero byte. KASAN reports: BUG: KASAN: slab-out-of-bounds in string Read of size 1 string vsnprintf _printk decode_ntlmssp_challenge Print the fixed-width field with the bounded hexadecimal format. The patched kernel reaches the invalid-signature path and returns -EINVAL without a KASAN report. Fixes: 0b3cc858003b ("[CIFS] NTLMSSP reenabled after move from connect.c to sess.c") Reviewed-by: Namjae Jeon Signed-off-by: Yifan Zhang Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit d00dad3df5b8b88023ed36e10a709a5bf3d3290f Author: Giuseppe Scrivano Date: Sat Nov 7 21:34:13 2026 +0100 ovl: follow lower to lowerdata redirects from any lower layer commit cbf4ccabcbfdda3da70c10b37e21e99cd2ee0946 upstream. Commit 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect") allowed following redirects from a lower layer to a data-only layer without redirect_dir=follow and metacopy=on, so that data-only layers can be used with userxattr. That fix was incomplete. Without metacopy=on, a metacopy file with an absolute redirect into a data-only layer is followed only from the lowest lower layer. From any other lower layer, the lookup fails with EPERM. That commit also changed the behavior of redirect_dir=nofollow without making it visible to users. With data-only layers, some redirects are followed, although the mount options show redirect_dir=nofollow, or show nothing when that is the default. Add redirect_dir=followdata, which follows only redirects from lower to lowerdata, and select it when there are data-only layers, unless redirect_dir=follow or redirect_dir=on is in effect, so the redirect follow mode in effect is shown in /proc/self/mountinfo. Without metacopy=on, the absolute redirect of a lower metacopy file stops the lookup in the lower layers and the data is looked up in the data-only layers. Data-only layers cannot be used without following redirects, so reject an explicit redirect_dir=nofollow with data-only layers. Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect") Cc: stable@vger.kernel.org Signed-off-by: Giuseppe Scrivano Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 8f4d780154700800b5e8e401602bcb39f81f4b5d Author: Amir Goldstein Date: Sat Nov 7 14:40:10 2026 +0100 ovl: do not check the deferred lowerdata redirect on index lookup commit 011f67b2b5c366679af023261ee02e284d534a96 upstream. When a lower metacopy has an absolute redirect into a data-only layer, ovl_lookup_layers() defers the data lookup and skips ovl_check_follow_redirect(), but leaves the redirect in d->redirect. If there is no upper dentry and a sibling hardlink was already copied up to the index dir, the index branch calls ovl_check_follow_redirect() again and, with redirect_dir=nofollow (e.g. forced by userxattr), fails the lookup with -EPERM because of the lower data redirect. Take the lowerdata redirect out of d->redirect at the point where the data lookup is deferred, so that the index check only validates the redirect and metacopy state of the index entry. Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect") Closes: https://sashiko.dev/#/bug/linux-29bea9ea-5376-4e54-88f6-04dabce4db70 Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 51567368603443a18fa5b575ccb5a91df0185dd4 Author: Amir Goldstein Date: Mon Nov 9 09:05:41 2026 +0100 ovl: do not allow nfs_export with data-only layers commit fba955b070d13e2fdac097577ce3c6ffbeda4ea9 upstream. Since data-only layers no longer require metacopy=on, which conflicts with nfs_export=on, an overlay with data-only layers can be mounted with nfs_export=on. Decoding a file handle of a lower metacopy file whose data is in a data-only layer builds the inode only from the decoded lower dentry, without the lazy lowerdata redirect, so the data of the file would be read from the metacopy file in the lower layer. Fail the mount with explicit nfs_export=on and data-only layers and otherwise disable nfs_export with data-only layers. Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect") Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 35d68f34c8a74d3b5b7fd304bcfeb5d345dcbf8f Author: Daejun Park Date: Thu Nov 12 12:58:09 2026 +0900 ovl: bump the impure dir version when linking a file with origin commit 86e2facd8630cc2fdec6ea80c53e370b26b441d9 upstream. Linking a file with copy up origin into a non-merge impure dir does not bump the dir version. readdir then reuses the impure dir cache built before the link. It reports the upper inode number as d_ino of the new link, not st_ino. Pass whether the linked file has an origin to ovl_dir_modified(), as rename and unlink do. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-98f207b6-3936-48e9-a40f-88f20be4db7b Fixes: 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs") Cc: stable@vger.kernel.org Signed-off-by: Daejun Park Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 93969ee3a994a11c5167986b39f8532a54e20be6 Author: Giuseppe Scrivano Date: Wed Nov 11 12:26:04 2026 +0100 ovl: return EIO if the lowerdata is missing commit 0d5e729c515f4ae4eacc179dbcf350d9b499a161 upstream. The data of a metacopy file that redirects to a data-only layer is looked up when the file is opened, and the error of the lookup is returned as is. If the data file is missing, open() fails with ENOENT even though the file is there and stat() works. This can be an integrity problem when using composefs: a data file that is changed or has the wrong fs-verity digest is reported with EIO, but a missing one is not reported, the file just looks like it does not exist, e.g. a configuration file that overrides the defaults. Return EIO as it is already done in ovl_lookup() when no lower data is found for a metacopy file. ENOMEM is not changed. Fixes: 42dd69ae1af4 ("ovl: implement lazy lookup of lowerdata in data-only layers") Cc: stable@vger.kernel.org Signed-off-by: Giuseppe Scrivano Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit f5c15d106fb6c9e39704d13d0dfc106ca0e7b37a Author: Amir Goldstein Date: Mon Nov 9 09:50:12 2026 +0100 ovl: report the requested redirect_dir mode in conflicting options commit 248503755b3cab89742edcc3cfd53adbcf7bfec2 upstream. Since the redirect_dir mode is stored as an enum, "off" is translated to "follow" or "nofollow" when parsing the option and redirect_dir=follow is translated to "on" for a non-upper mount, so the errors about options that conflict with an explicit redirect_dir= report a mode that the user did not request. Translate "off" when verifying the mount options instead of when parsing them and report the requested mode in those errors. Fixes: af5f2396b671 ("ovl: store enum redirect_mode in config instead of a string") Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 1343a71798e37e14dde7b08aa9a4d49c8cf13bbd Author: Jérémy Jean Date: Wed Nov 11 22:42:26 2026 +0000 ovl: reject different lower idmaps on the same fs commit 720f40c05b2785406121da0151543751204f2953 upstream. Overayfs mounted with index=on or nfs_export=on require file handle support from backing filesystems. Overlay file handles identify a backing filesystem, but not the lower mount used to decode it. If lower layers share a superblock and use different idmaps, a handle can decode through the wrong layer. Record the first idmap on a private lower clone for each backing filesystem. Fail if another clone has a different idmap. Comparing the private clones prevents mount_setattr() from changing the checked state. Distinct idmap objects are treated as ambiguous. Fixes: bc70682a497c ("ovl: support idmapped layers") Suggested-by: Christian Brauner Link: Link: https://lore.kernel.org/all/20260925-server-hager-riskieren-06116eded213@brauner/ Cc: stable@vger.kernel.org Signed-off-by: Jérémy Jean Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 6caff173ae6a704dfc56f92d60ffdf545d53b293 Author: Amir Goldstein Date: Sat Nov 7 15:48:36 2026 +0100 ovl: fix leak of lowerdata redirect on ovl_get_inode() failure commit f1b7e5534854043077bb72afc8d87ad1e0b283e0 upstream. ovl_lookup_layers() moves d->redirect into oip.lowerdata_redirect and clears d->redirect before calling ovl_get_inode(). When ovl_get_inode() fails, it does not free oip.lowerdata_redirect, and ovl_lookup() frees the already cleared d->redirect, so the lowerdata redirect string is leaked. Clear d->redirect only after ovl_get_inode() has succeeded, like d->upperredirect, so that ovl_lookup() frees it on failure. Fixes: 2b21da920866 ("ovl: prepare to store lowerdata redirect for lazy lowerdata lookup") Closes: https://sashiko.dev/#/bug/linux-dabbd363-9c71-4915-af72-e2b5e75fa58e Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit baff898c8ad8b46ce1378559160eb00287ecf6cd Author: Amir Goldstein Date: Fri Nov 6 13:01:26 2026 +0100 ovl: do not read the flags of a put upper dentry in lookup commit 7031366be218f291592a7ad38bc34a7cd1459737 upstream. ovl_lookup_layers() passes ctx->upperdentry to ovl_get_inode(), which takes over the reference. If an overlay inode for the upper inode is already cached, as for a second hard link, ovl_get_inode() puts the dentry and returns the cached inode. ovl_lookup_layers() then passes the put dentry to ovl_dentry_init_reval(), which reads its d_flags. With a local upper fs the put dentry usually stays in the dcache, but with a FUSE upper whose entry has timed out, dput() kills it, so this is a use-after-free. Fix this by taking the revalidate flags from the upper dentry of the overlay inode, which is the one that ovl_dentry_revalidate_common() revalidates. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-986db859-840c-479d-944c-b9c43b93377e Fixes: bccece1ead36 ("ovl: allow remote upper") Cc: stable@vger.kernel.org Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit 1b16ca2e5f7787978b6cfba82c3a2e203d1e4d90 Author: Giuseppe Scrivano Date: Fri Nov 6 14:38:18 2026 +0100 ovl: do not always clear absolute_redirect commit 477449a7a5fd1b2fe973fe2978b0c921115a65f3 upstream. ovl_check_redirect() clears d->absolute_redirect before it checks that the path element has a redirect xattr. An element without one, such as an intermediate directory in a lower layer, then clears the flag set by the absolute redirect of a metacopy file found in a higher layer. The lookup of the data in the data-only layers is not deferred any more and the lookup fails with -EIO: # l2/f: metacopy, redirect "/dir/file"; l1/dir/ exists, no "file" mount -t overlay none -o metacopy=on,redirect_dir=on,\ lowerdir+=l2,lowerdir+=l1,datadir+=data m cat m/f # Input/output error Set d->absolute_redirect only when a redirect xattr was read. Fixes: 5436ab0a864e ("ovl: implement lookup in data-only layers") Closes: https://sashiko.dev/#/bug/linux-2cc24e0b-fbdc-4cf1-aded-cfd19c2918ee Cc: stable@vger.kernel.org Signed-off-by: Giuseppe Scrivano Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman commit d1c8e662cd14db2f3ae98fc224f64f3cc7adaa11 Author: Bartosz Golaszewski Date: Thu Nov 5 14:23:45 2026 +0100 gpiolib: synchronize updates of descriptor labels commit 82028344caeed2ea3536708906adee02e472633d upstream. desc_set_label() swaps desc->label with rcu_replace_pointer() but without any synchronization of concurrent updates. The swap is a plain read + write: two threads can observe the same old label and then call call_scru() on the same SRCU head corrupting the state of the chain. Add a spinlock to struct gpio_device - we're using a single spinlock for all descriptors as using a per-descriptor lock would unnecessarily bloat the size of the desc array with very little chance and no consequences of contention - and use it to serialize the pointer update. Cc: stable@vger.kernel.org Fixes: 1f2bcb8c8ccd ("gpio: protect the descriptor label with SRCU") Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9 Link: https://patch.msgid.link/20261105-gpiolib-set-desc-label-corruption-v1-1-fa84726ceac0@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit eb2be1b930558aa1ae202bbce949002826fd9cfe Author: Bartosz Golaszewski Date: Tue Nov 10 11:01:10 2026 +0100 gpiolib: fix stack out-of-bounds access in gpiochip_add_hog() commit f8a4fdf57cedb9cb3f47d94269ff27fea8e819e8 upstream. In gpiochip_add_hog(), parsing a device tree with an excessively large "#gpio-cells" property causes a stack out-of-bounds write when populating the GPIO specification. The value read from #gpio-cells is used to copy the values into right places in struct fwnode_reference_args but that struct's args field is an array of size NR_FWNODE_REFERENCE_ARGS so a value larger than it will make the loop write past the end of that array. If #gpio-cells is 0, we can trigger a divide-by-zero later when calculating the actual number of hogs. If #gpio-cells is 1, we can also perform an out-of-bounds read of the "gpios" array. Reject #gpio-cells larger than NR_FWNODE_REFERENCE_ARGS, lower than 1 and make sure #gpio-cells is larger than 1 before checking the active-low flag. Cc: stable@vger.kernel.org Fixes: 802c51a83e9a ("gpiolib: fix hogs with multiple lines") Closes: https://sashiko.dev/#/bug/linux-fdec1c0e-c6e3-4eb6-8746-d68a3f951374 Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20261110-gpiolib-hog-stack-corruption-v2-1-c5b28cb8dc8e@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit c204a4c377bd43f68b6a3c1d25b455a1e89ed48e Author: Yu Zhang Date: Mon Nov 2 17:57:07 2026 +1000 gpio: virtuser: remove the debugfs files before freeing the line data commit c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3 upstream. gpio_virtuser_probe() registers the devm action that removes the debugfs directory before it allocates the per-line and per-array data that the debugfs files point to. devres releases resources in reverse order, so on unbind the line data is freed, the consumer_lock mutex is destroyed and the GPIO descriptors are put first, and the debugfs files are only removed afterwards. A read or write of any of the per-line debugfs files (value, direction, consumer, interrupts, ...) that runs in that window dereferences the freed data. debugfs_remove_recursive() waits for in-flight file operations, but by then the data has already been freed. Running eight threads that read the per-line debugfs files while another task writes 1 and 0 to the configfs "live" attribute triggers this within a second on a KASAN kernel, with gpio-sim as the provider: BUG: KASAN: slab-use-after-free in gpio_virtuser_value_get+0x19/0x60 Read of size 8 at addr ffff888005109e38 by task vu_race/3479 Call Trace: gpio_virtuser_value_get+0x19/0x60 simple_attr_read+0x109/0x290 debugfs_attr_read+0x5e/0x80 full_proxy_read+0xae/0xe0 vfs_read+0x1bc/0x7a0 Allocated by task 1: devm_kmalloc+0x89/0x1d0 gpio_virtuser_probe+0x56f/0x910 Freed by task 1: kfree+0x196/0x430 release_nodes+0x77/0xa0 devres_release_all+0xf3/0x150 device_unbind_cleanup+0x18/0x130 ... platform_device_unregister+0x3c/0x50 gpio_virtuser_device_deactivate+0x3c/0xc0 The same run also reports use-after-free on the freed consumer_lock from the consumer attribute. Register the debugfs removal action after the line data has been set up, so that it runs first on unbind, and remove the directory by hand on the probe error paths before that point. Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API") Cc: stable@vger.kernel.org Signed-off-by: Yu Zhang Link: https://patch.msgid.link/20261102075707.41742-1-yuz08559@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 1e94d6b3c7c9bad8acfe9a1e9fe1f34ee4354fa5 Author: Bartosz Golaszewski Date: Fri Nov 6 16:33:45 2026 +0100 gpio: virtuser: fix interrupt leak and UAF commit 24cafd9580627f9f066296f4a6ce1b282a3f425d upstream. When configuring interrupt handlers for GPIOs requested by virtual users, we never verify if an interrupt has been previously requested and just leak it if it was. We also never free the interrupts at device unbind. This is both a leak and a potential UAF bug. We use atomic_t for the irq field for now reason, it can't be modifying or read from atomic context. Let's repurpose the existing consumer_lock mutex and serialize access to the irq field. Let's add sanitization of input and schedule a tear-down action. Cc: stable@vger.kernel.org Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API") Closes: https://sashiko.dev/#/bug/linux-d8935133-0e80-487a-9e00-e748056f595e Link: https://patch.msgid.link/20261106-gpio-virtuser-irq-uaf-leak-v1-1-ce9772d8ad0d@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 364243e23da92e6bf9ad6e7d6580bfd92138ef2d Author: Bartosz Golaszewski Date: Thu Nov 5 14:14:27 2026 +0100 gpio: sodaville: fix use-after-free bug when registering the irqchip commit ab9102375b7c77e0c4d33c7594e514454dc9f2b3 upstream. In sdv_register_irqsupport(), if irq_domain_create_legacy() fails during device probing, a generic IRQ chip is left registered in the global gc_list while its underlying memory is freed, leading to a use-after-free. Use the managed variant of irq_setup_generic_chip() to ensure that the chip gets unregistered before the memory it uses is freed. Cc: stable@vger.kernel.org Fixes: 9381fc5d655d ("gpio: sodaville: Convert to use managed functions pcim_* and devm_*") Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9 Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20261105-gpio-sodaville-use-after-free-v1-1-f572f40feedd@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 00ffca4b5fdd99f72b5811dc5f954f3f49aaae31 Author: Bartosz Golaszewski Date: Tue Nov 10 11:10:40 2026 +0100 gpio: shared: fix a race in shared desc release path commit 53043b9e83cc7f4e30e70161b67ae93c4c9fdb87 upstream. gpiod_shared_put() races with concurrent calls to devm_gpiod_shared_get() like so: CPU 0 (unbind / probe failure) CPU 1 (concurrent proxy probe) ============================== ============================== gpiod_shared_put() kref_put(&entry->ref, ...) refcount_dec_and_test() // -> 0 devm_gpiod_shared_get() mutex_lock(&entry->lock); if (entry->shared_desc) { kref_get(&entry->ref); // on 0! shared_desc = entry->shared_desc; } mutex_unlock(&entry->lock); gpio_shared_release() mutex_lock(&entry->lock); kfree(shared_desc); entry->shared_desc = NULL; mutex_unlock(&entry->lock); // uses freed shared_desc Because gpiod_shared_put() decrements entry->ref without holding entry->lock and gpio_shared_release() only acquires entry->lock after the reference count has already reached zero, a concurrent call to devm_gpiod_shared_get() can acquire entry->lock in the intermediate window and observe a non-NULL entry->shared_desc. This can result in a use-after-free and a double-free when the second consumer releases its reference. Use kref_put_mutex() to ensure the entry lock is taken without a window in which a concurrent user can see a non-NULL entry->shared_desc while it's being released. Cc: stable@vger.kernel.org Closes: https://sashiko.dev/#/bug/linux-30e071e4-4e4a-4b63-bd83-df1147055d35 Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support") Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20261110-gpio-shared-refcnt-race-v2-1-8a0b76e01714@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit c800709a64dd3b137abbd1b5f9d271aa4cd4404e Author: Dmitry Torokhov Date: Thu Oct 29 11:58:15 2026 -0700 gpio: sa1100: defer GPIO chip registration to postcore_initcall commit 32c89e32b3fef2ee0aa5c4d0b0fb089bb20b3223 upstream. Registering the software node and the GPIO chip for the SA-1100 GPIO controller during early IRQ initialization causes boot hangs on SA-1100 platforms because the software node subsystem has not yet been initialized. At that early boot stage, attempting to register software nodes dereferences a NULL kset pointer before console or driver model initialization. Nothing on SA-1100 platforms requests GPIO lines via gpiolib during early boot before initcalls run; only the GPIO IRQ controller and domain must be initialized during init_IRQ(). Defer registering the software node, assigning its firmware node, and registering the GPIO chip with gpiolib to postcore_initcall, running after driver and gpiolib device initialization and before board consumers register. Fixes: e4671f292ebb ("gpio: sa1100: register software node for GPIO controller") Cc: stable@vger.kernel.org Reported-by: Guenter Roeck Closes: https://lore.kernel.org/r/2a561a27-a3bf-4cac-a4dc-bfbc5c859f45@roeck-us.net Signed-off-by: Dmitry Torokhov Tested-by: Guenter Roeck Link: https://patch.msgid.link/20261029-sa1100-swnode-fix-v1-1-112f4d83d191@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 5f651127a65fb08e75a4e2ef83172dfa2858aeae Author: Cunhao Lu <1579567540@qq.com> Date: Fri Oct 23 16:21:05 2026 +0800 gpio: rockchip: Fix debounce arithmetic for GPIO v2 commit 13467fd6998f5da4f5b4f172f1af3d9c48d5de8f upstream. The debounce interval calculations use unsigned long operands. On 32-bit systems, the numerator used to calculate the maximum interval overflows before division, while multiplying the requested interval by the clock rate overflows before it is assigned to a u64. A zero debounce clock rate also causes division by zero. Use 64-bit arithmetic for both calculations and reject a zero clock rate before division. At 32768 Hz, a 1 us request rounds to zero divider periods. Subtracting one then wraps the divider value to ULONG_MAX. Decrement only a nonzero rounded period count so that such requests use the smallest divider value. Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller") Cc: stable@vger.kernel.org Signed-off-by: Cunhao Lu <1579567540@qq.com> Link: https://patch.msgid.link/20261023-fix-rockchip-gpio-v2-debounce-v1-1-f1141bd5b58f@qq.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 61d76018afa4e1f8946a367fd4d3d84723dd8c1f Author: Bartosz Golaszewski Date: Thu Nov 5 14:37:52 2026 +0100 gpio: of: fix potential misconfiguration of hogged lines commit c62364eeac0f123478fca2f2d8e2424fdcd55032 upstream. In of_gpiochip_get_lflags() the local variable xlate_flags is declared without being initialized before its address is passed to of_xlate_and_get_gpiod_flags() when processing a devicetree gpio-hog child node. If a driver uses an of_xlate() callback that doesn't update the flags argument (like gpiochip_fwd_delay_of_xlate()) we'll end up passing that uninitialized value to of_convert_gpio_flags(), potentially misconfiguring the hogged GPIO. Initialize xlate_flags to 0. Cc: stable@vger.kernel.org Fixes: d1d564ec4992 ("gpio: move hogs into GPIO core") Closes: https://sashiko.dev/#/bug/linux-2bb44847-fd6e-406c-878d-9739da2cb8b5 Reviewed-by: Linus Walleij Reviewed-by: Mika Westerberg Link: https://patch.msgid.link/20261105-gpiolib-of-hog-uninitialized-v1-1-fcaeaccefab6@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 6e7540a1e3f26d7d4cf6b9c1a352c229327d373b Author: Wentao Liang Date: Wed Nov 4 02:53:45 2026 +0000 gpio: keep the chip reference when deferred setup fails commit 7e899fe007d2ffc753e6aa5bc8f2ae0a802b9e07 upstream. gpiochip_setup_devs() runs once gpiolib has been initialized and finishes the registration of the chips that were added before that. When the registration of such a chip fails, the function drops the reference taken in gpiochip_add_data_with_key() with gpio_device_put(), and only then logs the error through &gdev->dev. For these chips that reference is the last one, so gpiodev_release() frees gdev: the dev_err() dereferences freed memory, and the chip is still linked in gpio_devices, so the next lookup walks into the freed object as well. Here the registration cannot be undone the way gpiochip_add_data_with_key() does it, as the driver already got success from gpiochip_add_data() and will call gpiochip_remove(), which unlinks the chip and drops the reference. Keep the reference and only report the failure. Fixes: 16fdabe143fc ("gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()") Cc: stable@vger.kernel.org Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex Signed-off-by: Wentao Liang Link: https://patch.msgid.link/20261104025345.1527526-1-vulab@iscas.ac.cn Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 1526045b4fa863a72b16bc2e3ac9350ca13a53c9 Author: Guangshuo Li Date: Mon Oct 26 19:52:26 2026 +0800 gpio: brcmstb: fix UAF after IRQ domain setup failure commit baa14758afb3e2828de1f76511edc1de50216f39 upstream. When devm_request_irq() fails in brcmstb_gpio_irq_setup(), the error path removes the IRQ domain but leaves priv->irq_domain non-NULL. The probe error path subsequently calls brcmstb_gpio_remove(), which checks priv->irq_domain and attempts to access the already-freed domain through irq_find_mapping(). It also attempts to remove the domain again, resulting in a use-after-free and potentially further memory corruption. Set priv->irq_domain to NULL after removing it so that the common cleanup path skips the already-freed IRQ domain. This issue was found by our static analysis tool under development. Fixes: 0ba31dc201de ("gpio: brcmstb: consolidate interrupt domains") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Reviewed-by: Florian Fainelli Link: https://patch.msgid.link/20261026115227.41779-1-lgs201920130244@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 693e1b080f26112fe7b2fd30dc30c8d489fdc322 Author: Billy Tsai Date: Wed Nov 4 11:58:36 2026 +0800 gpio: aspeed: Preserve the pending G7 interrupt status on control writes commit 18cc1d1ad94df8a6760fff2617d3d6923550cba0 upstream. On G7 each line has its own control register, and its interrupt status bit (bit 12) is write-1-to-clear. aspeed_g7_reg_bit_set() updates a field by reading the control register, replacing that field and writing the value back. When the line's interrupt is pending, the status bit reads as 1 and is written back as 1, so updating an unrelated field such as the interrupt enable, trigger type, direction or debounce selection also clears the pending interrupt. Mask out the status bit when composing the value to write, so it is written as 1 only when the status field itself is being set to ack the interrupt. Fixes: b2e861bd1eaf ("gpio: aspeed: Support G7 Aspeed gpio controller") Cc: stable@vger.kernel.org Signed-off-by: Billy Tsai Reviewed-by: Andrew Jeffery Link: https://patch.msgid.link/20261104-gpio-aspeed-irq-status-v1-2-9805645f856d@aspeedtech.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 9b474ceea9313c26b3c908c7ad154b5dcf252a09 Author: Billy Tsai Date: Wed Nov 4 11:58:35 2026 +0800 gpio: aspeed: Clear only the acked line's G4 interrupt status commit 5d362564bd2982def7e80d7f1e756a97440c7adb upstream. The G4 interrupt status registers are write-1-to-clear: writing 0 to a bit has no effect and writing 1 clears that line's status flag. aspeed_gpio_irq_ack() clears a line's status through aspeed_g4_reg_bit_set(), which reads the bank's status register, sets the line's bit and writes the whole value back. That write clears every interrupt pending in the 32-line bank, not just the acked one. aspeed_gpio_irq_handler() reads each bank's status register once and dispatches the lines that were set. If another line in the same bank latches an edge after that read and before an ack in the bank, the ack clears its status and the handler is never called for it, so the edge is lost. Write only the line's own bit when clearing the interrupt status on G4. Fixes: 79fc9a2fcc45 ("gpio: aspeed: Create llops to handle hardware access") Cc: stable@vger.kernel.org Reported-by: Aaron Antone Suggested-by: Aaron Antone Signed-off-by: Billy Tsai Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Link: https://patch.msgid.link/20261104-gpio-aspeed-irq-status-v1-1-9805645f856d@aspeedtech.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 7524688d9f61b216b866f8761526b358313e7c35 Author: Ian Bridges Date: Sun Nov 8 12:20:10 2026 -0600 ksmbd: evaluate the DACL in order for explicit access requests commit 20bed0d6ff62d985fe8222958825504b8aad4e88 upstream. For requests without MAXIMUM_ALLOWED, smb_check_perm_dacl() selects one ACE instead of evaluating the DACL in order. When the selected ACE is a deny ACE, the function grants the complement of its mask, and deny ACEs before it are ignored. The selected ACE can also be inherit-only, unsupported, or an NFS mode ACE. Guest and anonymous sessions also match Authenticated Users. These bugs can grant read or write access that the stored DACL does not grant. For example, a deny of FILE_READ_DATA grants FILE_WRITE_DATA, and guests can read files granted only to Authenticated Users. Evaluate explicit requests in DACL order. Use exact SID matching for the caller, Everyone, Authenticated Users, OWNER RIGHTS and the caller's groups. Match Authenticated Users only for authenticated sessions, and ignore the NFS mode SID. An Authenticated Users ACE must still prevent the POSIX ACL fallback from replacing the DACL result for guest and anonymous sessions. The ACE does not grant them access. Keep the existing single-ACE behavior when a non-inherit-only object deny ACE is present because ksmbd does not parse those ACEs. Guest and anonymous sessions do not match Authenticated Users there either. MAXIMUM_ALLOWED behavior is unchanged. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Fixes: cc2f133e80eb ("ksmbd: fix maximum allowed access checks") Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit ad32dc49cc9676b654d3bb31b9002c3914f3cc6e Author: Zhao Li Date: Wed Oct 28 22:23:02 2026 +0800 wifi: mac80211: bound pending OCB station allocations commit ee1a5e92dba0a98cabe476c780e3af4f0ab88b27 upstream. Delaying the OCB station worker while frames arrive from new peers can retain an unbounded number of station allocations. The receive-side limit counts installed stations, while new allocations wait on incomplete_stations until process context inserts them. The list lock does not cover the interval between allocation and list insertion. Reserve one of 128 pending slots per interface before allocation. Release the reservation on allocation failure, after the worker inserts or frees the station, and when leave frees the pending list. LLM assistance was used to find the bug and review. Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142302.16634-3-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 8cc636e22fd5e9990041f0bdc19002eb37853606 Author: Zhao Li Date: Wed Oct 28 22:22:35 2026 +0800 wifi: mac80211: bound pending IBSS station allocations commit 3029ca2112d7bee4d3e3eadd02decdb3eddb9485 upstream. Delaying the IBSS station worker while frames arrive from new peers can retain an unbounded number of station allocations. The receive-side limit counts installed stations, while new allocations wait on incomplete_stations until process context inserts them. The list lock does not cover the interval between allocation and list insertion. Reserve one of 128 pending slots per interface before allocation. Release the reservation on allocation failure, after the worker inserts or frees the station, and when disconnect frees the pending list. LLM assistance was used to find the bug and review. Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142235.15428-3-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 98fcb857e0f1568b3ea72816fb782c8d45f96fb2 Author: Johannes Berg Date: Mon Nov 2 22:03:13 2026 +0100 wifi: mac80211: fix use-after-free on TTLM disconnect commit 4af2b71495a3f12196cbea1c9a502c62ada867be upstream. If ieee80211_process_adv_ttlm() disconnects, and some other changes were also detected in the beacon, the link update to the driver is still done, leading to use-after-free. Fix this by returning, like other functions, whether or not the update was accepted by the function. Cc: stable@vger.kernel.org Fixes: 702e80470a33 ("wifi: mac80211: support handling of advertised TID-to-link mapping") Reviewed-by: Benjamin Berg Link: https://patch.msgid.link/20261102220313.3cf5e709417b.I339967c7e614057253aa68c005d9ae220577f99a@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 0bcf1845aa318f8e3e01120da2d8014b5cfbe7be Author: Zhao Li Date: Wed Oct 28 22:21:23 2026 +0800 wifi: mac80211: restore dormant links when link updates fail commit bb22f3b2d8f8a2f883944f24678cf84e18b162e8 upstream. A failed MLO link update can leave the interface with the requested dormant-links bitmap instead of its previous one. This can disable active links or trigger a bitmap warning during rollback. The error path restores the old valid-links bitmap but passes the new dormant_links argument to ieee80211_set_vif_links_bitmaps(). Save the old dormant bitmap before changing link state and use it when restoring the old configuration. LLM assistance was used to find the bug and review. Fixes: 6d543b34dbcf ("wifi: mac80211: Support disabled links during association") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142123.13072-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit bf62f2ee974dee68b5a8ee43bc622a08b59ba09b Author: Zhao Li Date: Wed Oct 28 22:22:12 2026 +0800 wifi: mac80211: reject invalid EHT guard intervals in airtime estimates commit 582edbdbc5d288bd128b54935738fe38f15c8c29 upstream. An invalid EHT guard interval can select the wrong airtime group and, at 320 MHz, read beyond airtime_mcs_groups. Guard interval 3 advances EHT_GROUP_IDX() into the next bandwidth group at narrower widths. With one spatial stream and 320 MHz, it evaluates to 264, one past the 264-entry table. RX rate parsing rejects the value, but the common TX-status validator has no EHT check and last_rate_info can carry it to the airtime helper. Reject values above NL80211_RATE_INFO_EHT_GI_3_2 in the helper. This also protects exported ieee80211_calc_rx_airtime() callers that do not pass through the TX-status validator. LLM assistance was used to find the bug and review. Fixes: 3702a33216e6 ("wifi: mac80211: introduce EHT rate support in AQL airtime") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142212.14523-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit a78435626a427b46f2f88daeeef8e6fcf97bd896 Author: Zhao Li Date: Wed Oct 28 22:23:01 2026 +0800 wifi: mac80211: recheck the OCB station limit before insertion commit 27e29a077b4887d0e0a813337f8b7e06bd020c81 upstream. Frames from successive unknown OCB peers can make the deferred worker install more than 128 stations. The receive path checks local->num_sta before allocating each station, but pending stations are not included in that count. Several allocations can therefore pass before the worker inserts any of them, and the worker then drains the list without rechecking the limit. Recheck the installed-station limit in the worker under the wiphy mutex and free entries that no longer fit. LLM assistance was used to find the bug and review. Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142302.16634-2-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit b3858ee8c83c2c395cc7c179edd949c5fb6e4387 Author: Zhao Li Date: Wed Oct 28 22:22:34 2026 +0800 wifi: mac80211: recheck the IBSS station limit before insertion commit f7670bcdf650b37551a9c5d084521f877d939f11 upstream. Frames from successive unknown IBSS peers can make the deferred worker install more than 128 stations. The receive path checks local->num_sta before allocating each station, but pending stations are not included in that count. Several allocations can therefore pass before the worker inserts any of them, and the worker then drains the list without rechecking the limit. Recheck the installed-station limit in the worker under the wiphy mutex and free entries that no longer fit. LLM assistance was used to find the bug and review. Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142235.15428-2-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit a9a914f2cdb88d81d0baf7a14e83965c1920afee Author: Zhao Li Date: Wed Oct 28 22:21:01 2026 +0800 wifi: mac80211: recheck injected headers after removing FCS commit 339564c7ac50464695dfed847f89d118f4cc1dc5 upstream. Injecting a short frame with IEEE80211_RADIOTAP_F_FCS on a monitor interface can pass a truncated 802.11 header to transmit handlers. ieee80211_monitor_start_xmit() validates the linear 802.11 header before parsing radiotap. Radiotap parsing then removes the four-byte FCS without rechecking the remaining header length. Software encryption can subtract the larger header length and pass the resulting negative length as an unsigned size. Recheck the required linear header length after pulling the radiotap header and before handing the frame to the transmit path. Require at least addr1, which the transmit path reads even for extension frames whose header is shorter. LLM assistance was used to find the bug and review. Fixes: bddc0c411a45 ("mac80211: Fix NULL ptr deref for injected rate info") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142101.11994-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 4c3b4edb0c962b5823f9d4131af464602b2cf68c Author: Zhao Li Date: Wed Oct 28 22:17:08 2026 +0800 wifi: mac80211: drain link readers before stopping removed links commit 745f5d04395dfc4c311f443c7c04ccb00c436984 upstream. Removing an MLO link can leave work queued on its link container after the container is freed. ieee80211_tear_down_links() stops each link before the RCU grace period. A reader that fetched the link earlier can therefore queue work after ieee80211_link_stop() has canceled it. ieee80211_request_smps() and ieee80211_csa_finish() can both reach this window. Record each removed link while removing its keys and debugfs state. Wait for RCU readers, then stop the recorded links so cancellation includes work queued by those readers. Free the detached keys after the grace period as before. LLM assistance was used to find the bug and review. Fixes: efe9c2bfd1a8 ("wifi: mac80211: isolate driver from inactive links") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028141708.5532-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit e96cb97a9fd6a213be25b119993ab931751d1f60 Author: Zhao Li Date: Mon Oct 26 23:26:54 2026 +0800 wifi: mac80211: fix use-after-free when MLO link setup is rolled back commit a155ef2ef79531c139244289c5b8f15c05d16a0e upstream. Rolling back an MLO link addition can free link containers while RCU readers still hold pointers to them. ieee80211_vif_update_links() publishes new links before checking for duplicate addresses and calling drv_change_vif_links(). If either fails, it restores the old pointers and frees the new containers without waiting for readers. During a non-MLO to MLO transition, the published link 0 replaces the deflink, so existing link 0 users can acquire the new container. Readers such as ieee80211_csa_finish() and ieee80211_obss_color_collision_notify() can also queue work embedded in the link. If they queue after ieee80211_link_stop() cancels that work, it remains queued when the container is freed. Wait for RCU readers after restoring the old pointers and before stopping the new links, so their work is queued before it is cancelled. Fixes: d3e2439b0f33 ("wifi: mac80211: fix link manipulation") Cc: stable@vger.kernel.org # 7.2.x Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261026152654.80697-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 4cd0196332264d1a7ad8228bfceaa697d342f5c9 Author: Wahid Khan Date: Thu Nov 5 02:44:50 2026 +0530 wifi: cfg80211: don't truncate the merged MBSSID profile length commit 3ea152f3f77eeffc37b2f4423688b4df9136f90c upstream. cfg80211_parse_mbssid_data() keeps the length of a non-transmitted BSSID profile in a u8. cfg80211_merge_profile() returns a size_t, and it concatenates a profile that is split over several Multiple BSSID elements, so the merged length can be well above 255 even though every single sub-element is at most 255 bytes long. The value is then cut to its low 8 bits. A 300 byte profile is handled as a 44 byte one: the elements after the cut are lost from the generated non-transmitted BSS, and if the Multiple BSSID-Index element lies past the cut the BSS is dropped altogether. Any AP in range can send such a profile. The multi-link code further down in the same file already uses a signed size type for the profile length. Do the same here, cfg80211_find_ie() and cfg80211_gen_new_ie() take a size_t anyway. Fixes: fe806e4992c9 ("cfg80211: support profile split between elements") Cc: stable@vger.kernel.org Signed-off-by: Wahid Khan Link: https://patch.msgid.link/20261104211451.693451-1-wahidzk0091@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit d9f3d27e6fc1c699cc2aa2f2e84e15d666fc8df2 Author: Zhao Li Date: Wed Oct 28 22:21:49 2026 +0800 wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers commit 9083da9dd3223068237395432323b407012aec1f upstream. A malformed mesh A-MSDU subframe with a declared payload length near 65535 bytes can pass validation against a much shorter aggregate. ieee80211_amsdu_subframe_length() adds the mesh control length to the declared length in a u16, and ieee80211_is_valid_amsdu() stores the result in a u16 local. The sum therefore wraps before either walker compares it with the remaining aggregate length. The decomposer then splits and delivers the malformed aggregate instead of rejecting it. Keep the computed length in unsigned int in both the helper and the validator so oversized subframes cannot wrap. LLM assistance was used to find the bug and review. Fixes: 6e4c0d0460bd ("wifi: mac80211: add a workaround for receiving non-standard mesh A-MSDU") Fixes: fe4a6d2db3ba ("wifi: mac80211: implement support for yet another mesh A-MSDU format") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142149.13834-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 342e2daafbdad3016e730ed1979c000a66138635 Author: Zhao Li Date: Wed Oct 28 22:17:31 2026 +0800 wifi: cfg80211: release rejected nontransmitted BSS reference commit f3c45d5b741a7d7586e639c2f55d2557029f2e1a upstream. Repeated MBSSID reports without an SSID can leak BSS entries outside the scan cache, where the BSS entry limit cannot account for them. __cfg80211_bss_update() returns a referenced BSS. If adding it to the transmitting BSS list fails, unlinking drops the cache reference, but the caller reference is lost when res is cleared. Release the caller reference before discarding the unlinked BSS. LLM assistance was used to find the bug and review. Fixes: 0b7808818cb9 ("wifi: cfg80211: fix BSS refcounting bugs") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028141731.6185-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit c532cf12ce975387c6b41f0d31a058afb105c6de Author: Tristan Madani Date: Wed Oct 28 01:26:20 2026 +0000 wifi: nxpwifi: validate scan response TLV sizes before indexed access commit bcc5bbaa6de61a0ccaa57228ca233b4390eca27e upstream. The scan response handler indexes into TSF and channel-band TLV arrays using a loop counter derived from the number of BSS entries, but never checks whether the TLV data is large enough. A firmware response with fewer TLV entries than BSS entries leads to reads past the TLV buffer. Add bounds checks that verify each indexed access falls within the TLV's declared length before dereferencing. Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani Signed-off-by: Jeff Chen Signed-off-by: Greg Kroah-Hartman commit cbe0b78863a4b5ddff9aeb441798ca24e0dfe693 Author: Zhao Li Date: Wed Oct 28 22:17:50 2026 +0800 wifi: mac80211_hwsim: ignore non-generic netlink releases commit 989f47c56e48d442d79497a25ed946d029c4dc53 upstream. Closing an unrelated netlink socket can remove mac80211_hwsim radios or clear the active wmediumd registration when its port ID matches a generic netlink socket. mac80211_hwsim_netlink_notify() handles every NETLINK_URELEASE event, but netlink port IDs are scoped by protocol. The notifier therefore treats a release from another protocol as a MAC80211_HWSIM socket release. Ignore release notifications unless they come from NETLINK_GENERIC. LLM assistance was used to find the bug and review. Fixes: 7882513bacb1 ("mac80211_hwsim driver support userspace frame tx/rx") Fixes: e9ed49bf4c2c ("mac80211-hwsim: Add support for HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028141751.6728-2-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman commit 5833c82f123bd35e117e00e52135fe3dfd63007c Author: Mehmet Fide Date: Mon Oct 5 09:22:08 2026 +0200 wifi: ath9k_htc: do not start ANI before the first channel is set commit dda63dd136ba2bc3b297079b190ac81a0aea40ae upstream. ath9k_htc_add_interface() starts ANI for the first AP interface, before any channel is configured. The per-channel calibration data only gets attached by the first ath9k_htc_set_channel() that is not a fast channel change, and that same call cancels the ANI work a few milliseconds after add_interface, so normally the work never runs. When the bring-up stalls for more than the 100 ms ANI poll interval in between, it does run, and ar9002_hw_per_calibration() records the IQ calibration result in the calibration data that does not exist yet: Unable to handle kernel NULL pointer dereference at virtual address 00000008 PC is at ar9002_hw_calibrate+0x1f8/0x570 [ath9k_hw] Workqueue: phy0 ath9k_htc_ani_work [ath9k_htc] Seen about once per thousand AP starts with an AR9271 on a Cortex-A5 board that starts hostapd while still booting; a 500 ms delay after add_interface reproduces it on every start. The crashed work never completes, so the next cancel_delayed_work_sync() blocks for good. Drop the start; it has nothing to calibrate against and is cancelled anyway. The TSF adjust bit that shared its condition is now set for every AP interface, which is harmless: the next reset applies it. The next patch starts ANI once the interface beacons. Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode") Cc: stable@vger.kernel.org Signed-off-by: Mehmet Fide Acked-by: Toke Høiland-Jørgensen Link: https://patch.msgid.link/20261005072209.4101009-2-mehmet.fide@gmail.com Signed-off-by: Jeff Johnson Signed-off-by: Greg Kroah-Hartman commit 52d116a102af04f9b57d4e46424c2553cc4609fe Author: Benoit Masson Date: Mon Sep 28 23:33:22 2026 +0200 wifi: ath12k: assign device id from the WSI index commit 81986a81f09fae73926c7c44863b335880269c90 upstream. Devices of a hardware group are added to ag->ab[] in PCI probe completion order (ab->device_id = ag->num_probed++), which is not stable across boots. The wiphy radio array is built from ag->ab[] and the wiphy device is taken from its first entry, so the wiphy sysfs path and the mapping of radio indices to bands change on every boot. Persisted wireless configurations reference radios by index (e.g. OpenWrt/hostapd "radio0"), so such a configuration attaches to a random band at each boot. This affects any multi-chip group with single-band radios, e.g. TP-Link Archer BE800 (three QCN9274/QCN9224 radios in one group). Store each ab in ag->ab[] at its wsi_info.index, which is derived from the device tree WSI ring and is therefore deterministic. ag->num_probed remains the group device counter. The unassign path is unchanged, it already indexes ag->ab[] by ab->device_id. Suggested-by: Rameshkumar Sundaram Fixes: 6f245ea0ec6c ("wifi: ath12k: introduce device group abstraction") Cc: stable@vger.kernel.org # 6.14+ Signed-off-by: Benoit Masson Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20260928213322.98949-1-yahoo@perenite.com Signed-off-by: Jeff Johnson Signed-off-by: Greg Kroah-Hartman commit 8a9e361a91947163dfbb797191c3fe6e0da19abe Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:29:13 2026 +0900 tracing/probes: Reject array count on non-dereference string sources commit 0941144ebeaf3ce46c80711f00e935921eb28b21 upstream. The runtime array loop (FETCH_OP_LP_ARRAY) for string types requires a preceding memory dereference instruction so it can advance the pointer address on each iteration. Non-dereference string sources such as $comm, immediate strings, and eprobe event fields cannot be indexed as pointer arrays, but finalize_fetch_insn() still accepts an array count on them and emits an invalid FETCH_OP_LP_ARRAY sequence. Reject string array counts when the preceding operation is not a memory dereference. Link: https://lore.kernel.org/all/179455855309.403392.4197028577158545202.stgit@devnote2/ Fixes: 40b53b771806 ("tracing: probeevent: Add array type support") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit d3e79cf2c45986699e29a5f45d160c381b643e83 Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:29:04 2026 +0900 tracing/probes: Fix user-space dereference string array store type commit 2721573e6c6faaba2e31f352f2c02ec5f3ecf5e9 upstream. When finalizing a string array argument (e.g. +0u(%reg):string[N]), finalize_fetch_insn() advances the instruction pointer to a new slot for the store operation before checking whether the preceding operation was FETCH_OP_UDEREF. As a result, user-space dereference string arrays with type "string" emit FETCH_OP_ST_STRING (kernel memory read) instead of FETCH_OP_ST_USTRING. Check for FETCH_OP_UDEREF before advancing the instruction pointer. Link: https://lore.kernel.org/all/179455854396.403392.18073771811100192405.stgit@devnote2/ Fixes: e65f7ae7f4da ("tracing/probe: Support user-space dereference") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit f93952e7f861e4f4642342790b8bda25e7e722cc Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:36 2026 +0900 tracing/probes: Fix missing BTF kind checks in char pointer/array helpers commit c1e2c63e65421068566db3dde44dfd4fe7adb46d upstream. In struct btf_type, the type ID and byte size share a union, and only BTF_KIND_INT types are followed by a 32-bit integer encoding word. Because btf_type_is_char_ptr() and btf_type_is_char_array() do not verify that the outer type is BTF_KIND_PTR or that the resolved element type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF types can have their byte size misinterpreted as a BTF type ID, and arrays of non-integer types read out-of-bounds or misinterpret trailing BTF metadata as BTF_INT_* encoding bits. Validate the BTF type kinds and NULL pointers before reading inner type metadata in both helpers. Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/ Fixes: 27973e5c64b9 ("tracing/probes: Add string type check with BTF") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 75376ee10548e0767984205fccd98eb1108b2bf9 Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:27 2026 +0900 tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write commit 9b6e9d6a11090ac34516c45f48663b37ac94a9b1 upstream. BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the preceding store instruction only allocates and writes the field's fetch type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime, fetch_apply_bitfield() performs an 8-byte read-modify-write on the smaller ring buffer slot, corrupting adjacent ring buffer data or writing past the end of the event record. In addition, signed bitfields with bit widths other than 8/16/32/64 fail to resolve a fetch type, bitfields whose width is a multiple of 8 inside a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield offsets >= 8 bits are not folded into the byte offset, and big-endian architectures use the little-endian left-shift formula in parse_btf_bitfield(). Compute the bitfield byte and bit offsets consistently during field lookup, select the smallest unsigned fetch type that covers the bit offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from the selected fetch type size for both big- and little-endian bitfields. Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/ Fixes: c440adfbe302 ("tracing/probes: Support BTF based data structure field access") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 8509af16509ad833bcd2b446fc63174162a82873 Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:18 2026 +0900 tracing/probes: Enable newly appended probe when target event is enabled commit 72d3a5cb0cd7335553549aaffecc683e3ecc0c43 upstream. Unlike kprobe events, fprobe and uprobe events only register their underlying probes when the trace event is enabled. When a new probe is appended to an existing multiprobe fprobe or uprobe event that is already enabled, the appended probe is linked into the event's probe list without being registered. As a result, the newly appended probe never fires until the event is disabled and re-enabled. Moreover, disabling an fprobe event calls unregister_fprobe() on the unregistered fprobe, and opening or closing a perf event on an enabled uprobe event dereferences a NULL tu->uprobe in uprobe_apply(). Register and enable the newly appended fprobe or uprobe immediately when the target event is already enabled. Link: https://lore.kernel.org/all/179455849798.403392.135678786198324285.stgit@devnote2/ Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support") Fixes: 2db832ec9090 ("tracing: fprobe-events: Register fprobe-events only when it is enabled") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 138c77234bc14f6edfb7a373f81ddfaf9941a739 Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:09 2026 +0900 tracing/probes: Check enabled and busy state before unlinking sibling probes commit f1d9b7a3fe99b4228acdbab3c744c29f7ffe86ef upstream. When a multiprobe event is enabled or referenced (for example, by an eprobe, trigger, or open tracefs file) and a user attempts to delete the event or one of its probes via dynamic_events, checking trace_probe_has_sibling() before the enabled and busy checks allows the first probe to be unlinked and freed while the event is still active, only returning -EBUSY on the last sibling probe. For uprobe events, unlinking and freeing an enabled sibling probe without unregistering its uprobe_consumer also causes a use-after-free. Ensure all four probe types (kprobe, fprobe, uprobe, and eprobe) verify that the event is neither enabled nor busy before unlinking any sibling probe. Link: https://lore.kernel.org/all/179455848898.403392.17675270675769076596.stgit@devnote2/ Fixes: ca89bc071d5e ("tracing/kprobe: Add multi-probe per event support") Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support") Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit dc814f47555a1c9bedbf0f6ad80d9978f39eac57 Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:54 2026 +0900 tracing/eprobe: Disallow attaching eprobes to fprobe events commit 92d9fa0ed69e1f724feed908bd0a462a42df4b88 upstream. Event probes (eprobes) are not allowed to attach to other dynamic probe events (kprobes, uprobes, and eprobes) to avoid recursive probe chains and lifecycle dependencies. However, when fprobe events were introduced, TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in find_and_get_event(), allowing eprobes to attach to fprobe and tprobe events. Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event(). Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/ Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 576e96b3193b467e497054c1d6073660ee836f1b Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:28:45 2026 +0900 tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() commit a0f836eea463d4c468edb58eedb03911c9c0791d upstream. Because the kernel is built with -funsigned-char, plain 'char' is unsigned on all architectures. Reading 1-byte signed trace event fields via *(char *)addr in get_event_field() therefore zero-extends instead of sign-extending negative s8 values. Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when reading event fields. Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/ Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit e268bbe66a871052a8164b604f71ce41e7cb3fce Author: Masami Hiramatsu (Google) Date: Fri Nov 13 17:29:22 2026 +0900 tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create() commit c15120853eebbda98f3fe1f1e59370439c6c4447 upstream. When generating a default event name in __trace_uprobe_create(), tail is allocated with kstrdup() without __free(kfree). If the subsequent kmalloc() for buf fails, the function returns -ENOMEM immediately and leaks tail. Declare tail with __free(kfree) so it is automatically freed on all exit paths. Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/ Reported-by: Sashiko Closes: https://lore.kernel.org/all/sashiko-outbox-204240@kernel.org/ Fixes: 97e8230f89a3 ("tracing: uprobe-event: Allocate string buffers from heap") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit dcdd4b9f5dcf9a76d5792a4ea83fb1798f847327 Author: Paolo Bertinetti Date: Tue Nov 3 13:07:48 2026 +0000 tracing/perf: Clear stop state in perf_trace_add() commit fb3f6b21b04f1e8b8982e90e9bf62db9f0dcb5e4 upstream. Since commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"), __perf_event_overflow() stops the event with pmu->stop() and disables it when the PERF_EVENT_IOC_REFRESH limit is reached. When userspace re-arms the event with PERF_EVENT_IOC_REFRESH, the event is enabled again and pmu->add() is called with PERF_EF_START. perf_trace_add() sets PERF_HES_STOPPED when PERF_EF_START is missing, but never clears it. The flag set by pmu->stop() stays, and perf_tp_event_match() drops every later hit. A tracepoint, kprobe or uprobe event re-armed this way delivers only its first overflow. This breaks self-profilers such as async-profiler, and the "Event re-armed with PERF_EVENT_IOC_REFRESH" perf test fails: 1000 events, count 1, 1 overflows (1 POLL_HUP), re-arm errno 0 Tracepoint event : FAILED! Set the state from PERF_EF_START on every add, as perf_swevent_add() does. Fixes: 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage") Closes: https://lore.kernel.org/r/20261021131006.2101248-1-nigro.fra@gmail.com/ Reported-by: Francesco Nigro Assisted-by: LLM Signed-off-by: Paolo Bertinetti Signed-off-by: Peter Zijlstra (Intel) Link: https://github.com/async-profiler/async-profiler/issues/1813 Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103130732.764081-2-paolobertinetti200f4@proton.me Signed-off-by: Greg Kroah-Hartman commit ca4d17c452543a2814b68435ce6bd3b321b2823d Author: Tao Cui Date: Tue Nov 10 17:20:42 2026 +0800 LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT commit 422e532809572ba1043192bf6a0c653bc68b3140 upstream. KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT has no guard against repeated invocation: every call overwrites pch_pic_base and registers the same kvm_io_device on the MMIO bus at the new base address, while the kvm_pch_pic_destroy() unregisters only one bus range. After a repeated init, MMIO to the stale ranges computes its register offset against the new base address and silently reads 0 / drops writes, and the leftover bus entries persist until the VM is destroyed. Reject repeated initialization with -EEXIST, using the initialized state of the kvm_io_device as the indicator. The check, the MMIO base update and the bus registration are serialized by slots_lock, and the real registration error is propagated instead of being replaced with -EFAULT. On a registration failure the base addr and the device state are rolled back so that a retry can start over. Cc: stable@vger.kernel.org Fixes: d206d9514873 ("LoongArch: KVM: Add PCHPIC user mode read and write functions") Reviewed-by: Bibo Mao Signed-off-by: Tao Cui Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit bf8c767d539f12bada9ba5089b2d1d60ce00aa58 Author: Tao Cui Date: Tue Nov 10 17:20:39 2026 +0800 LoongArch: KVM: Propagate real error code in kvm_pch_pic_create() commit 20f3bf3d3dce16f43b82881293586ce7d73982b6 upstream. The real error code of kvm_setup_default_irq_routing() is replaced by kvm_pch_pic_create() with a fixed -ENOMEM. Return the actual error code, as kvm_eiointc_create() already does; while the kvm_ipi_create() case is fixed separately by "Return the actual error code in kvm_ipi_create()" (Chaithanya Lagisetty). Cc: stable@vger.kernel.org Fixes: e785dfacf7e7 ("LoongArch: KVM: Add PCHPIC device support") Reviewed-by: Bibo Mao Signed-off-by: Tao Cui Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit 31fd58c1a228369d78fdb0f69d667a67d5a73d67 Author: Tao Cui Date: Tue Nov 10 17:20:39 2026 +0800 LoongArch: KVM: Clear device pointer in irqchip destroy callbacks commit a9ce1a00afb0402668877d37c04ffd0e53d48832 upstream. The destroy callbacks of the four irqchip devices free the device structure without clearing kvm->arch.{ipi,eiointc,pch_pic,dmsintc}, leaving a dangling pointer. ops->destroy() is not only called at VM teardown but also when KVM_CREATE_DEVICE succeeds and the following anon_inode_getfd() fails (e.g. under RLIMIT_NOFILE); the VM stays alive, kvm_arch_irqchip_in_kernel() still reports true, and interrupt injection dereferences the freed device. Clear the pointer when destroying. Cc: stable@vger.kernel.org Fixes: c532de5a67a7 ("LoongArch: KVM: Add IPI device support") Fixes: 2e8b9df82631 ("LoongArch: KVM: Add EIOINTC device support") Fixes: e785dfacf7e7 ("LoongArch: KVM: Add PCHPIC device support") Fixes: 229132c309d6 ("LoongArch: KVM: Add DMSINTC device support") Reviewed-by: Bibo Mao Signed-off-by: Tao Cui Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit 29d7ef8d2905b5cf014a71d86aa913010f62ae1b Author: Mike Rapoport (Microsoft) Date: Tue Nov 10 17:20:30 2026 +0800 LoongArch: Restore KFENCE pages through DMW on resume commit 40d7a3e63c3d88b43e9115d23d9937dd506bbd02 upstream. With KFENCE enabled, resume from hibernation triggers KFENCE reports while swsusp_asm_resume() copies the image pages, for example: BUG: KFENCE: use-after-free write in swsusp_asm_resume+0x20/0x94 Use-after-free write at 0x00000000a57ee925 (in kfence-#254): swsusp_asm_resume+0x20/0x94 hibernation_restore+0x128/0x1a0 load_image_and_restore+0x6c/0xc8 software_resume+0x240/0x260 do_one_initcall+0x68/0x200 kernel_init_freeable+0x26c/0x304 kernel_init+0x20/0x134 ret_from_kernel_thread+0x24/0x1d0 ret_from_kernel_thread_asm+0xc/0x98 During resume from hibernation, the image pages that occupy physical pages used by the restore kernel are first loaded into free pages and then, as the very last step, swsusp_asm_resume() copies them to their final location pointed to by pbe->orig_address, which the hibernation core sets to page_address() of the page in the restore kernel. The early KFENCE pool is allocated from memblock and normally occupies the same physical pages in the restore kernel and in the image kernel, so these pages are usually copied by swsusp_asm_resume(). The KFENCE pool is remapped into the KFENCE area above vm_map_base and set_page_address() adjusts page->virtual so that page_address() returns the page-table mapped alias rather than the DMW virtual address of the pool pages. Hence, pbe->orig_address of KFENCE pages points to that alias and swsusp_asm_resume() writes them through the page tables. But: * the copy loop overwrites the kernel page tables, so a TLB refill for the KFENCE alias may use a partially restored page table * the KFENCE pool pages that are protected in the restore kernel fault in the middle of the copy Convert pbe->orig_address to DMW addresses before starting the copy. Cc: stable@vger.kernel.org Fixes: 0ca84aeaee15 ("LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE") Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit fe2eb6d0b0d07c0d2202c336808805e7940c4a2b Author: Jinjie Ruan Date: Tue Nov 10 17:20:29 2026 +0800 LoongArch: kexec_file: Fix elf_headers memory leak in retry loop commit 065dd1636abef6b9962fd5af82accac69850bbe8 upstream. A retry allocates new elf headers and overwrites image->elf_headers, leaking the previous buffer. Free it before assigning here. Cc: stable@vger.kernel.org Fixes: 55d990f0084c ("LoongArch: Add EFI binary support for kexec_file") Link: https://sashiko.dev/#/patchset/20260729031235.2840255-1-ruanjinjie%40huawei.com Signed-off-by: Jinjie Ruan Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit 7d648013e06e0d18c4005ab591c19fde7e5f61fd Author: Jinjie Ruan Date: Tue Nov 10 17:20:29 2026 +0800 LoongArch: kexec_file: Fix a modified cmdline leak commit b7000844b374a1ab75f0cc561f1d4d321cd6eeb0 upstream. machine_kexec_prepare() copies it to KEXEC_CMDLINE_ADDR and overwrites the pointer. Free the heap buffer after the copy here. Cc: stable@vger.kernel.org Fixes: d162feec6b6e ("LoongArch: Add preparatory infrastructure for kexec_file") Signed-off-by: Jinjie Ruan Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit e03983c656114cca8eb8df8ac4598a7ff504bc0a Author: Tiezhu Yang Date: Tue Nov 10 17:20:30 2026 +0800 LoongArch: BPF: Make use of beqz and bnez for trampoline branches commit 6dd070681326ef2fef5e008b8c3d0ae9634de222 upstream. Currently, the implementation for BPF trampoline branches does not match the existing technical comments. The code uses larch_insn_gen_beq, where the comment indicates beqz should be used. While the BPF trampoline size is restricted within a single memory page (at most 64KB on LoongArch) and cannot cross the original 16-bit branch offset limit of the reg2i16 format, switching to the beqz instruction (which belongs to the reg1i21 format) avoids explicitly specifying the zero register during dynamic JIT encoding, resulting in cleaner assembly generation. While at it, also apply the same optimization to the bne instruction by replacing it with bnez and adding a corresponding comment. Cc: stable@vger.kernel.org Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit 7ee855dbc2d4f786b1011c5b3414980b0ca683e9 Author: Tiezhu Yang Date: Tue Nov 10 17:20:30 2026 +0800 LoongArch: BPF: Make arena support depend on 128-bit cmpxchg commit 9496832b824ab5f570c86d65e3b6f08163e6908b upstream. When testing bpf selftest "jit_insns/cast_to_user", there are different behaviors on different Loongson machines. (1) Loongson-3A6000 $ sudo ./test_progs -a jit_insns/cast_to_user ... Summary: 1/1 PASSED, 0 SKIPPED, 0/0 FAILED (2) Loongson-3A5000 $ sudo ./test_progs -a jit_insns/cast_to_user ... libbpf: map 'arena': failed to create: -ENOMEM run_subtest:FAIL:unexpected_load_failure unexpected error: -12 (errno 12) ... Summary: 0/0 PASSED, 0 SKIPPED, 1/1 FAILED This is because the arena range tree uses kmalloc_nolock() API, which requires 128-bit atomic cmpxchg. This feature is provided by not only hardware SCQ extension but also assembler support on LoongArch. On CPUs without the SCQ extension, or if the older versions of assembler do not support the sc.q instruction, arena map creation fails with a misleading -ENOMEM error. Since system_has_cmpxchg128() and arch_cmpxchg128() are only available when CONFIG_AS_HAS_SCQ_EXTENSION is enabled (need assembler support), we guard bpf_jit_supports_arena() with an #ifdef block to preserve compile- time robustness first, and then safely return system_has_cmpxchg128() if defined, otherwise falling back to false. This ensures that arena map creation cleanly fails with a -EOPNOTSUPP on the systems without either the assembler support or the hardware SCQ extension. With this patch, here is the test result on Loongson-3A5000 without SCQ extension: $ sudo ./test_progs -a jit_insns/cast_to_user ... libbpf: map 'arena': failed to create: -EOPNOTSUPP run_subtest:FAIL:unexpected_load_failure unexpected error: -95 (errno 95) ... Summary: 0/0 PASSED, 0 SKIPPED, 1/1 FAILED It is better to mark the test status as SKIPPED rather than logging a false-alarm failure if the feature is not supported, but this belongs to a separate bpf selftest patch. This is similar to commit 536b523b4073 ("bpf, riscv: Make arena support depend on ZACAS"). Note that BPF should not depend on a SLUB debug-mode escape hatch, so no need to consider the slub_debug exception. Cc: stable@vger.kernel.org Fixes: 4fdb5dd8aeba ("LoongArch: BPF: Implement bpf_addr_space_cast instruction") Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman commit 600269bdd8ba81e105b8306b79251e8b0a624dbd Author: Michail Andreas Michalopoulos Date: Tue Nov 10 02:58:13 2026 +0700 ksmbd: refuse reauthentication of an expired session as another user commit 265709f9dc271693d1a261a62242db652fcc471d upstream. When a Kerberos session expires, its owner can reauthenticate it. For an NTLM reauthentication, ntlm_authenticate() only compares the new user with sess->user when the session is still valid. An expired session is in SMB2_SESSION_IN_PROGRESS during the reauthentication, so it takes the other branch and simply sets sess->user to the new user: - the session's open files, tree connects and other state, created under the original user's identity, now belong to whichever user just authenticated, and a later Kerberos reauthentication is compared against that user rather than the original one; - the original struct ksmbd_user is overwritten without being freed. krb5_authenticate() already refuses a different user in this case, and the valid-session branch of ntlm_authenticate() does too. Do the same for an expired session: compare with the existing user and refuse a different one with -EKEYREJECTED, freeing the newly looked-up user either way. An AI assistant was used to find and fix this and as an independent reviewer. Fixes: a47634cd729b ("ksmbd: expire SMB sessions when Kerberos tickets expire") Cc: stable@vger.kernel.org Signed-off-by: Michail Andreas Michalopoulos Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit b5338d8ce0bd5c32c979b523943b278372c641c6 Author: Ian Bridges Date: Mon Nov 9 20:33:44 2026 -0600 ksmbd: keep group denials when a POSIX ACL entry decides access commit b0af9a3e6b1534d353ca6ac23caaf46127f62e4a upstream. When no ACE names the caller, Everyone or Authenticated Users, smb_check_perm_dacl() lets a POSIX ACL entry for the caller decide access. The entry's rights replace the result of the DACL walk. Deny ACEs for the caller's groups, and OWNER RIGHTS for the owner, are then lost. For example, a deny of FILE_WRITE_DATA for one of the caller's groups should refuse writes. A POSIX ACL entry that gives the caller write access still lets the caller write. Remove the requested rights that those ACEs deny from the entry's rights. The DACL walk already records them in grp_denied. Fixes: 42ac1f1917ae ("ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261102200353.884509-1-icb%40fastmail.org Link: https://sashiko.dev/#/patchset/20261103150458.11591-1-icb%40fastmail.org Link: https://sashiko.dev/#/patchset/20261107062233.1579198-1-icb%40fastmail.org?part=1 Link: https://sashiko.dev/#/patchset/20261107231941.1824289-1-icb%40fastmail.org?part=1 Link: https://sashiko.dev/#/patchset/20261108182011.1888520-1-icb%40fastmail.org?part=1 Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit cd5bb08d0d791d9db1fcb9e0a6ae855803e66aaf Author: Ian Bridges Date: Wed Nov 4 12:58:04 2026 -0600 ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow commit 42ac1f1917ae678ee2c47f415ab844af03bbd46b upstream. smb_check_perm_dacl() does not match ACEs for the caller's Unix groups and refuses an owner named only by OWNER RIGHTS. These callers cannot use rights the DACL grants them under MS-DTYP 2.5.3.2. Match Unix group SIDs (S-1-22-2) against the caller's credentials. Use the ordered DACL result when the existing SID lookup and POSIX ACL fallback do not decide access. In that result, deny ACEs for the caller's groups limit what it grants, also for MAXIMUM_ALLOWED. Count only the exact OWNER RIGHTS SID in that result, since compare_sids() also matches shorter and longer SIDs, and return only file access rights. Preserve the refusal for non-inherit-only object deny ACEs, which ksmbd does not parse. MAXIMUM_ALLOWED still excludes group allow ACEs. Including them requires corresponding changes in smb2_open() to avoid breaking existing opens. An open relying on group grants can therefore still fail when it requests a maximal access reply. For the owner, that reply leaves out the rights of its groups. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit dc2e83f9cf217bad996ecff04e7d742af825e12f Author: Weiming Shi Date: Sun Nov 8 08:11:49 2026 -0800 sctp: reset stored flag for each association commit 173712d868eb20628ad82deb07f6829a68a9e064 upstream. sctp_send_asconf_del_ip() walks every association on an endpoint. The stored flag records that the current association took the single-homed deferral path and therefore did not allocate an ASCONF chunk. It is currently scoped to the whole function. Once one association sets it, later eligible multihomed associations allocate chunks but skip sctp_send_asconf(), leaking each chunk and its skb. Reset stored for every association so only an association taking the deferral path skips transmission. In an A/B kmemleak test, the vulnerable kernel reported 210 leaked objects from this call path and the fixed kernel reported none. Cc: stable@vger.kernel.org Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host") Reported-by: Xiang Mei Signed-off-by: Weiming Shi Acked-by: Xin Long Link: https://patch.msgid.link/20261108161149.2774119-1-bestswngs@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 61e2c2f02f60aeaeb92cc2c6610ad3d0bb14b16f Author: Tim Budding Date: Wed Nov 4 21:02:23 2026 -0800 sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED commit 3097fba868019924e92b8786ebd473992565f015 upstream. When an I-FORWARD-TSN skips the message being partially delivered on a stream, sctp_intl_skip() passes the MID from the I-FORWARD-TSN to the PARTIAL_DELIVERY_ABORTED notification as pdapi_seq. That MID is the highest one skipped on the stream, so when more than one message is skipped, the notification names a later message instead of the one whose partial delivery was aborted. Report the MID being partially delivered, sin->mid_uo or sin->mid, instead. Reproduced on an unmodified kernel with the pdapi and pdapi_uo tests of the sctp_ifwdtsn.sh selftest added later in this series, which pass with this fix. Reproduction and fix done with AI assistance. Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave") Reported-by: Sashiko Closes: https://lore.kernel.org/all/179293012867.3134.16497481637722705271@kernel.org/ Cc: stable@vger.kernel.org Signed-off-by: Tim Budding Acked-by: Xin Long Link: https://patch.msgid.link/20261105050225.49292-3-tim.budding@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 19dd36cab64a42c0136097a66df579bc75e1030a Author: Tim Budding Date: Wed Nov 4 21:02:24 2026 -0800 sctp: fix I-FORWARD-TSN handling of fragments on other streams commit 5b9cfc6491a6e32e7315dc222992c7dbd5baa3e9 upstream. sctp_report_iftsn() incorrectly frees queued I-DATA fragments in two cases. First, it drops any queued fragments with TSN less than or equal to the New Cumulative TSN. This prevents reconstruction of messages still being received on other streams and can fully block an ordered stream. Second, it calls sctp_intl_abort_pd() if the New Cumulative TSN equals the highest TSN seen. This check exists for association resets but can be inadvertently triggered by any I-FORWARD-TSN that arrives before data with a higher TSN, causing data loss and, if a partial delivery is in progress on an ordered stream, an aborted association. Fix the first by freeing fragments from sctp_intl_skip() based on stream, U bit, and MID instead of TSN. Fix the second by moving the call to sctp_intl_abort_pd() from sctp_report_iftsn() to the corresponding reset handlers. Observed in real use as unexpected message loss. Reproduced on an unmodified kernel with the sctp_ifwdtsn.sh selftest added later in this series, which passes with this fix. Reproduction and fix done with AI assistance. Fixes: 47b20a88566f ("sctp: implement report_ftsn for sctp_stream_interleave") Cc: stable@vger.kernel.org Signed-off-by: Tim Budding Acked-by: Xin Long Link: https://patch.msgid.link/20261105050225.49292-4-tim.budding@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit ec2ac1a70f22c6372410803bfd65e63632841d4f Author: Andrey Misiurov Date: Fri Nov 6 20:51:26 2026 +0100 sctp: fix ASCONF address change on single-homed hosts commit 5175b2fb34c77cf2cd56a290affa45412cb3a228 upstream. Commit 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in DEL-IP processing") refuses a DEL-IP of the transport the ASCONF was located by, so that a later wildcard DEL-IP cannot use it after free. This also breaks the single-homed address change (RFC 5061 5.3.2). The host sends [Address Parameter L] [ADD-IP S] [DEL-IP L], the association is located by L, and DEL-IP L is now refused. The sender never gets an all-success ASCONF-ACK, keeps src_out_of_asoc_ok set and stops sending data, so the association stalls. Fix the wildcard DEL-IP instead: look up the transport of the packet source rather than reusing asconf->transport. Both DEL-IP paths can now free asconf->transport, and chunks bundled after the ASCONF still use it, so point it at a surviving transport: the packet source for the wildcard delete, the primary path for a plain one. Found by manual code inspection while reviewing a backport of commit 9b2854f86f0b; reproduced on a two-namespace single-homed renumber. Fixes: 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in DEL-IP processing") Cc: stable@vger.kernel.org Signed-off-by: Andrey Misiurov Acked-by: Xin Long Signed-off-by: Dave Miller Signed-off-by: Greg Kroah-Hartman commit c313c69888e056928ceda19bc8000363e4172334 Author: Kyle Zeng Date: Fri Nov 6 19:05:32 2026 -0800 sctp: avoid requeueing pending control chunks commit 665b4149e91b781a71bce8637c3a4d7d64dba05f upstream. The T4 and RE-CONFIG timeout handlers take a reference to their cached control chunk and submit it through SCTP_CMD_REPLY. A previous transmission can still be on the control outqueue when output is corked or suppressed, or when sctp_packet_transmit_chunk() could not append the chunk. sctp_outq_tail() then adds the same list node a second time. Re-adding a non-tail entry can corrupt the list without being caught by the insertion-time list checks. A subsequent flush or association teardown can access an already freed chunk. The ASCONF path is reproducible by an unprivileged SCTP socket owner in a user/network namespace, with KASAN reporting a use-after-free in __sctp_outq_teardown(). Check sctp_chunk_pending() in both timeout handlers before taking the extra reference and issuing SCTP_CMD_REPLY. If the chunk is already linked, leave the existing entry for normal output processing. Keep the remaining timer and error-handling commands unchanged. This also covers RE-CONFIG retransmission after sctp_assoc_rm_peer() moves the request to another transport and starts its timer. The issue was found by an LLM. Fixes: 2e3216cd54b1 ("sctp: Follow security requirement of responding with 1 packet") Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer") Cc: stable@kernel.org Suggested-by: Xin Long Signed-off-by: Kyle Zeng Acked-by: Xin Long Link: https://patch.msgid.link/20261107030532.32310-1-kylebot@openai.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 3a8d8da414b34b1bdfa470fe83ab3d0cbba63cca Author: Tim Budding Date: Wed Nov 4 21:02:22 2026 -0800 sctp: abort unordered partial delivery when its message is skipped commit 05852c8b70f2291a50bb3f740a66ce9caf9cb98d upstream. When an I-FORWARD-TSN skips unordered messages on a stream, sctp_intl_skip() only aborts the stream's unordered partial delivery if the MID being delivered is lower than the skipped MID. If the skipped message is the one being partially delivered, partial delivery stays in progress: no PARTIAL_DELIVERY_ABORTED is sent, and the next unordered message on the stream is delivered as the rest of the abandoned one. Abort the partial delivery when the MID being delivered is at or below the skipped MID, as the ordered case already does. Reproduced on an unmodified kernel with the uo_pd test of the sctp_ifwdtsn.sh selftest added later in this series; its partial delivery checks pass with this fix. Reproduction and fix done with AI assistance. Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave") Cc: stable@vger.kernel.org Signed-off-by: Tim Budding Acked-by: Xin Long Link: https://patch.msgid.link/20261105050225.49292-2-tim.budding@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit f6bcfe0ac0e091d8f1bb5a50480903aed3b88382 Author: Kuba Piecuch Date: Wed Nov 4 11:14:39 2026 +0000 sched_ext: Read exit_kind before flushing in scx_flush_disable_work() commit 3133107d98057595c0af39ff907c852134926912 upstream. scx_disable_workfn() sets exit_kind to SCX_EXIT_DONE before it tears the scheduler down. scx_flush_disable_work() reads exit_kind after syncing disable_irq_work and flushing disable_work, so it can observe DONE from a disable_work that was queued after its flush and return while the teardown is still running: CPU A CPU B ----- ----- scx_vexit() scx_claim_exit() -> true bpf_struct_ops_map_link_detach() bpf_scx_unreg() scx_disable() scx_claim_exit() -> false scx_flush_disable_work() irq_work_sync() // not queued kthread_flush_work() // not queued irq_work_queue() scx_disable_irq_workfn() kthread_queue_work() scx_disable_workfn() exit_kind = SCX_EXIT_DONE scx_root_disable() atomic_read() -> SCX_EXIT_DONE bpf_map_put() Once bpf_scx_unreg() returns, its caller drops the struct_ops map reference, and the struct_ops trampolines can be freed while scx_root_disable() is still running and can still call into the BPF scheduler, e.g. ops.exit(). Read exit_kind before syncing and flushing, with acquire ordering paired with the atomic_try_cmpxchg() in scx_disable_workfn(). DONE is only set from disable_work, so once it is observed, the following kthread_flush_work() sees the queued work and waits for the teardown to finish. This patch was created with the help of an AI coding assistant. Fixes: d99f7a32f09d ("sched_ext: Fix scx_flush_disable_work() UAF race") Cc: stable@vger.kernel.org # v7.1+ Reported-by: Sashiko Closes: https://lore.kernel.org/all/sashiko-outbox-195908@kernel.org/ Signed-off-by: Kuba Piecuch Reviewed-by: Andrea Righi Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit fa1fe5bfbb63ba37bb4ca88bea15d43f7b850054 Author: Tejun Heo Date: Sat Oct 31 07:05:40 2026 -1000 sched_ext: Factor out drain_offline_rq() commit 1826e5aa068cf6c21791773f160b4a2ce5d5f9a5 upstream. Factor drain_offline_rq() out of rq_offline_scx() so that the drain can move to handle_hotplug() in the following patch, which removes the rq_online and rq_offline hooks. The drain is the rescue flush and the re-enqueue of an offline cpu's tasks onto its local DSQ. No functional change. Cc: stable@vger.kernel.org # v6.12+ Signed-off-by: Tejun Heo Reviewed-by: Andrea Righi Signed-off-by: Greg Kroah-Hartman commit b88438530ee3978b1d3f24576c4f508be2b30b82 Author: Tejun Heo Date: Sat Oct 31 06:28:03 2026 -1000 sched_ext: Fix stale pick when the donor changes during dispatch commit 9ce6fca02867911ba79bc3664219effe8c7be8f4 upstream. Dispatch takes rq->donor as @prev and can drop the rq lock. With proxy execution, @prev may not be the running task, and another CPU can reset the donor to rq->curr meanwhile, through proxy_needs_return() on a wakeup or sched_proxy_block_task() on a class or scheduler change. The wakeup case: 1. dispatch_one() drops the rq lock, e.g. to move a task from another CPU. 2. Another CPU wakes the donor, which proxy execution migrated to this CPU. proxy_needs_return() dequeues it and resets the donor to rq->curr, and the wakeup enqueues it, possibly on another CPU. 3. dispatch_one() sees @prev queued and returns SCX_DSP_PREV. 4. do_pick_task_scx() returns @prev, and this CPU runs a task that is queued on another rq. Under core scheduling, the core pick runs dispatch for the sibling rqs with each sibling's donor as @prev, and a sibling can switch @prev out while dispatch has the lock dropped. Whatever dispatch concluded, and whatever it does with @prev after the drop, is about a task the rq no longer owns, whether it keeps @prev running or hands it to ops.dispatch(). rq_modified_above() catches the change only when rq->curr is in a class above ext, and the dl_server pick skips that check. dispatch_core_pick() retries after a lock drop, but by then dispatch has used @prev. Restart the pick when @prev is no longer the donor. dispatch_one() tests after each step that can drop the lock, and scx_dispatch_sched() decides per ops.dispatch() call whether to hand @prev over, which also covers a class or scheduler change across a drop. With proxy execution alone, the donor only ever changes to rq->curr during a pick, so the retried pick can't go stale again. Under core scheduling, the restart goes through the core pick, which already retries after any lock drop. 7a3a6bfbd62a ("sched: Rework prev_balance() to avoid stale prev references") closed the same window in prev_balance() by reading rq->donor instead of taking @prev. That doesn't work here, as dispatch never evaluated the new donor, which may not even be a sched_ext task. Verified with synthetic reproducers for both cases. v2: Also cover rq lock drops inside dispatch (sashiko). v3: Don't keep a stale @prev after ops.dispatch() (sashiko). v4: Also cover a sibling switching @prev out under core scheduling. Retitle. Fixes: 7b0888b7cc19 ("sched_ext: Implement core-sched support") Fixes: c6fe97c34a1a ("sched: Allow enabling proxy exec with sched_ext") Cc: stable@vger.kernel.org # v6.12+ Signed-off-by: Tejun Heo Reviewed-by: Andrea Righi Signed-off-by: Greg Kroah-Hartman commit 0f816aeb3884db9bcd55ce64df98c29e72919eee Author: Seiji Nishikawa Date: Wed Nov 4 11:20:04 2026 +0900 sched/core: Do not touch SMT siblings that have not joined the core yet commit ec6f6731538e0d45872eb279fdeb477bed152d6f upstream. When a CPU comes online, it is added to cpu_smt_mask() of its siblings before sched_core_cpu_starting() sets its rq->core to the core leader. For example, on x86, ap_starting() calls set_cpu_sibling_map() first, and calls notify_cpu_starting() after that. This order is intended. Before sched_core_cpu_starting() runs, rq->core of the new CPU still points to its own rq. But rq->core_enabled of the new CPU is already set. __sched_core_flip() sets it for all possible CPUs, also for offline CPUs, and CPU offline does not clear it. So __rq_lockp() of the new CPU returns its own rq->__lock. It does not return the core wide lock. If a sibling CPU runs pick_next_task() for SCHED_CORE at this time, it checks all CPUs in cpu_smt_mask(). It calls update_rq_clock() and pick_task() for the rq of the new CPU. But it holds only its own core lock, not the lock of the new CPU. Then lockdep shows this warning in update_rq_clock(). debug_locks && !(lock_is_held(&(__rq_lockp(rq))->dep_map) != 0) WARNING: kernel/sched/sched.h:1666 at update_rq_clock+0x40a/0xd20 kernel/sched/core.c:875, CPU#0: syz-executor251/5712 Call Trace: pick_next_task kernel/sched/core.c:6375 [inline] __schedule+0x1c69/0x6920 kernel/sched/core.c:7199 preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:7606 The next loops in pick_next_task() also change rq_i->core_pick of this rq, and can call resched_curr() for it, without its lock. resched_curr() has the same lockdep_assert_rq_held() check. __sched_core_account_forceidle() also checks all CPUs in the same mask. CPU offline does not have this problem. remove_siblinginfo() and sched_core_cpu_dying() both run in take_cpu_down() under stop_machine. So no sibling CPU can be in pick_next_task() at that time. Fix this. In these loops, skip a sibling CPU if its rq->core is different from our rq->core. At run time, rq->core of a CPU is changed by sched_core_cpu_starting(), sched_core_cpu_deactivate() and sched_core_cpu_dying(). The first two hold sched_core_lock(), and sched_core_lock() takes the rq locks of all CPUs in the SMT mask. The last one runs under stop_machine, as written above. So while we hold our core lock, the result of this check does not change. A CPU that is not in the core yet will pick its own tasks. The comment in the reschedule loop of pick_next_task() already expects this case. I tested this with the syzbot C reproducer in QEMU. The two vCPUs were SMT siblings (-smp 2,sockets=1,cores=1,threads=2). Without this patch, the warning came after about 100 seconds. Just before the warning, a debug print showed that the loop on CPU 0 saw CPU 1 with rq->core pointing to CPU 1 itself, and cpu_online() was false for CPU 1. With this patch, the same state still happened, but there was no warning in more than 2 hours. Fixes: 3c474b3239f1 ("sched: Fix Core-wide rq->lock for uninitialized CPUs") Closes: https://syzkaller.appspot.com/bug?extid=681e729b2cf0d4860042 Reported-by: syzbot+681e729b2cf0d4860042@syzkaller.appspotmail.com Signed-off-by: Seiji Nishikawa Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261104022004.3810619-1-snishika@redhat.com Signed-off-by: Greg Kroah-Hartman commit cc587b7f9a44b46ba2d531642fb7c3dae72ebfc0 Author: Andrea Parri Date: Mon Nov 2 14:46:05 2026 +0100 sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() commit f7141257dd67d4936f906a6cfd1d0007721f6898 upstream. A sched_setattr() with SCHED_FLAG_KEEP_POLICY on a SCHED_DEADLINE task unlocks cpuset_mutex twice if the task's policy changes concurrently: WARNING: bad unlock balance detected! 7.4.0-rc1 #1 Not tainted ------------------------------------- repro/126 is trying to release lock (cpuset_mutex) at: [] __sched_setscheduler+0x9cc/0xc40 but there are no more locks to release! ... Call Trace: print_unlock_imbalance_bug.part.0+0xfb/0x110 lock_release+0x286/0x2e0 __mutex_unlock_slowpath+0x1a/0x400 __sched_setscheduler+0x9cc/0xc40 __x64_sys_sched_setattr+0xa3/0x1b0 do_syscall_64+0x106/0x5f0 entry_SYSCALL_64_after_hwframe+0x77/0x7f __sched_setscheduler() samples p->policy before taking any lock, and restarts from the recheck label if p->policy differs under the rq lock. The restart drops cpuset_mutex but leaves cpuset_locked set, so a pass that no longer needs the mutex still unlocks it on its way out: CPU 1 CPU 2 __sched_setscheduler(KEEP_POLICY) policy = p->policy /* DEADLINE */ __sched_setscheduler(SCHED_OTHER) p->policy = SCHED_OTHER cpuset_locked = true cpuset_lock() rq = task_rq_lock(p) oldpolicy != p->policy cpuset_unlock() goto recheck /* no cpuset_lock() this time */ ... if (cpuset_locked) cpuset_unlock() Without CONFIG_DEBUG_MUTEXES, or CONFIG_DEBUG_RT_MUTEXES on PREEMPT_RT, nothing warns. The second unlock still clears the owner field regardless of who holds the mutex, so another task can lose cpuset_mutex inside its critical section. Entering SCHED_DEADLINE needs CAP_SYS_NICE, but a racing caller that owns the task does not need it if it samples a policy other than SCHED_DEADLINE. Clear cpuset_locked when dropping the mutex for the restart. This should be safe because the flag is only tested on the paths leaving the next pass, after that pass has set it again if it took the mutex. The following program, run as root, reproduces the splat, which no longer appears with this applied. On PREEMPT_RT it crashes the kernel within seconds, which this also fixes: #define _GNU_SOURCE #include #include #include #include struct attr { uint32_t size, policy; uint64_t flags; int32_t nice; uint32_t prio; uint64_t runtime, deadline, period; }; static volatile int stop; static volatile pid_t target; static void set(struct attr a) { a.size = sizeof(a); syscall(SYS_sched_setattr, target, &a, 0); } static void *sleeper(void *arg) { target = syscall(SYS_gettid); while (!stop) usleep(1000); return arg; } static void *switcher(void *arg) { while (!stop) { /* SCHED_DEADLINE, 2us every 1s */ set((struct attr){ .policy = 6, .runtime = 2000, .deadline = 1000000000, .period = 1000000000 }); set((struct attr){ .policy = 0 }); /* SCHED_OTHER */ } return arg; } static void *racer(void *arg) { /* KEEP_POLICY | KEEP_PARAMS */ while (!stop) set((struct attr){ .flags = 0x18 }); return arg; } int main(void) { pthread_t t[5]; int i; pthread_create(&t[0], NULL, sleeper, NULL); while (!target) usleep(100); pthread_create(&t[1], NULL, switcher, NULL); for (i = 2; i < 5; i++) pthread_create(&t[i], NULL, racer, NULL); sleep(30); stop = 1; for (i = 0; i < 5; i++) pthread_join(t[i], NULL); return 0; } An LLM helped find the PREEMPT_RT crash and write this patch and its test. Fixes: 111cd11bbc54 ("sched/cpuset: Bring back cpuset_mutex") Reported-by: Sashiko Signed-off-by: Andrea Parri Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Waiman Long Reviewed-by: Kayra Cizmeci Reviewed-by: Juri Lelli Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20261016062629.2102883-1-sh_def%40163.com Link: https://patch.msgid.link/20261102134606.242743-1-parri.andrea@gmail.com Signed-off-by: Greg Kroah-Hartman commit a5cb23398072e259872414091b05be17aec7c7e6 Author: Andrea Parri Date: Mon Nov 2 14:48:30 2026 +0100 sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE commit 8127ec8458df29bd702db602473042ccb9e619b9 upstream. sched_setattr() accepts sched_util_min and sched_util_max values that do not fit in uclamp_se::value. A single thread can do: sched_setattr(max = 800) returns 0 sched_setattr(min = 0xfffffffe) returns 0 sched_getattr() min=2046 max=800 which leaves the minimum above both SCHED_CAPACITY_SCALE and the task's own maximum. The range check in uclamp_validate() relies on the + 1 wrapping -1, the reset value, to 0: if (util_min + 1 > SCHED_CAPACITY_SCALE + 1) That only works for an unsigned type. util_min and util_max are int and SCHED_CAPACITY_SCALE is a long, so every negative value passes the check, and so does INT_MAX, whose + 1 wraps. uclamp_se_set() then truncates what got through to the 11 bits of uclamp_se::value, but computes the bucket from the full value. A minimum of 0xfffff800 is stored as 0 in the top bucket, where uclamp_rq_max_value() takes it for the highest active clamp once a higher value leaves the rq. The rq clamp falls below what the remaining tasks requested, and emptying their bucket trips the WARN_ON_ONCE() in uclamp_rq_dec_id(), without any privilege: WARNING: kernel/sched/core.c:1862 at dequeue_task+0x2a3/0x2b0, CPU#0: repro/126 Call Trace: __schedule+0x933/0x1320 schedule+0x36/0x100 do_nanosleep+0x61/0x190 hrtimer_nanosleep+0xb5/0x1d0 Make util_min and util_max unsigned int, so that -1 is the only value that wraps. The pair check below is unaffected, since it skips -1 explicitly and anything else is at most SCHED_CAPACITY_SCALE by then. Requests that were only accepted because of this now fail with -EINVAL. The following program triggers the warning when run by any user outside a child cpu cgroup. With this applied, its 0xfffff800 request fails with -EINVAL and the warning no longer appears: #define _GNU_SOURCE #include #include #include #include #include #include struct attr { uint32_t size, policy; uint64_t flags; int32_t nice; uint32_t prio; uint64_t runtime, deadline, period; uint32_t util_min, util_max; }; static volatile int stop; static void set_min(uint32_t v) { /* KEEP_POLICY | KEEP_PARAMS | UTIL_CLAMP_MIN */ struct attr a = { .size = sizeof(a), .flags = 0x38, .util_min = v }; syscall(SYS_sched_setattr, 0, &a, 0); } static void burn(long us) { struct timespec s, n; clock_gettime(CLOCK_MONOTONIC, &s); do clock_gettime(CLOCK_MONOTONIC, &n); while ((n.tv_sec - s.tv_sec) * 1000000 + (n.tv_nsec - s.tv_nsec) / 1000 < us); } static void *bogus(void *arg) { set_min(0xfffff800); while (!stop) burn(1000); return arg; } static void *worker(void *arg) { long v = (long)arg; set_min(v); while (!stop) { burn(v == 800 ? 300 : 1500); usleep(100); } return arg; } int main(void) { pthread_t t[3]; cpu_set_t c; int i; CPU_ZERO(&c); CPU_SET(0, &c); sched_setaffinity(0, sizeof(c), &c); pthread_create(&t[0], NULL, bogus, NULL); usleep(50000); pthread_create(&t[1], NULL, worker, (void *)500L); pthread_create(&t[2], NULL, worker, (void *)800L); sleep(15); stop = 1; for (i = 0; i < 3; i++) pthread_join(t[i], NULL); return 0; } An LLM helped find the warning and write this patch and its tests. Fixes: 480a6ca2dc6e ("sched/uclamp: Allow to reset a task uclamp constraint value") Reported-by: Sashiko Signed-off-by: Andrea Parri Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20261016062629.2102883-1-sh_def%40163.com Link: https://patch.msgid.link/20261102134831.243255-1-parri.andrea@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0de1819f8ce2a89b746aa277c4db7c6e7157229a Author: Andrea Parri Date: Mon Nov 2 14:54:19 2026 +0100 sched/deadline: Fix spurious -EPERM for migration-disabled tasks commit 6616bffa9b52da1338cf8bff9882404e02b9e361 upstream. sched_setattr() can refuse to make a task SCHED_DEADLINE with -EPERM, even though the task's affinity covers the whole root domain. A retry can succeed, but the error blames an affinity the task does not have. __sched_setscheduler() tests p->cpus_ptr, which is not always the task's affinity. When a task is scheduled out inside a migrate_disable() section, migrate_disable_switch() points p->cpus_ptr at the current CPU until migrate_enable(). On PREEMPT_RT every spinlock_t holder is in such a section, so ordinary kernel work opens the window. Elsewhere, seccomp filters run in one. Test p->cpus_mask instead, which keeps the task's affinity and is what sched_getaffinity() reports. This should be safe because an admitted task's cpus_mask covers the root domain, so set_cpus_allowed_dl() moves no bandwidth when migrate_enable() restores p->cpus_ptr. The following program, run as root, had 553679, 453720 and 424623 of its 1000000 requests refused on three boots of a 4-CPU PREEMPT_RT guest, and 236182, 217174 and 237183 without PREEMPT_RT. With this applied the count is 0, also with lockdep, and a task pinned to one CPU is still refused: #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #define REQUESTS 1000000 #define INSNS 300 struct attr { uint32_t size, policy; uint64_t flags; int32_t nice; uint32_t prio; uint64_t runtime, deadline, period; }; static volatile int stop; static volatile pid_t target; static long set(struct attr a) { a.size = sizeof(a); return syscall(SYS_sched_setattr, target, &a, 0); } static void *worker(void *arg) { struct sock_filter f[INSNS + 1]; struct sock_fprog prog = { .len = INSNS + 1, .filter = f }; int i; /* Reading the arguments keeps seccomp from caching the result */ for (i = 0; i < INSNS; i++) f[i] = (struct sock_filter) BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, args)); f[INSNS] = (struct sock_filter) BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW); syscall(SYS_seccomp, SECCOMP_SET_MODE_FILTER, 0, &prog); target = syscall(SYS_gettid); while (!stop) syscall(SYS_getppid); return arg; } static void *hog(void *arg) { while (!stop) ; return arg; } int main(void) { pthread_t t[9]; long refused = 0; int i; pthread_create(&t[0], NULL, worker, NULL); while (!target) usleep(100); for (i = 1; i < 9; i++) pthread_create(&t[i], NULL, hog, NULL); for (i = 0; i < REQUESTS; i++) { /* SCHED_DEADLINE, 2us every 1s */ if (set((struct attr){ .policy = 6, .runtime = 2000, .deadline = 1000000000, .period = 1000000000 }) && errno == EPERM) refused++; set((struct attr){ .policy = 0 }); /* SCHED_OTHER */ } stop = 1; for (i = 0; i < 9; i++) pthread_join(t[i], NULL); printf("%ld of %d requests refused\n", refused, REQUESTS); return 0; } An LLM helped find this bug and write this patch and its test. Fixes: af449901b84c ("sched: Add migrate_disable()") Signed-off-by: Andrea Parri Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Sebastian Andrzej Siewior Acked-by: Juri Lelli Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261102135420.244745-1-parri.andrea@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6a2743fa47f00fc77548c302e756b903b79fe5f8 Author: Stefan Haberland Date: Thu Nov 12 11:26:08 2026 +0100 s390/dasd: Don't trust userspace-supplied result field in format check commit 7cc2dda4f7aaf596c1796184649007151ff98f8d upstream. BIODASDCHECKFMT used to copy the entire format_check_t struct from userspace, including the result/unit/rec/num_records/blksize/ key_length fields that are output fields only. dasd_eckd_format_evaluate_tracks() relies on cdata->result being zero to decide whether to apply an index correction (i--/pos--) after a successful check. A caller that pre-sets result to a non-zero value can suppress that correction, leaving pos advanced past the last valid entry; the (partially out-of-bounds) fmt_buffer[pos] fields are then copied back to userspace, leaking heap contents. Only expect is an Input field; copy just that member in and zero the rest of cdata. Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT") Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com Cc: stable@vger.kernel.org #4.7 Reviewed-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://patch.msgid.link/20261112102608.1057852-5-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit 0896dfa705da176eb8dee01e9e7861e886f166d5 Author: Stefan Haberland Date: Thu Nov 12 11:26:07 2026 +0100 s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path commit df56f7a6c20a5eb2794c0a7391bde50ba7c8c54b upstream. dasd_eckd_build_check_tcw() allocates its request with dasd_fmalloc_request(), but its out_err path frees it with dasd_sfree_request(). The latter uses a different pool and therefor, leading to invalid pointer arithmetic and a crash. Use the matching dasd_ffree_request() instead. The same error path also leaves start_priv->count incremented without ever decrementing it again. This leaks a permanent reference on every build failure. Decrement it before freeing the request. Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT") Cc: stable@vger.kernel.org #4.7 Reviewed-by: Jan Höppner Signed-off-by: Stefan Haberland Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes") Link: https://patch.msgid.link/20261112102608.1057852-4-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit d1b94e3313c13f64cdd695398aee9a63b694cd8c Author: Stanislav Aleksandrov Date: Sun Nov 8 03:59:55 2026 +0000 hwmon: (max31760) Report 0 RPM before the first fan speed measurement commit 33d58cbf2ab26bda81bc3052158d8b9867d5b9a6 upstream. The tachometer count registers initialize to 0 until the first measurement cycle completes after power-on. To prevent division by zero, tach_to_rpm() clamped tach == 0 to 1, causing it to compute and report 3,000,000 RPM (60 * 100000 / 1 / 2). Return 0 RPM when tach == 0 instead. Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver") Cc: stable@vger.kernel.org Signed-off-by: Stanislav Aleksandrov Link: https://patch.msgid.link/20261108-max31760-fixes-v1-3-a61450463059@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 1166d76df51468c8f4d42b2f6d6d8495d3e6a21e Author: Stanislav Aleksandrov Date: Sun Nov 8 03:59:54 2026 +0000 hwmon: (max31760) Leave standby mode at probe commit 95bddc5252a4c0a2ed9d62e7e53a3461265d9603 upstream. The driver never clears the standby bit (CR2_STBY) during probe. While max31760_resume() clears this bit on resume, probe only configured CR2_ALERTS. If the chip was left in standby (for example, by boot firmware or a previously running OS before a warm reboot), it remains in standby: temperature sensing, fan speed counting, and PWM output are halted. This occurs on the Samsung Galaxy XR, where the bootloader places the chip in standby during boot. Clear CR2_STBY alongside setting CR2_ALERTS in probe. Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver") Cc: stable@vger.kernel.org Signed-off-by: Stanislav Aleksandrov Link: https://patch.msgid.link/20261108-max31760-fixes-v1-2-a61450463059@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 0be7cc208346ac9f35e1fdac1b18ef6fb3e82ec6 Author: Stanislav Aleksandrov Date: Sun Nov 8 03:59:53 2026 +0000 hwmon: (max31760) Fix the local temperature limit registers commit 028ed93145d9be88eee670088ef13482b5d36c1a upstream. temp2_max and temp2_crit use each other's registers, so reading them shows the local limits swapped and writing temp2_max changes the overtemperature (SHDN) threshold. Use the high limit (0x0C) for temp2_max and the overtemperature limit (0x08) for temp2_crit. Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver") Cc: stable@vger.kernel.org Signed-off-by: Stanislav Aleksandrov Link: https://patch.msgid.link/20261108-max31760-fixes-v1-1-a61450463059@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 21363e64cb4d39f99399c11e221333d991ea6f08 Author: Sudeep Holla Date: Mon Nov 9 15:19:27 2026 +0000 hwmon: (scmi) Configure sensors before exposing channels commit 68af85b730f9a9e5f66c96ba861a66da08cfa5a9 upstream. SCMI hwmon enables sensors with SENSOR_CONFIG_SET, but only after registering the hwmon device and only for temperature sensors. This leaves other sensor classes disabled on firmware that defaults sensors to off, and exposes temperature channels before they are ready. Configure each supported sensor while building the channel list, before registering the hwmon device. Leave failed sensors out of the list so their channels remain hidden, while continuing with other sensors. Cc: Marek Vasut Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-4bdf9a68-22d5-4305-b684-f11fe6d1dbcc Fixes: 72804d1631b3 ("hwmon: (scmi) Enable sensors to assure they can be read") Cc: stable@vger.kernel.org Signed-off-by: Sudeep Holla Link: https://patch.msgid.link/20261109151927.1672956-2-sudeep.holla@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit ddc362970d4c280555f92c97f23b6c308bd33600 Author: Xu Rao Date: Mon Nov 9 16:28:54 2026 +0800 hwmon: (scmi) Enable temperature sensors using their sensor IDs commit 3ae1af2faad93276645d7620261643457daec73b upstream. scmi_hwmon_probe() groups sensors by hwmon type, so the index in scmi_sensors->info[hwmon_temp] is not necessarily the SCMI sensor ID. Passing that index to config_set() targets a different sensor if the platform exposes non-temperature sensors ahead of temperature sensors. The intended temperature sensor can remain disabled, causing subsequent readings to fail. If configuring the wrong sensor fails, thermal registration of the intended sensor is also skipped. Use the firmware sensor ID, as the read and thermal registration paths already do, so temperature sensors are enabled correctly. The patch was reviewed and the commit message expanded with OpenCode AI assistance. Fixes: 72804d1631b3 ("hwmon: (scmi) Enable sensors to assure they can be read") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao Reviewed-by: Sudeep Holla Link: https://patch.msgid.link/AED18609B941BCFD+20261109082854.3739085-1-raoxu@uniontech.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 8b9614c6a337cbf5345b64f231d1b43b768c3480 Author: Sudeep Holla Date: Mon Nov 9 15:19:26 2026 +0000 hwmon: (scmi) Check channel config allocation commit a2996d892d0150d059d39c683d95d6fd7a37630a upstream. scmi_hwmon_add_chan_info() can fail to allocate a channel's config array. Ignoring that error leaves a channel with a NULL config pointer in the hwmon chip info, which hwmon dereferences while registering the device. Check the helper's return value and abort probe on failure. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-d10ced6b-a6f0-403b-9619-f5a6573f9e7f Fixes: b23688aefb8b ("hwmon: add support for sensors exported via ARM SCMI") Cc: stable@vger.kernel.org Signed-off-by: Sudeep Holla Link: https://patch.msgid.link/20261109151927.1672956-1-sudeep.holla@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 5a0553e668169800fdc30040beca6d1be168c79c Author: Pablo Mazzini Date: Sun Nov 8 09:35:59 2026 +0000 hwmon: (sy7636a) fix negative temperatures commit fc8519fab34e162b0c29dacccf73031820878917 upstream. The thermistor readout is a signed 8-bit value in degrees Celsius. Fixes: de34a4053250 ("hwmon: sy7636a: Add temperature driver for sy7636a") Cc: stable@vger.kernel.org Signed-off-by: Pablo Mazzini Link: https://patch.msgid.link/20261108093602.329554-3-pmazzini@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit a0fd06bd754e30b6b8da6cc7df6e1eb365303922 Author: Felix Radensky Date: Thu Nov 5 21:32:00 2026 +0200 hwmon: (pmbus/mp2975) Get vout fault limits dynamically commit 00944852275efd39706fe7b9ce75c28edde983eb upstream. The over- and under-voltage fault limits of the tracking mode are relative to the voltage reference, which follows the VID/AVS requests issued to the device and therefore changes at runtime. The driver reads the voltage reference once during probe and derives the limits from that snapshot, which the PMBus core caches in addition. As a result in2_crit and in2_lcrit reflect the operating point at probe, rather than the thresholds the device enforces. On systems where the device supplies the CPU core voltage, in2_crit was reported anywhere between 1.15V and 1.70V across identical systems, causing false over-voltage reports once the CPU voltage exceeded the value latched at probe. Read the voltage reference and the over-voltage offset selector whenever a limit is requested, and mark both limits with pmbus_set_update(), so that the core does not cache them. The voltage reference is available on page 3 only. Let the core change the page, so that the page it caches matches the device, except for a single rail configuration, for which the core does not issue PAGE commands, and the page is changed directly. With the selector read at runtime, a device configured with an unsupported selector no longer fails to probe. The OVP1 threshold, which does not depend on the selector, is reported for it instead, with a warning. Clamp the under-voltage limit to zero, since the offset can exceed a low voltage reference, while a negative value would be reported as a read error. Fixes: 2c6fcbb21149 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller") Cc: stable@vger.kernel.org Signed-off-by: Felix Radensky Reviewed-by: Vadim Pasternak Link: https://patch.msgid.link/20261105193200.1570996-1-fradensky@nvidia.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 5330697c21b5541e1e779b64467a17dc4012ac51 Author: Guenter Roeck Date: Thu Nov 5 10:17:02 2026 -0800 hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown commit 221b565a3316b1ba3a9bcd1f61238440207b3e00 upstream. In gpio_fan_probe(), gpio_fan_stop() is registered conditionally as a devres action before runtime PM is initialized, while gpio_fan_stop() unconditionally calls pm_runtime_disable(). This breaks runtime PM disable_depth and usage_count invariants across several paths: - On alarm-only devices without control GPIOs, gpio_fan_stop() is never registered, leaving pm_runtime_enable() unbalanced on unbind and triggering "Unbalanced pm_runtime_enable!" on subsequent binds. - When control GPIOs are present and devm_add_action_or_reset(), hwmon registration, or fan_alarm_init() fails, gpio_fan_stop() runs before pm_runtime_enable(), incrementing disable_depth to 2 (leaving runtime PM permanently disabled on re-probe) and, if speed_index > 0, underflowing usage_count via pm_runtime_put_sync(). - If pm_runtime_resume_and_get() fails when speed_index > 0, it drops its reference while speed_index remains non-zero, causing gpio_fan_stop() to call pm_runtime_put_sync() and underflow usage_count. - Registering the hwmon device before enabling runtime PM exposes sysfs attributes that can invoke set_fan_speed() before runtime PM state is initialized. Initialize runtime PM upfront with pm_runtime_set_suspended() and devm_pm_runtime_enable(), remove pm_runtime_disable() from gpio_fan_stop(), and acquire the initial active runtime PM reference before registering gpio_fan_stop() and the hwmon device. Fixes: 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support") Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-349aa3ba-30c3-4c3c-b47e-f52839af2b8d Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 4bc5b7ec78b0105625b0742b0b4c3c838e4231d3 Author: Rupesh Majhi Date: Sun Nov 8 19:26:51 2026 +0200 hwmon: (aht10) Fix update_interval overflow on 64-bit commit b5c5b67e02406fb48acf57cf2c30a570230fd6aa upstream. On 64-bit, update_interval writes are clamped to LONG_MAX ms, but ms_to_ktime() overflows above 9223372036854 ms and the interval wraps. LONG_MAX becomes -1 ms, so every read starts a new measurement and update_interval reads back -1. Clamp to INT_MAX like sht4x, so the limit is the same on all platforms. Fixes: 8c78f0dee437 ("hwmon: Add AHT10 Temperature and Humidity Sensor Driver") Cc: stable@vger.kernel.org Signed-off-by: Rupesh Majhi Link: https://patch.msgid.link/20261108172651.220121-1-zoone.rupert@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 7f3cde3a40dffb5bd0b6ffecbee03ad56a59afbe Author: Miguel Ojeda Date: Fri Nov 6 08:35:28 2026 +0100 kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100 commit 1178120c3bed1733aea1c465200a6b42f8a7105d upstream. Starting with Rust 1.100.0 (expected 2026-11-12), the `-Zprofile-sample-use` flag has been stabilized as `-Cprofile-sample-use` and the former is not available anymore [1]. Without this change, when building with `CLANG_AUTOFDO_PROFILE` set, one gets in the latest betas and nightlies: error: unknown unstable option: `profile-sample-use` Thus pass the right name. Cc: stable@vger.kernel.org # 7.3.x Link: https://github.com/rust-lang/rust/pull/155942 [1] Reviewed-by: Alice Ryhl Acked-by: Nicolas Schier Link: https://patch.msgid.link/20261106073528.93371-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 2b8684f416fa89c6818100f66602b3548d826ab7 Author: Yehyeong Lee Date: Tue Nov 10 21:50:02 2026 +0900 xen/pvcalls: destroy the per-socket workqueue on release commit 6b3feb6bfa9ac384f7a3ec25c40b9b4d3da96d25 upstream. pvcalls_new_active_socket() gives every active socket its own ordered workqueue: map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0); and nothing ever destroys it. pvcalls_back_release_active() flushes map->ioworker.register_work and frees map, but the workqueue and its pool_workqueues stay allocated, so a frontend leaks a workqueue per socket it connects and releases - a loop a guest can run as long as it likes. Destroy it right after flush_work(): the IRQ is disabled and sk_data_ready restored by then, so nothing can queue new work, and the rings are still mapped while it drains - pvcalls_conn_back_read() reads map->ring and map->data, which xenbus_unmap_ring_vfree() takes away a few lines later. pvcalls_back_ioworker() does not take fedata->socket_lock, which the backend_disconnect() caller holds here - only the socket's own sk_receive_queue lock - so draining it from this point is safe; the flush_work() just above already has the same requirement. Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command") Cc: stable@vger.kernel.org Reviewed-by: Stefano Stabellini Signed-off-by: Yehyeong Lee Signed-off-by: Juergen Gross Message-ID: <20261110125002.46683-3-yhlee@isslab.korea.ac.kr> Signed-off-by: Greg Kroah-Hartman commit 8b7e3d38d9d81e9bda8df64ec039cb582bb09dcf Author: Yehyeong Lee Date: Tue Nov 10 21:50:01 2026 +0900 xen/pvcalls: unwind pvcalls_new_active_socket() step by step commit 702ba3c80a8736898813a2c7484d695278aa114d upstream. Every error path in pvcalls_new_active_socket() jumps to one shared label that does list_del(&map->list) and then hands map to pvcalls_back_release_active(). But map comes from kzalloc() and its list_head is only published at the very end of the function, after the last of those jumps: down(&fedata->socket_lock); list_add_tail(&map->list, &fedata->socket_mappings); up(&fedata->socket_lock); so on the error path map->list is still {NULL, NULL} and __list_del() writes through a NULL pointer. A frontend gets there with one value it owns: the ring_order field of the page it granted. Anything above MAX_RING_ORDER takes the second goto, and nothing else in the function has run by then. The result is an oops in whichever context handled the request - the pvcalls-back threaded IRQ handler for PVCALLS_CONNECT, mappass->wq for PVCALLS_ACCEPT - and because it happens after down(&fedata->socket_lock) that semaphore is never released, so every later operation on the frontend blocks on it and the backend never completes backend_disconnect(). (With CONFIG_DEBUG_LIST the list_del() only reports and returns, and pvcalls_back_release_active() then runs on a map whose irq is still 0 and whose bytes, ioworker.wq and saved_data_ready are all NULL.) A frontend asking for ring_order 5, on a dom0 built with KASAN (the request was issued by a test-only change to the frontend): [ 133.728877] pvcalls_new_active_socket frontend requested ring_order 5, which is > MAX (4) [ 133.732868] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI [ 133.737910] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] [ 133.741666] CPU: 0 UID: 0 PID: 133 Comm: irq/39-pvcalls- Not tainted 7.3.0-kCTLblk2-15482-g21a7f44fd076-dirty #1 PREEMPT(full) [ 133.746986] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 133.751512] RIP: 0010:pvcalls_new_active_socket+0x821/0xb90 [ 133.754237] Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 f6 01 00 00 48 8d 79 08 4c 8b 6b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 14 02 00 00 4c 89 ea 4c 89 69 08 48 b8 00 00 00 [ 133.763126] RSP: 0018:ffffc900004afb38 EFLAGS: 00010202 [ 133.765861] RAX: dffffc0000000000 RBX: ffff88810886c900 RCX: 0000000000000000 [ 133.769348] RDX: 0000000000000001 RSI: 0000000000000246 RDI: 0000000000000008 [ 133.772787] RBP: 1ffff92000095f6b R08: 0000000000000001 R09: fffff52000095f58 [ 133.776260] R10: 0000000000000003 R11: ffff888100077320 R12: ffff88810858b410 [ 133.779823] R13: 0000000000000000 R14: ffff88810858b460 R15: ffff88810858b400 [ 133.783382] FS: 0000000000000000(0000) GS:ffff8881b034c000(0000) knlGS:0000000000000000 [ 133.787351] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 133.790308] CR2: 00000000006042c0 CR3: 0000000108400001 CR4: 0000000000770ef0 [ 133.793822] PKRU: 55555554 [ 133.795347] Call Trace: [ 133.796778] [ 133.798082] ? __pfx_pvcalls_new_active_socket+0x10/0x10 [ 133.800801] ? security_socket_post_create+0x4d/0x60 [ 133.803275] ? release_sock+0x1a/0x1d0 [ 133.805182] pvcalls_back_event+0x1b09/0x23e0 [ 133.807431] ? __pfx_pvcalls_back_event+0x10/0x10 [ 133.809814] ? __pfx__raw_spin_lock_irqsave+0x10/0x10 [ 133.812251] ? __pfx_pvcalls_back_event+0x10/0x10 [ 133.814554] irq_thread_fn+0x86/0x150 [ 133.816468] irq_thread+0x2da/0x580 [ 133.818363] ? __pfx_irq_thread_fn+0x10/0x10 [ 133.820586] ? __pfx_irq_thread+0x10/0x10 [ 133.822670] ? __kthread_parkme+0x88/0x170 [ 133.824803] ? __pfx_irq_thread+0x10/0x10 [ 133.827153] ? __pfx_irq_thread+0x10/0x10 [ 133.829304] kthread+0x2c8/0x3b0 [ 133.831176] ? recalc_sigpending+0x15c/0x1e0 [ 133.833570] ? __pfx_kthread+0x10/0x10 [ 133.835572] ret_from_fork+0x373/0x5b0 [ 133.837581] ? __pfx_ret_from_fork+0x10/0x10 [ 133.839978] ? __switch_to+0x3c4/0xb40 [ 133.841984] ? __pfx_kthread+0x10/0x10 [ 133.843970] ret_from_fork_asm+0x1a/0x30 [ 133.846031] [ 133.847420] Modules linked in: [ 133.849240] ---[ end trace 0000000000000000 ]--- Give each failure its own label, so that only resources that were actually acquired are released and the list the map was never added to is left alone. The map is not published anywhere at that point, so the error path needs no socket_lock at all. sock_release() stays in the callee on every error path, the way commit 8fafac202d18 ("xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()") arranged it. Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command") Cc: stable@vger.kernel.org Reviewed-by: Stefano Stabellini Signed-off-by: Yehyeong Lee Signed-off-by: Juergen Gross Message-ID: <20261110125002.46683-2-yhlee@isslab.korea.ac.kr> Signed-off-by: Greg Kroah-Hartman commit bec55c715b27e1eec4471968802c9d10ff6fef4e Author: Qihang Date: Mon Nov 2 00:32:50 2026 +0800 xen/privcmd: fix double free when an irqfd is shut down twice commit 72a900c666adb97df77b05cf8540c4117f9c83ba upstream. irqfd_deactivate() takes the irqfd off irqfds_list and queues irqfd_shutdown(). queue_work() is not a once-only gate: it refuses to enqueue a work item only while WORK_STRUCT_PENDING is set, and process_one_work() clears that bit before it calls the work function. So nothing records that the shutdown work has already been queued, and nothing protects the window between the start of irqfd_shutdown() and the kfree() at its end. Two paths call irqfd_deactivate() for the same irqfd: - privcmd_irqfd_deassign(), from the PRIVCMD_IRQFD_FLAG_DEASSIGN ioctl; - irqfd_wakeup(), with EPOLLHUP set, when the last reference to the eventfd file goes away, which runs wake_up_poll(&ctx->wqh, EPOLLHUP) from eventfd_release(). irqfds_lock serialises the two calls, but it does not make the second one a no-op, and eventfd_ctx_fdget() takes a reference to the eventfd_ctx, not to the struct file, so the last fd can still be closed while the ioctl is running: CPU0 CPU1 eventfd_ctx_fdget() spin_lock(irqfds_lock) list_del_init(&kirqfd->list) queue_work(&kirqfd->shutdown) close(fd) eventfd_release() wake_up_poll(EPOLLHUP) irqfd_wakeup() spin_lock(irqfds_lock) irqfd_deactivate() again If the work item has already started by then, its pending bit has been cleared and the second queue_work() succeeds. irqfd_shutdown() then runs twice, so eventfd_ctx_remove_wait_queue(), eventfd_ctx_put() and kfree() each hit the same object a second time; and when the second queue_work() lands after the irqfd has been freed, the workqueue list operations write to freed memory. virt/kvm/eventfd.c has the same two callers and has had this guard since the original irqfd support (721eecbf4fe99): irqfd_wakeup() calls irqfd_deactivate() only if irqfd_is_active(). The comment there explains why that is enough: the other side deactivates the irqfd before it takes it off the waitqueue, and irqfd_shutdown() needs the waitqueue lock, which this callback holds, so the irqfd cannot be freed under it. Do the same here. list_del_init() leaves the list head empty and the irqfd stays off the list until kfree(), so it serves as a one-way "active" flag. The test is in irqfd_deactivate() rather than in irqfd_wakeup() because privcmd_irqfd_deassign() walks irqfds_list and can therefore never reach an inactive irqfd; only the wakeup path can, and a single test covers both callers. Fixes: f8941e6c4c712 ("xen: privcmd: Add support for irqfd") Cc: stable@vger.kernel.org Signed-off-by: Qihang Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Message-ID: <20261101163251.55099-1-q.h.hack.winter@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 7b73a22b4a3055f96877c609d253711de32e106a Author: Andrey Misiurov Date: Tue Oct 13 19:07:45 2026 +0200 xen/gntdev: fix deadlock between map ioctl and mmap commit 7620a997e4854c94eacebf0c2d453fbd78ccdb46 upstream. Commit 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl") moved copy_to_user() in gntdev_ioctl_map_grant_ref() under priv->lock. A fault in copy_to_user() takes mmap_lock, while gntdev_mmap() is called with mmap_lock held and takes priv->lock: ioctl thread mmap thread mutex_lock(&priv->lock) mmap_write_lock(mm) gntdev_mmap() mutex_lock(&priv->lock) copy_to_user() faults mmap_read_lock(mm) Reproduced on Debian 6.12.111 in a Xen guest, with the ioctl argument on a MAP_PRIVATE file page that has not been written yet. sysrq-w: task:repro state:D stack:0 pid:4479 tgid:4477 ppid:1 flags:0x00000000 rwsem_down_read_slowpath+0x25c/0x480 down_read_killable+0x48/0xc0 lock_mm_and_find_vma+0x96/0x250 do_user_addr_fault+0x12d/0x620 exc_page_fault+0x7e/0x180 asm_exc_page_fault+0x26/0x30 _copy_to_user+0x36/0x50 gntdev_ioctl+0x3b9/0xa00 [xen_gntdev] __x64_sys_ioctl+0x97/0xc0 task:repro state:D stack:0 pid:4480 tgid:4477 ppid:1 flags:0x00000000 __mutex_lock.constprop.0+0x41b/0x720 gntdev_mmap+0x4d/0x330 [xen_gntdev] __mmap_region+0x697/0xb10 mmap_region+0x78/0xa0 do_mmap+0x45d/0x630 vm_mmap_pgoff+0xf8/0x1c0 Drop priv->lock before copy_to_user() again. On failure, re-take it and remove the map by index, as IOCTL_GNTDEV_UNMAP_GRANT_REF does, since another thread may have unmapped it meanwhile. Fixes: 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl") Cc: stable@vger.kernel.org Signed-off-by: Andrey Misiurov Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Message-ID: <20261013170745.583279-1-andrey.misyrov@gmail.com> Signed-off-by: Greg Kroah-Hartman commit 636fbdbd837cb444ea7324bba97b0d7c0e0018c6 Author: Hengyu Liang Date: Mon Nov 2 22:16:30 2026 -0500 x86/video: Preserve the default VGA fallback for legacy modes commit 3b4c98b47ba7c3c57bcf54fb85f54a854622041c upstream. Commit 596b3678326d ("x86/video: Only fall back to vga_default_device() without screen info") made video_is_primary_device() rely exclusively on screen_info resources whenever any are available. However, screen_info_resources() also returns legacy I/O and memory ranges for VGA text modes. These ranges are not PCI BARs, so pci_find_resource() does not find them and the default VGA fallback is skipped. As a result, no device is primary in VGA text mode. On a SeaBIOS QEMU guest with bochs and VKMS, the boot VGA (bochs) loses its DRM boot_display attribute. VKMS registers fb0 and bochs registers fb1. VKMS is not a PCI device, so it is not primary either. With no primary device, fbcon keeps the console on fb0 and never remaps it to bochs. This can be checked with: cat /sys/class/drm/card1/boot_display stty -F /dev/tty1 size Without the fix, boot_display is missing and tty1 is 48 rows by 128 columns. With it, boot_display contains 1 and tty1 is 50 rows by 160 columns. VKMS only makes the console part visible. Without VKMS, tty1 has the same size with and without the fix, but boot_display is still missing without it. Use resource-based selection only for linear framebuffers. Fall back to vga_default_device() for legacy display modes, while keeping EFI and VESA framebuffer ownership authoritative. Fixes: 596b3678326d ("x86/video: Only fall back to vga_default_device() without screen info") Signed-off-by: Hengyu Liang Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Mario Limonciello (AMD) Reviewed-by: Thomas Zimmermann Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103031630.2085194-1-hengyul@cs.unc.edu Signed-off-by: Greg Kroah-Hartman commit 43b1ef94852545d2e68531336e84afceb71c8efe Author: Dave Hansen Date: Tue Nov 10 09:27:39 2026 -0800 x86/mm: Ensure write visibility during LDT installation commit 0dc2a4dac3d04e9e4479aeb0b46172feab1cca0a upstream. During LDT installation, the intent is to overwrite the old per-mm LDT value, then send an IPI to the mm user CPUs to have each load the new value. But there is an ordering problem: a new mm user CPU sets itself in mm_cpumask() and then reads mm->context.ldt. The LDT-installing CPU writes mm->context.ldt and then reads mm_cpumask(). But, there is nothing which orders the LDT installation side actions. The CPU can read mm_cpumask() before its write becomes visible. Ensure that new mm user CPUs see the new mm->context.ldt. Make mm->context.ldt visible before reading mm_cpumask(). Also convert the smp_store_release() over to a WRITE_ONCE(). smp_store_release() has an internal barrier which is weaker than the new smp_mb(). Avoid an extra barrier by converting it to WRITE_ONCE(). Also refresh/correct misleading comments. READ/WRITE_ONCE() do not "synchronize" anything themselves. Reported-by: Jaeyoung Chung Signed-off-by: Dave Hansen Signed-off-by: Ingo Molnar Tested-by: Jaeyoung Chung Acked-by: Linus Torvalds Acked-by: Peter Zijlstra (Intel) Cc: Signed-off-by: Greg Kroah-Hartman commit 4cdba0297e95b88080cc2fa484c8ca78aa5ab2f6 Author: Jason Andryuk Date: Tue Nov 3 20:30:25 2026 -0500 x86/CPU/AMD: Don't print reset reason in VMs commit ea51d1a4c31fc8320c34f897dc5296a0bfc5c7ca upstream. print_s5_reset_status_mmio() expects to read FCH MMIO on baremetal. VMs don't have emulated FCH registers, so there is nothing to check. Add an early exit when running on a hypervisor. The real motivation is Xen PV domUs can't boot on Zen CPUs. PV domUs PTEs contain system physical addresses - they don't have the concept of guest physical addresses. domUs can only map physical addresses they are assigned, so a domU fails to map the FCH MMIO addresses. However set_pte() does not return failure, so ioremap() returns a pointer while the PTEs are unpopulated. print_s5_reset_status_mmio() faults when reading through the pointer, breaking the boot. Limit the reset reason printing to baremetal only where it actually makes sense. [ bp: Massage commit message. ] Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset") Suggested-by: Borislav Petkov Signed-off-by: Jason Andryuk Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Mario Limonciello (AMD) Reviewed-by: Yazen Ghannam Reviewed-by: Juergen Gross Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261104013026.185392-1-jason.andryuk@amd.com Signed-off-by: Greg Kroah-Hartman commit 4dfab1a2c59c5af2d51e804c6cb0b284ceb13a7a Author: Lad Prabhakar Date: Thu Oct 1 17:51:58 2026 +0100 watchdog: rzv2h: Drop runtime PM handling from WDTDCR init commit f00afd5d8d5dc03994cb67246543d5c70571ebbe upstream. WDTDCR is located in the CPG region, outside the watchdog module, and is accessible regardless of the watchdog's clocks and reset state. Drop the unnecessary runtime PM handling from WDTDCR initialization and access the register directly. Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)") Cc: stable@vger.kernel.org Signed-off-by: Lad Prabhakar Link: https://patch.msgid.link/20261001165201.763882-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 7b3df884045abb5ee97858d3c37292d3de93f81a Author: Lad Prabhakar Date: Thu Oct 1 17:51:56 2026 +0100 watchdog: rzv2h: Use pm_runtime_put_sync() commit ca800e625d18a9f5b19f94ab837ceb3fccdca22f upstream. pm_runtime_put() may trigger the idle check after pm_runtime_disable() is run as part of devm_pm_runtime_enable()'s cleanup action, leaving runtime PM active. Use pm_runtime_put_sync() to ensure the idle check runs synchronously. Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)") Cc: stable@vger.kernel.org Signed-off-by: Lad Prabhakar Link: https://patch.msgid.link/20261001165201.763882-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 4fef3413dc3738949debdf1148ff70fd0bec3a3e Author: Zhao Feng Date: Mon Nov 9 15:10:03 2026 +0800 watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog commit 57c7cbe21acc77291ec0fbdd4bd72aa259cf4986 upstream. npcm_wdt_start() unconditionally prepares and enables the watchdog clock, and npcm_wdt_stop() is the only place that disables it. npcm_wdt_set_timeout() calls npcm_wdt_start() again whenever the watchdog is already active, so every WDIOC_SETTIMEOUT ioctl issued while the watchdog is running takes one extra clock prepare/enable reference that is never dropped. Split the register programming out of npcm_wdt_start() into a __npcm_wdt_start() helper that assumes the clock is already running, and call the helper from npcm_wdt_set_timeout() instead; only the watchdog .start callback (and the restart path, which intentionally keeps the clock) now acquires the clock. Fixes: af084fdccfaf ("watchdog: npcm: Enable clock if provided") Cc: stable@vger.kernel.org Signed-off-by: Zhao Feng Link: https://patch.msgid.link/20261109071004.1506-1-zhaofeng2@cmss.chinamobile.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 2284bf66eb87707c8684fe982de022b632c7773d Author: Stanislav Aleksandrov Date: Mon Nov 9 08:26:52 2026 +0000 watchdog: gunyah_wdt: Re-enable the watchdog on resume commit f0dfc756bb46235068279755249131c2a7130111 upstream. gunyah_wdt_suspend() disables an active watchdog, and gunyah_wdt_resume() enables it again with gunyah_wdt_start(). start() first disables the watchdog, which fails with -EINVAL when it is already disabled. start() ignores that only while the watchdog is inactive, but on resume it is still active for the watchdog core, so start() returns before it enables the watchdog: gunyah-wdt gunyah-wdt: gunyah_wdt_start: Failed to stop gunyah wdt -22 So after every system suspend, the watchdog is left disabled. Move setting the timeout and enabling the watchdog into gunyah_wdt_enable(), and call it on resume, where the watchdog is already disabled. Tested on the Samsung Galaxy XR (Qualcomm Halliday) with s2idle and deep suspend. Fixes: ca316e145c35 ("watchdog: Add driver for Gunyah Watchdog") Cc: stable@vger.kernel.org Signed-off-by: Stanislav Aleksandrov Link: https://patch.msgid.link/20261109-gunyah-wdt-resume-v1-1-fbd84545ce92@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 59158d24959ed826cb573a9c9c3d554be8d14fe5 Author: Vishwaroop A Date: Mon Oct 26 11:14:12 2026 +0000 spi: tegra210-quad: Unmap DMA buffers on transfer timeout commit d04ad85dd8015713b0b2531b5b934fe67828d741 upstream. tegra_qspi_start_dma_based_transfer() maps the client TX/RX buffers with dma_map_single() via tegra_qspi_dma_map_xfer(). The matching unmap only happens in handle_dma_based_xfer(), which runs from the interrupt bottom half. When wait_for_completion_timeout() expires and tegra_qspi_handle_timeout() cannot establish that the hardware finished, it returns an error without the bottom half ever having run. Both transfer paths then abort the transfer with tegra_qspi_dma_stop(), reset the controller and clear curr_xfer, but never unmap the buffers. Every genuine transfer timeout therefore leaks the streaming DMA mappings for that chunk, which gradually exhausts the IOVA space on systems with an IOMMU in front of QSPI. Unmap the transfer after stopping DMA on both timeout error paths. The unmap is placed after tegra_qspi_dma_stop() so the DMA engine is quiesced before the mappings go away. The recovery paths that do reach handle_dma_based_xfer() unmap there themselves. The preceding patch makes tegra_qspi_dma_unmap_xfer() a no-op once the mapping is released, so this cleanup cannot unmap twice or run against a chunk that was never mapped. Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller") Cc: stable@vger.kernel.org # with "spi: tegra210-quad: Track DMA mapping state" Signed-off-by: Vishwaroop A Link: https://patch.msgid.link/20261026111412.3843954-4-va@nvidia.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 606e6c6c7ca324473dad56a9dbaa9326c3076214 Author: Vishwaroop A Date: Mon Oct 26 11:14:11 2026 +0000 spi: tegra210-quad: Track DMA mapping state commit 7b9e6f7bc13c0259b192d0a964e802d4ad53b8b8 upstream. tegra_qspi_dma_unmap_xfer() assumes a streaming mapping is always outstanding and recomputes its length from the live tqspi->curr_dma_words. Nothing records whether tegra_qspi_dma_map_xfer() mapped anything, so neither assumption holds. For a multi-chunk transfer, handle_dma_based_xfer() unmaps the chunk that just completed, recalculates the parameters for the next chunk, which overwrites curr_dma_words, and re-arms the hardware. If tegra_qspi_start_dma_based_transfer() then fails at its tegra_qspi_dma_map_xfer() call, nothing is mapped. That early return also sits above the smp_store_release() that clears tqspi->trans_status, so the previous chunk's QSPI_RDY survives, and the re-arm's return value is never checked, so handle_dma_based_xfer() returns IRQ_HANDLED without completing the transfer. The caller times out, tegra_qspi_handle_timeout() sees the stale QSPI_RDY, concludes the transfer completed and calls handle_dma_based_xfer() again. No DMA completion arrives, so num_errors is incremented and tegra_qspi_dma_unmap_xfer() runs with nothing mapped. t->tx_dma then holds either the DMA_MAPPING_ERROR sentinel or, if the RX mapping was the one that failed, the preceding chunk's address that has already been released. Behind an IOMMU the latter frees an IOVA that may since have been reallocated. Record whether a mapping is outstanding and the length that was mapped, and return early from tegra_qspi_dma_unmap_xfer() when there is nothing to release. is_dma_mapped is only updated under tqspi->lock, or on the timeout path after synchronize_irq() and cancel_work_sync() have quiesced the ISR and the bottom half. Also skip releasing the TX mapping on the RX failure path unless a TX mapping was created; t->tx_dma is uninitialised when t->tx_buf is NULL. Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller") Suggested-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Vishwaroop A Link: https://patch.msgid.link/20261026111412.3843954-3-va@nvidia.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 20e028e01d62557de76c8da648ae52e0ad487c27 Author: Kees Cook Date: Thu Nov 12 22:55:12 2026 -0800 spi: axi-spi-engine: Start the program length at zero commit 2a490521d74ac76e5eb3c9a69d928a4c76dd3f78 upstream. spi_engine_optimize_message() allocates the program with kzalloc_flex(), which sets the __counted_by() counter "length" to the allocated size when the compiler supports __builtin_counted_by_ref(). The program is then filled by spi_engine_program_add_cmd(), which increments "length" and stores at length - 1, expecting it to start at zero as it did when the program came from kzalloc(). Reset "length" after the allocation, since it is a "usage" counter, not a "total allocation" counter. Build tested ARCH=x86_64 defconfig with CONFIG_SPI_AXI_SPI_ENGINE=m and W=1, with GCC 16.2.0. Reported-by: Dennis Gilmore Closes: https://lore.kernel.org/all/20261112025252.71375-1-dennis@ausil.us/ Fixes: 69050f8d6d075 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: David Lechner Link: https://patch.msgid.link/20261113065508.i.606-kees@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 3a1797aa79023d44c7c7a4d8c62264e4f1cda215 Author: Hyunjung Ko Date: Mon Nov 9 01:58:12 2026 +0900 tpm: flush timeout work outside buffer_mutex to avoid deadlock commit c22052a012698ce56d599d75b669d55778521c7c upstream. tpm_common_read() calls flush_work(&priv->timeout_work) under priv->buffer_mutex, but tpm_timeout_work() also takes buffer_mutex, so a running timeout work deadlocks the flush. Flush after unlocking; the timer is deleted under the lock, so no new work can be queued. Fixes: 9488585b21be ("tpm: add support for partial reads") Cc: stable@vger.kernel.org Signed-off-by: Hyunjung Ko Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261108165812.676876-1-hj351016@gmail.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 0bc5d911512abfe6e074d987e2644ce623049520 Author: Guanglei Zhu Date: Tue Nov 10 14:50:22 2026 +0200 tpm: eventlog: check the payload size before reading tag events commit 0a385f668ba77d29ae167c1668fd452418ebc9d6 upstream. The EVENT_TAG branch of get_event_name() casts the event payload to struct tcpa_pc_event and reads from it: pc_event = (struct tcpa_pc_event *)event_entry; switch (do_endian_conversion(pc_event->event_id)) { ... for (i = 0; i < 20; i++) d_len += sprintf(&data[2*i], "%02x", pc_event->event_data[i]); The log iterators only verify that the event header plus the declared event_size stays within the log buffer; they do not require the payload of an EVENT_TAG entry to be large enough for the fields the branch reads. A truncated entry makes the branch read up to 20 bytes of event_data[] past the end of the entry, and, for the last entry in the log, past the end of the buffer itself. The legacy PC Client spec defines the EV_EVENT_TAG payload as a TCPA_PC_EVENT - event_id, event_size and event-type-specific data - so a conformant entry carries the 8-byte header and the hash-type ids carry a full digest. The log itself, however, is an ACPI table the firmware leaves in memory: the TPM never measures the log, so the kernel cannot tell a conformant log from a corrupted one. The iterators already work on that assumption - they stop once the declared event_size runs past the buffer end - and the readers should apply the same rule to what they take off the payload. Skip entries whose payload cannot even hold the event id, and skip the 20-byte digest dump when the payload cannot hold the full tcpa_pc_event header plus the digest, so the branch never reads beyond the entry it is formatting. Cc: stable@vger.kernel.org Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log") Signed-off-by: Guanglei Zhu Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit bc3a0e93115921482020e898a7ae78e5246274ae Author: Eric Biggers Date: Tue Nov 10 14:49:51 2026 +0200 tpm: Check return value of crypto_kpp_set_secret() commit 8cff8f1c89d33e55c9af82177b14f6f9f6a899fe upstream. crypto_kpp_set_secret() can fail, for example if the kernel is booted with fips=1 and the broken-by-design FIPS RNG used for ECC private key generation doesn't feel like generating random bytes at the moment. Check for error, cancelling the TPM session creation rather than proceeding with a zero or uninitialized private key. Fixes: 699e3efd6c64 ("tpm: Add HMAC session start and end functions") Cc: stable@vger.kernel.org # v6.12+ Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261025211119.138277-1-ebiggers@kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 46c119eea60c7efc82672567f8c6a76b99f757b7 Author: Takashi Iwai Date: Tue Nov 10 14:51:14 2026 +0200 tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path commit 03fcb358249dc715124b3616f814ea0ecc6ec36c upstream. When devm_add_action() returns an error, tpm_read_log_acpi() clears log->bios_event_log unnecessarily to NULL before calling tpm_bios_log_free(), and it would lead to a memory leak of the allocated log buffer. Fix it by simply jumping to the err. Cc: stable@vger.kernel.org # v6.18+ Fixes: a3a860bc0fd6 ("tpm: Change to kvalloc() in eventlog/acpi.c") Signed-off-by: Takashi Iwai Reviewed-by: Paul Menzel Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261109173756.742248-1-tiwai@suse.de Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 8b39c3a743f37d73819e676c9f56761f904781f6 Author: Avi Weiss Date: Tue Nov 3 11:06:05 2026 +0200 timekeeping: Refresh auxiliary base before offset validation commit c1b96ba87e3caaa701d6dba254e58db7cc3c99be upstream. timekeeping_forward_now() can advance an auxiliary timekeeper across a second boundary without refreshing tkr_mono.base. The negative-time check in __timekeeping_inject_offset() then uses the stale base and rejects valid ADJ_SETOFFSET adjustments with -EINVAL. Refresh the derived timekeeper data before calculating the current auxiliary time, as aux_clock_set() already does. On 7.4-rc1, a valid negative adjustment fails at the first second rollover. The patched kernel accepts all 12 tested rollover adjustments and continues to reject invalid negative offsets. Fixes: 2c8aea59c206 ("timekeeping: Add auxiliary clock support to __timekeeping_inject_offset()") Signed-off-by: Avi Weiss Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103090605.1292660-1-thnkslprpt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61e9f1b77535a8830a69051c5bb5ec36b2601074 Author: Avi Weiss Date: Sat Oct 31 14:22:17 2026 +0200 timekeeping: Reject cross timestamps for invalid AUX clocks commit 67f1969e29b692ab3cfcc97ba175b9109212de00 upstream. get_device_system_crosststamp() accepts AUX clock IDs even when the corresponding timekeeper is disabled. A never-enabled AUX timekeeper has no initialized clocksource, and a previously enabled one can retain stale timekeeping data. Return -ENODEV before calling the device timestamp callback when the selected timekeeper is invalid. Fixes: 9aebde8af6fe ("timekeeping: Add support for AUX clock cross timestamping") Signed-off-by: Avi Weiss Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261031122218.118921-1-thnkslprpt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 825c82ae9b997e56d40e4b02b14ae7893a92a32c Author: Hungyu Lin Date: Fri Oct 30 05:42:26 2026 +0000 timekeeping: Read getboottime64() offsets under the sequence counter commit 385b5ec1f31dd39297578eed42be74b07ae74017 upstream. getboottime64() computes the wall-clock boot timestamp from offs_real minus offs_boot without checking tk_core.seq. A concurrent timekeeping update can leave the reader with an inconsistent pair of offsets or, on 32-bit systems, a torn 64-bit offset, producing an incorrect boot timestamp. Read both offsets under tk_core.seq and retry if an update overlaps the sample. Convert the resulting local value to a timespec64 afterward. Fixes: 7c3f1a573237 ("Introduce boot based time") Signed-off-by: Hungyu Lin Signed-off-by: Thomas Gleixner Acked-by: John Stultz Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261030054227.35453-2-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman commit 789c8189e85791bc1fafbc9af07a9ad60da3c561 Author: Avi Weiss Date: Fri Oct 23 11:48:19 2026 +0300 SUNRPC: Fix TCP-with-TLS transport class identification commit 0502c7e7f171a8c9c892bdef89e6aa6f44d7b2a3 upstream. xs_setup_tcp_tls() assigns the ordinary TCP transport class to a TCP-with-TLS transport. When rpc_clnt_add_xprt() is called with an unspecified transport type, it inherits the class identifier and can create an unencrypted TCP transport. Looks like a copy-paste error from the commit 3 years ago. NFSv4 trunk discovery uses an unspecified transport type when adding server-advertised addresses. If the additional transport passes server-identity validation, it can be admitted to the client's transport switch. An isolated loopback test reproduced plaintext application RPC transmission for TLS- and mTLS-configured clients, including an unpinned TLS-client RPC that selected the added transport. Assign the TCP-with-TLS class instead. With the fix, the plaintext-only test peer receives TLS negotiation probes but no application payloads. Fixes: 75eb6af7acdf ("SUNRPC: Add a TCP-with-TLS RPC transport class") Cc: stable@vger.kernel.org Signed-off-by: Avi Weiss Reviewed-by: Benjamin Coddington Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman commit d328ac6af117174643390728b8a285feeec9bf68 Author: Bartosz Golaszewski Date: Mon Nov 2 16:25:16 2026 +0100 software node: only let the owner release a managed node commit f8623ce596492d2e96ca57eeec992938d3d79f00 upstream. device_create_managed_software_node() creates a node whose lifetime is tied to the device it was created for. software_node_notify_remove() is called for every device that has the node as its fwnode (primary OR secondary) and, if the node is managed, unconditionally detaches it from that device and drops the creation reference. This breaks when the node is shared with another device. Example: the i2c-designware copies the parent's fwnode to the adapter's struct device. When the adapter is deleted, it releases the reference that belongs to the owner and the latter ends up with a dangling pointer. Record the device's "manager" and only perform the actual release when notify is called for that "owner" device. Note that it was never the intention that managed software nodes would be shared, but descendants reusing ancestor firmware nodes is not uncommon and such use is hard to predict when allocating software nodes. Reported-by: Balasubramani Vivekanandan Closes: https://lore.kernel.org/all/20261009164241.923756-2-balasubramani.vivekanandan@intel.com/ Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()") Signed-off-by: Bartosz Golaszewski Fixes: 0f485f88656a ("drm/xe/i2c: use device_create_managed_software_node()") Reviewed-by: Balasubramani Vivekanandan Tested-by: Balasubramani Vivekanandan Reviewed-by: Heikki Krogerus Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261102-swnode-only-owner-release-v1-1-ee4c9022a629@oss.qualcomm.com [ johan: drop temporary variable; skip clearing owner field; mention reuse not intended in commit message ] Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit 2015f3661f5f3491c576c7487de653dc92738bbe Author: Rafael J. Wysocki Date: Fri Nov 6 16:05:06 2026 +0100 cpufreq: Fix updates of cached resolved frequency and index commit 75120f31aed010c326b28d7c80d22314df34d9a8 upstream. The cached resolved frequency and index, cached_target_freq and cached_resolved_idx, respectively, may be updated concurrently if cpufreq_driver_resolve_freq() is called by the schedutil governor while cpufreq_set_policy() is running for the same policy. Those concurrent updates are not synchronized in any way and the values written by cpufreq_set_policy(), if it wins the race, may confuse drivers using those policy fields [1]. To address this, use the observation that the only place where cached_target_freq and cached_resolved_idx need to be updated is cpufreq_driver_resolve_freq() because the only legitimate users of them are .fast_switch() driver callbacks. Although cached_resolved_idx is also used in __cpufreq_driver_target(), that is in fact unnecessary and it is better to use a local variable for storing the frequency table index in that function. Accordingly, rearrange __resolve_freq() and its callers so that cached_target_freq and cached_resolved_idx are only updated in cpufreq_driver_resolve_freq(). The cached_target_freq initialization in cpufreq_set_policy() is still needed, but move it after stopping the old governor and before starting the new one to avoid racing with cpufreq_driver_resolve_freq(). Fixes: f9ccdec24d91 ("cpufreq: Reuse cpufreq_driver_resolve_freq() in __cpufreq_driver_target()") Fixes: 151717690694 ("cpufreq: Make policy min/max hard requirements") Reported-by: Zhongqiu Han Closes: https://lore.kernel.org/linux-pm/20261105140357.1331894-1-zhongqiu.han@oss.qualcomm.com/ [1] Co-developed-by: Zhongqiu Han Signed-off-by: Zhongqiu Han Signed-off-by: Rafael J. Wysocki Reviewed-by: Christian Loehle Tested-by: Christian Loehle Cc: All applicable # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume Cc: All applicable # 166207cac451 cpufreq: Cache post-resolution target frequency in __resolve_freq() Link: https://patch.msgid.link/3472677.aeNJFYEL58@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit ef9e7bfc2865b96cd45fa9c821de2ec272bc4741 Author: Rafael J. Wysocki Date: Fri Nov 6 16:04:05 2026 +0100 cpufreq: Cache post-resolution target frequency in __resolve_freq() commit 166207cac45191637c47a457a5c16ca6b6773a16 upstream. get_next_freq() in the schedutil governor returns the resolved frequency from cpufreq_driver_resolve_freq(), and that resolved value is then passed to cpufreq_driver_fast_switch(). The only reader of cached_target_freq, acpi_cpufreq_fast_switch(), compares it with the post-resolution target frequency, but it holds the pre-resolution clamped frequency, so any request that falls between table entries misses the cache and falls back to a table scan. Address this by making __resolve_freq() store the post-resolution frequency in cached_target_freq. Fixes: e3c062360870 ("cpufreq: add cpufreq_driver_resolve_freq()") Cc: All applicable Signed-off-by: Rafael J. Wysocki Reviewed-by: Christian Loehle Tested-by: Christian Loehle Link: https://patch.msgid.link/14161745.uLZWGnKmhe@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 27633121dbc739c69398badb13ab538ea94490b7 Author: Rafael J. Wysocki Date: Tue Nov 3 20:47:48 2026 +0100 cpufreq: Force passing target frequency to driver during resume commit 342d3a73c5dbc2f1cd0c5142e2d11bda4dc54cd7 upstream. The policy->cur value preserved across a system suspend-resume cycle may become stale in some cases and it may prevent the CPU performance scaling logic from being updated due to the target_freq == policy->cur check in __cpufreq_driver_target() [1]. To address this, adjust the existing mechanism to force the invocation of the driver .target() callback in __cpufreq_driver_target() and make cpufreq_resume_policy() use it. This involves renaming update_limits in struct cpufreq_policy to force_target and moving the driver CPUFREQ_NEED_UPDATE_LIMITS flag check from __cpufreq_driver_target() to cpufreq_set_policy(), where it is used as a condition for setting policy->force_target. In cpufreq_resume_policy(), policy->force_target is set for drivers that implement the .target() callback, but don't implement the .get() one, which is the case when the driver callback needs to run if policy->cur becomes stale while suspended. Fixes: 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate") Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1] Reported-by: Zak Brighton Knight Reported-by: Doug Smythies Cc: All applicable # eee2a44e4e2b cpufreq: Improve suspend-resume synchronization Signed-off-by: Rafael J. Wysocki Tested-by: Zak Brighton Knight Reviewed-by: Zhongqiu Han Acked-by: Viresh Kumar Tested-by: Doug Smythies Tested-by: Christian Loehle Link: https://patch.msgid.link/1995295.tdWV9SEqCh@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 894e710fc8922215a2833103ca0be5f10e489e8d Author: Li Zhaoxin Date: Wed Nov 4 15:01:49 2026 +0800 cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT commit 2c0e6f2858d235c99f7ba4621bd176cd67226f00 upstream. Commit ed7cad0504e3 ("cpufreq: intel_pstate: Relocate platform preference check") moved the intel_pstate_platform_pwr_mgmt_exists() call to the beginning of intel_pstate_init(), right after the vendor check, so it now runs before "no_load" (intel_pstate=disable) and the other checks. MSR_MISC_PWR_MGMT is model-specific and KVM does not emulate it. In a KVM guest using a CPU model listed in intel_pstate_cpu_oob_ids[] (for example "-cpu host" on Emerald Rapids), reading it raises #GP and the unchecked rdmsrq() emits a warning with a call trace on every boot, even with intel_pstate=disable: unchecked MSR access error: RDMSR from 0x1aa at rIP: 0xffffffffa4009342 (native_read_msr+0x2/0x50) Call Trace: intel_pstate_platform_pwr_mgmt_exists+0x3b/0x220 intel_pstate_init+0x1e/0x500 do_one_initcall+0x59/0x350 ... Before that commit, such guests typically returned from intel_pstate_init() earlier, either because of intel_pstate=disable or because intel_pstate_msrs_not_valid() failed on the zero ratios that KVM reports in MSR_PLATFORM_INFO by default, so the MSR was not read. Use rdmsrq_safe() and treat a failing read as "no OOB mode". The exception fixup already zeroes the result of a failed unchecked read, so apart from the warning going away there is no functional change. Fixes: ed7cad0504e3 ("cpufreq: intel_pstate: Relocate platform preference check") Cc: All applicable Signed-off-by: Li Zhaoxin Link: https://patch.msgid.link/20261104070149.41393-1-lizhaoxin04@baidu.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 95bf3d9d123c0c6d87766ad4c27c2b5741e1cb72 Author: Rafael J. Wysocki Date: Tue Nov 3 20:49:06 2026 +0100 cpufreq: intel_pstate: Clear last written P-state value on suspend commit 02e77af824d5be3a94fdd885835a352f90d24c5c upstream. Preserving cpu->pstate.current_pstate across system suspend-resume cycles, when running in the passive mode with HWP disabled, is a mistake because its value from before system suspend may become stale after the subsequent system resume and in some cases it prevents MSR_IA32_PERF_CTL from being updated properly after system resume [1]. Address this by clearing cpu->pstate.current_pstate after the governor has been stopped during system suspend. Fixes: 001c76f05b01 ("cpufreq: intel_pstate: Generic governors support") Fixes: 4adcf2e5829f ("cpufreq: intel_pstate: Add ->offline and ->online callbacks") Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1] Reported-by: Zak Brighton Knight Reported-by: Doug Smythies Cc: All applicable # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume Signed-off-by: Rafael J. Wysocki Tested-by: Zak Brighton Knight Reviewed-by: Zhongqiu Han Acked-by: Viresh Kumar Tested-by: Doug Smythies Tested-by: Christian Loehle Link: https://patch.msgid.link/14150222.uLZWGnKmhe@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 4a4a23b7402228d7977ca58326fa7596322c6ac8 Author: Rafael J. Wysocki Date: Tue Nov 3 20:45:38 2026 +0100 cpufreq: Improve suspend-resume synchronization commit eee2a44e4e2b41c0699919a550d41cc38daa4f42 upstream. The suspend-resume synchronization in the cpufreq core is not perfect because the global cpufreq_suspended variable is set at the end of cpufreq_suspend() after stopping governors for all of the active policies, so the governor .limits() callback may run via cpufreq_governor_limits() after stopping the governor and before setting cpufreq_suspended which is questionable. Likewise, the governor .limits() callback may run between clearing cpufreq_suspended in cpufreq_resume() and starting the governor. Address this by adding a per-policy "suspended" flag that is always read under the policy rwsem and is updated under it when the governor is stopped in cpufreq_suspend() and when the governor is restarted in cpufreq_resume(). Also make cpufreq_resume() use the cpus_read_lock guard to reflect what is done in cpufreq_suspend() and call cpufreq_exit_governor() for policies that were suspended during a system suspend transition and are inactive during the subsequent system resume (to avoid leaking an inactive policy with a stopped governor that has not exited yet). Fixes: 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate") Fixes: b1b12babe3b7 ("cpufreq: update 'cpufreq_suspended' after stopping governors") Cc: All applicable Signed-off-by: Rafael J. Wysocki Tested-by: Zak Brighton Knight Reviewed-by: Zhongqiu Han Acked-by: Viresh Kumar Tested-by: Doug Smythies Tested-by: Christian Loehle Link: https://patch.msgid.link/4796894.LvFx2qVVIh@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 2aad5d276dace271eabdaeef8a65ef263fcea20f Author: Li RongQing Date: Thu Sep 10 19:13:28 2026 +0800 cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() commit 6bc092a0fc4d331a4adbbb664078af149c580834 upstream. When policy->freq_table is built in acpi_cpufreq_cpu_init(), entries that are not lower in frequency than the previous one are skipped. For each remaining entry, freq_table[].driver_data stores the original ACPI P-state index, so the index space of freq_table no longer matches perf->states[]. extract_io() currently walks perf->states[] with index i and uses the same i to index policy->freq_table[i]. When duplicate frequencies exist, this can associate a P-state status with the frequency of a different P-state. It can also access an invalid or sentinel entry in freq_table when the number of entries in perf->states[] is greater than the number of entries remaining in the frequency table. extract_io() is used on ACPI_ADR_SPACE_SYSTEM_IO platforms by the frequency verification path, which is enabled by the acpi_pstate_strict module parameter. With the mismatched lookup, check_freqs() can fail to match the frequency of the P-state that drv_write() has already programmed. It then sleeps through all 100 iterations - at least ~1 ms of usleep_range() plus 100 cross-CPU calls and I/O port reads, all with policy->rwsem held, and .target_index() returns -EAGAIN, leaving perf->state at its previous value while the hardware is running at the newly requested P-state. The cpufreq core consequently keeps policy->cur at the old frequency. Since __cpufreq_driver_target() returns early when the requested frequency equals policy->cur, the driver is not called again for that frequency and the control register is not rewritten. The hardware can therefore remain at a frequency that differs from the frequency known to the cpufreq core. Fix this by iterating over policy->freq_table and using pos->driver_data as the original ACPI P-state index when accessing perf->states[], as extract_msr() already does. Fixes: fe27cb358835 ("[CPUFREQ][2/8] acpi: reorganize code to make MSR support addition easier") Signed-off-by: Li RongQing Reviewed-by: Zhongqiu Han Cc: All applicable Link: https://patch.msgid.link/20260910111329.2220-2-lirongqing@baidu.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 4a378c44d3152877e9a27de79d3ee077c4278db4 Author: Uladzislau Zhauniarovich Date: Thu Nov 5 20:19:45 2026 +0000 arm64: suspend: Only track cpuidle context for idle tasks commit ad3fc05c7e65009355effeea06aa629a687acef2 upstream. Commit 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") moved the calls to ct_cpuidle_enter() and ct_cpuidle_exit() into cpu_suspend() so that arm64 cpuidle could keep RCU watching longer and manage context tracking internally. However, cpu_suspend() is called not only by cpuidle via psci_cpu_suspend_enter() (which runs in the context of the idle task), but also during system suspend via psci_system_suspend_enter() (which runs in the context of the task initiating suspend, such as a process writing to /sys/power/state). When entering system suspend, current is a non-idle task. Calling ct_cpuidle_enter() invokes ct_kernel_exit() from kernel space (!user) on a non-idle task. With CONFIG_RCU_EQS_DEBUG enabled, this violates context tracking invariants and triggers a warning: WARNING: kernel/context_tracking.c:120 at ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118 Call trace: ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118 ct_idle_enter+0x20/0x34 kernel/context_tracking.c:299 ct_cpuidle_enter include/linux/cpuidle.h:134 [inline] cpu_suspend+0x264/0x474 arch/arm64/kernel/suspend.c:136 psci_system_suspend_enter+0x4c/0x80 drivers/firmware/psci/psci.c:544 suspend_enter kernel/power/suspend.c:468 [inline] suspend_devices_and_enter+0x88c/0xd0c kernel/power/suspend.c:533 enter_state kernel/power/suspend.c:618 [inline] pm_suspend+0x498/0x698 kernel/power/suspend.c:644 state_store+0x14c/0x1fc kernel/power/main.c:819 kobj_attr_store+0x6c/0x90 lib/kobject.c:842 sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345 vfs_write+0x51c/0xa0c fs/read_write.c:687 ksys_write+0x12c/0x228 fs/read_write.c:739 A corresponding warning is subsequently triggered in ct_kernel_enter() via ct_cpuidle_exit() upon resume. Fix this by checking is_idle_task(current) in cpu_suspend() and only invoking ct_cpuidle_enter() and ct_cpuidle_exit() when executing in the context of an idle task. Fixes: 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") Cc: Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot Reported-by: syzbot+79883955da3a62652a80@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=79883955da3a62652a80 Link: https://syzkaller.appspot.com/ai_job?id=5359e16f-013b-4850-9cbc-ddfb3bac95e5 Signed-off-by: Uladzislau Zhauniarovich Tested-by: Uladzislau Zhauniarovich Link: https://lore.kernel.org/r/3e92ccb0-2952-4317-af4c-45457c15efae@gmail.com Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 818beee4ba566d6f28eba9889bc98385197dfc4c Author: Mark Brown Date: Thu Nov 5 16:05:05 2026 +0000 arm64: suspend: Save GCS state over suspend commit 7ca488055c69eed71219546deb805811854aca35 upstream. GCSCRE0_EL1 and GCSPR_EL0 are live registers for EL0 on systems with GCS but are not saved and restored by cpu_do_suspend()/cpu_do_resume(). This means that the task that initiated suspend can return to userspace with UNKNOWN or incorrect values for GCSPR_EL0 and GCSCRE0_EL1 (many fields in GCSCRE0_EL1 reset to 0). This will in turn lead to ongoing corruption, including not restoring mode until a task with a different GCS mode is run. Fix this by saving and restoring the values over suspend. This increases the size of struct cpu_suspend_ctx by 16 bytes. Fixes: 5d8b172e7005 ("arm64: Add Kconfig for Guarded Control Stack (GCS)") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 510cc21cc50e465ed550dd8fa56dfbbf89cf903a Author: Mark Brown Date: Thu Nov 5 16:05:04 2026 +0000 arm64: suspend: Save POR_EL0 over suspend commit 2386c3dcf13e39d7576eae821af66537332c02de upstream. POR_EL0 is a live EL0 register on systems with S1POE but it is not saved and restored by cpu_do_suspend()/cpu_do_resume(). This means that the task that initiated suspend can return to userspace with an UNKNOWN value. Fix this by saving and restoring the value over suspend. This increases the size of struct cpu_suspend_ctx. Fixes: bf83dae90fbc ("arm64: enable the Permission Overlay Extension for EL0") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Reviewed-by: Vladimir Murzin Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 176cca9772b9779f16820aedcaa12759bcbc6292 Author: Zhao Gongyi Date: Thu Nov 5 19:30:51 2026 +0800 arm64: ptrace: don't warn on missing siginfo in a group-stop commit 5306f124f3171289b2ef5bac1e08aad175f66d1e upstream. PTRACE_ATTACH to a group-stopped child can enter do_jobctl_trap(), which calls ptrace_stop() without siginfo. If the tracer writes NT_ARM_SYSTEM_CALL, system_call_set() can change syscallno from NO_SYSCALL before update_syscall_orig_x0_after_ptrace() checks last_siginfo. WARN_ON_ONCE(!info) then fires for a valid ptrace stop. Keep the early return when siginfo is absent, but remove the warning. This leaves orig_x0 untouched at a non-seized group-stop and preserves the existing syscall-exit-stop handling. Fixes: 88b839ce497c ("arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry") Cc: stable@vger.kernel.org Signed-off-by: Zhao Gongyi Acked-by: Oleg Nesterov Acked-by: Will Deacon [catalin.marinas@arm.com: modified comment as per Will's suggestion] Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 055b78143cb8d2cd4132dc7f8fd2563495b6f55e Author: Jinjie Ruan Date: Mon Nov 9 12:13:24 2026 +0800 arm64: kexec_file: Do not use CMA for images with a non-zero text_offset commit 18f2d01bfce99a885511c451cba95234eea190bc upstream. image_load() adds text_offset to kernel_segment->mem and subtracts it from kernel_segment->memsz. For CMA backed segments this breaks the load path: the payload is copied to page_address(cma), which is the CMA base, while image->start is set to the adjusted address, so kexec jumps into the middle of the kernel. kimage_map_segment() has the same mismatch when a segment has been moved. The adjusted memsz also breaks the release path: the CMA pages are freed using segment->memsz >> PAGE_SHIFT, which is fewer than were allocated, leaking the tail of the allocation. Both problems are specific to CMA segments, which are accessed through page_address(cma) and ignore segment->mem. The normal load path uses segment->mem, so the text_offset adjustment stays consistent there. Keep honoring text_offset, but load such images from regular memory by setting image->no_cma: they lose the CMA contiguous allocation, but keep working. Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation") Signed-off-by: Jinjie Ruan Cc: Will Deacon Cc: Mike Rapoport Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20260921090450.807575-2-ruanjinjie@huawei.com/ Link: https://lore.kernel.org/all/20260921090450.807575-3-ruanjinjie@huawei.com/ Link: https://lore.kernel.org/all/au4JOjnQlx2aSpiE@arm.com/ Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit c397b00947566278202a26983497acdf3d9416d2 Author: Chris Down Date: Tue Nov 10 20:39:02 2026 -0800 arm64: hugetlb: Prevent write fault livelocks on stale TLB entries commit 3c47ec82540ce89a6fdfd5e0e6d79f35892adfa4 upstream. In Meta production, we have had tasks get stuck in a fault loop while using hugetlb on arm64. During my investigations I found that affected tasks share a private hugetlb page. Looking at the stuck task states, I found the following ordering: CPU0 CPU1 ---- ---- read page [read only entry cached in TLB] write page hugetlb_fault() hugetlb_wp() [reuse folio] set_huge_ptep_maybe_writable() set_huge_ptep_writable() [flush local TLB only] write page using stale entry hugetlb_fault() huge_ptep_set_access_flags() [entry already writable, no flush] retry write using stale entry [fault indefinitely. well, that's not ideal!] The reason is that when a write fault makes a non-contiguous hugetlb entry writable, it only invalidates the local TLB. However, another CPU can keep the old read-only entry, so its write will fault even though the page table already permits it. hugetlb_fault() then finds nothing to change and leaves the stale entry in place, so the same write keeps going round in circles. This is particularly bad because, if the kernel is copying to user memory, the retry stays inside the kernel and the task can't act on the pending signal. It can even remain unkillable while holding locks across the copy, resulting in further failures. For example, a read into a hugetlb buffer can hold the pipe mutex and block other users of the pipe until the loop ends, causing cascading lockups across the machine. To fix this, when a write fault finds nothing to change in a non-contiguous hugetlb entry, let's invalidate the local entry. Fixes: cb1fa2e99955 ("arm64, tlbflush: don't TLBI broadcast if page reused in write fault") Cc: stable@vger.kernel.org Signed-off-by: Chris Down Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 6c9e062b76dc434e51388700a6c792a0b871e663 Author: Beata Michalska Date: Thu Nov 12 20:12:08 2026 +0100 arm64: errata: Add Cortex-A715/A720 AMU core counter workaround commit be777145858218f591b4d9d19f3d40d3ecea9de3 upstream. On Cortex-A715 (erratum 2738462) and Cortex-A720 (erratum 2738461), the AMEVCNTR00 counter may continue incrementing while the core remains in WFE with the clocks being enabled. The resulting core cycle count may become unreliable. Add a workaround that effectively treats the AMU counter as unavailable. Cc: Signed-off-by: Beata Michalska Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 3381364e2641f13f610d0f45c0e15175a08d816d Author: Beata Michalska Date: Thu Nov 12 20:12:07 2026 +0100 arm64: errata: Extend the workaround for broken AMEVCNTR01 counter commit 139a9b7d5a07a570d5f636db02105025ece99e16 upstream. The erratum causing significant inaccuracies in the AMU CNT_CYCLES counter due to WFI/WFE has been identified in additional microarchitectures. Extend the existing workaround to cover these implementations, which are affected by the following errata: - ARM Cortex-A725 erratum 3821522 (SDEN-2832921) - ARM Cortex-A720 erratum 4689339 (SDEN-2439421) - ARM Cortex-A720AE erratum 4689340 (SDEN-3090091) - ARM Neoverse N3 erratum 4689341 (SDEN-3050973) - ARM C1-Pro erratum 4689344 (SDEN-3273080) Cc: Signed-off-by: Beata Michalska Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 3f5d73515faad7bf01b66aaa7c79f633ac1aab78 Author: Mark Brown Date: Thu Nov 5 13:00:12 2026 +0000 arm64/gcs: Ignore attempts to change GCS mode during signal return commit d395db3dcd4c590d26a2f3d581d8d5b7ddbfa478 upstream. If userspace tries to update the GCS mode as part of signal return then we update the thread state but don't update GCSCRE0_EL1, meaning the change does not take effect. We may also get issues for other tasks on context switch since we suppress writes of the register if the two tasks have the same mode. Since no currently known userspace tries to use this functionality close this by ignoring any attempt to change the mode through signal return. The GCS mode for the current thread can be changed using the prctl() interface and will be preserved on signal return, allowing updates to the mode from the signal handler. Reported-by: Catalin Marinas Link: https://lore.kernel.org/r/as-8IqsbMbOBo5Oq@arm.com Suggested-by: Catalin Marinas Fixes: 16f47bb9ac8a ("arm64/signal: Expose GCS state in signal frames") Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 37774263930a2965b7d50b70746b441dee2821c3 Author: Christian Brauner Date: Mon Nov 9 17:51:24 2026 +0100 fs: don't strand I_METADATA_WRITEBACK inodes outside the LRU commit 9b4b26d110f32008134750f82c98e621f2e4758f upstream. Since commit c474bc56b6d1 ("fs: Provide way for filesystem to wait for metadata writeback") ext2, ext4 without a journal, fat, udf and minix set I_METADATA_WRITEBACK on an inode whose metadata was copied into a buffer that might not have reached the disk yet. Only data integrity writeback, i.e. fsync() and friends, clears it again. The flusher and sync(2) leave it alone. inode_lru_isolate() treats every state bit other than I_REFERENCED as a reason not to reclaim the inode right now. It takes the inode off the LRU and relies on iput(), writeback completion or the removal of the last page from the page cache to put it back once the reason is gone. But I_METADATA_WRITEBACK doesn't go away on its own. iput() puts the inode back on the LRU with the bit still set and the next scan takes it off again. So neither memory pressure nor drop_caches can free these inodes. Only fsync() and friends or unmounting the filesystem get rid of them. On ext4 without a journal ext4_mark_iloc_dirty() sets the bit on every ext4_mark_inode_dirty(), so even an atime update is enough. An unprivileged user creating or touching lots of files grows the inode cache without bound until the OOM killer comes along. The inode can't just be thrown away though. An fsync() after the inode was read back in wouldn't know that its metadata still has to be written out. So let the shrinker reclaim inodes with I_METADATA_WRITEBACK like any other clean inode and make evict() write out what the bit tracks unless the inode is being deleted. Since the previous patch the bit covers the tracked metadata buffers as well, and since the lookup patches ->sync_inode_metadata() doesn't read anything from disk for that. It writes and waits for whatever is still dirty or under writeback. The mmb_sync() calls in ->evict_inode() are redundant with that and the following patches drop them. Handing these inodes to a work item that syncs them and puts them back on the LRU would work too. But that's a second inode reclaim offload mechanism next to the deferred inode reclaim that is being worked on, and it needs a reference on the inode which leaks into remount, freeze and umount. For stable this needs the previous patches as well. Without the lookup changes evict() ends up reading inode blocks from disk with __GFP_NOFAIL allocations from reclaim. v7.3 also still has bfs which sets I_METADATA_WRITEBACK too and reads the inode block in bfs_sync_inode_metadata(), so the backport needs the cache-only lookup for bfs as well. Fixes: c474bc56b6d1 ("fs: Provide way for filesystem to wait for metadata writeback") Cc: stable@vger.kernel.org # v7.3; see patch description Reported-by: Josef Bacik Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-9-91ac6c024018@kernel.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 730fb5d6fcd6062c3264cc782e5efd05688a91e6 Author: Cheng Yongkang Date: Thu Oct 29 07:12:20 2026 -0700 fs/splice: clamp an over-reported write_iter result commit 2d956723e82cddae8ff8e9da99a666217b02065f upstream. iter_file_splice_write() builds a bvec iterator of at most sd.total_len - left bytes and passes it to ->write_iter(). It then subtracts the returned length from sd.total_len and walks the pipe buffers by that length. A ->write_iter() implementation that reports more bytes than the iterator held makes sd.total_len underflow and the dismissal loop advance pipe->tail past pipe->head, releasing a zeroed pipe buffer: Splice Exceeded! ret=7 tot=1 left=0 Oops: general protection fault RIP: 0010:iter_file_splice_write+0xb6f/0x1170 Commit a3de58b12ce0 ("netfs: Fix unbuffered write error handling") added the warning for this condition but only reports it. Clamp the return value to the size of the iterator that was actually handed to ->write_iter(), so the pipe accounting stays consistent even when a producer violates the iterator contract. Fixes: 8d0207652cbe ("->splice_write() via ->write_iter()") Cc: stable@vger.kernel.org Signed-off-by: Cheng Yongkang Link: https://patch.msgid.link/179328314072.648427.13388575162083843840@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit c8384cc688e7c22ad955369dad56e98503b93f82 Author: Cheng Yongkang Date: Thu Oct 29 07:12:20 2026 -0700 fs/proc: fix the write length returned by proc_sys_call_handler() commit fbdc020ee1b82079102e493aaa7200de5f497a38 upstream. proc_sys_call_handler() reads the write length from iov_iter_count() and copies that many bytes from the iterator into kbuf. A cgroup/sysctl BPF program can replace the new value through bpf_sysctl_set_new_value() and update count to the length of the replacement value. The handler then returns that adjusted count as the number of bytes written, even though the iterator originally held a different number of bytes. If the replacement value is longer than the original input, ->write_iter() reports more bytes than the iterator held. splice(2) passes that value to iter_file_splice_write(), which subtracts it from the pipe length and walks past the pipe head: Splice Exceeded! ret=7 tot=1 left=0 Oops: general protection fault RIP: 0010:iter_file_splice_write+0xb6f/0x1170 The write path consumes at most the original iterator length in copy_from_iter_full() before the BPF hook runs. Return the smaller of the adjusted and original counts on the write path, so an expanded BPF value cannot exceed the iterator while a handler that reports a shorter parsed length still produces a short write. The read path keeps using the adjusted count for copy_to_iter(). Fixes: 4e63acdff864 ("bpf: Introduce bpf_sysctl_{get,set}_new_value helpers") Cc: stable@vger.kernel.org Signed-off-by: Cheng Yongkang Link: https://patch.msgid.link/179328314073.648427.7892850166511253762@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit f8944a8761d291728e318358d13ac6c41078da51 Author: HyeongJun An Date: Wed Jul 15 20:52:31 2026 +0900 fs/adfs: bound directory entry name length in adfs_fplus_getnext() commit ebf5025b0d989f95542fc9da899b7de2fec499f2 upstream. adfs_fplus_getnext() reads the per-entry name length bigdirobnamelen straight from the on-disk big directory and passes it to adfs_dir_copyfrom() as the copy length into obj->name[], a fixed ADFS_MAX_NAME_LEN (260) byte buffer. adfs_dir_copyfrom() only bounds the copy against the number of directory buffers, not the size of the destination, so a crafted image with bigdirobnamelen larger than the buffer overflows the stack-allocated object_info::name that adfs_fplus_iterate() passes in. adfs_object_fixup() may additionally append a four byte ",xyz" filetype suffix, so the accepted length must also leave room for that. The old-style directory parser (dir_f.c) already clamps names to ADFS_F_NAME_LEN, and adfs_fplus_validate_header() validates the header name fields, but the per-entry name length in the big directory format was never checked. Reject over-long entries, using -EIO as elsewhere in this file for a corrupt big directory. Reported-by: Hyungjung Joo Closes: https://lore.kernel.org/all/CAP_j_b9BqyQrk3D5nj6RSa=eGcs2HkRYsWc3WdXeXp9O3=z4nQ@mail.gmail.com/ Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: HyeongJun An Link: https://patch.msgid.link/20260715115231.1585166-1-sammiee5311@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 64d0ad85eaad4fb63e7c40813fa2a559a46a04d9 Author: Christian Brauner Date: Mon Nov 9 17:51:19 2026 +0100 ext4: don't read the inode block in ext4_sync_inode_metadata() commit 2ca2e88b106175c1037939de52cb28e4cb545b9e upstream. Without a journal ext4_sync_inode_metadata() looks the inode table block up with __ext4_get_inode_loc_noinmem() which reads it from disk, with readahead of the inode table on top, if it isn't cached. But a block that isn't cached is neither dirty nor under writeback, so there's nothing to write or to wait for. That read is also something we can't afford once inode eviction calls ->sync_inode_metadata() from reclaim. So look the block up with ext4_get_inode_loc_noio() instead and treat -EAGAIN as nothing to do. Note that ext4_get_inode_loc_noio() also returns -EAGAIN for a block that isn't uptodate. Such a block is being read or failed to be read and can't be dirty either. A block whose write failed still counts as uptodate for ext4_buffer_uptodate() so the write error still gets reported. Suggested-by: Jan Kara Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-4-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit cbf7675f33cda3c3637279784b5e14b1fd9af8d8 Author: Christian Brauner Date: Mon Nov 9 17:51:18 2026 +0100 ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio() commit d25c14b2d79e4e8292b19041efd1aae4057bf383 upstream. ext4_get_inode_loc_noio() looks the inode table block up with sb_find_get_block(). That's the atomic lookup. It serializes against try_to_free_buffers() with i_private_lock instead of the folio lock and gives up if the folio is being migrated. So it can report the block as not cached while it is. For ext4_fc_snapshot_inode() that only means falling back to a full commit. But ext4_sync_inode_metadata() is going to use ext4_get_inode_loc_noio() to find the inode block that fsync() has to write out and there a dirty block must not be skipped. ext4_fc_snapshot_inode() is the only caller and it can sleep. It runs under jbd2_journal_lock_updates() and allocates the snapshot with GFP_NOFS. So use sb_find_get_block_nonatomic() which takes the folio lock and waits for the migration instead. Suggested-by: Jan Kara Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-3-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 2ffc1c158917f18dbfb6a1bed124a1f8fd110592 Author: Christian Brauner Date: Mon Nov 9 17:51:17 2026 +0100 ext2: don't read the inode block in ext2_sync_inode_metadata() commit c2e595a57aba6aa166053776969f31cc510b3e71 upstream. ext2_sync_inode_metadata() looks the inode block up with ext2_get_inode() which reads it from disk if it isn't cached. But a block that isn't cached is neither dirty nor under writeback, so there's nothing to write or to wait for. That read is also something we can't afford once inode eviction calls ->sync_inode_metadata() from reclaim. So look the block up with sb_find_get_block_nonatomic() instead, the way fat_sync_inode_metadata() already does. Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-2-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit a958f219b2ea00ed3020656fcbc68e79cfc4b6d4 Author: Christian Brauner Date: Mon Nov 9 17:51:16 2026 +0100 ext2: add ext2_inode_block() helper commit 57a84ef0520b0d17e930ff15cbd13af687e6d233 upstream. Move the lookup of the inode table block that holds an inode out of ext2_get_inode() into a helper. ext2_sync_inode_metadata() is going to use it to find the block without reading it from disk. No functional changes. Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-1-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 427aa48d8c74d14846787fbf95141b3ab0d8b333 Author: Josef Bacik Date: Fri Oct 30 13:38:24 2026 +0100 dcache: let umount find a disconnected ex-mountpoint commit 32e564e222b7ca3811b2acee404b73fcaf43f312 upstream. When a mount goes away the reference to its mountpoint is dropped with dput_to_list() and namespace_unlock() evicts the dentry after dropping namespace_sem. Nothing pins the filesystem at that point so it can be unmounted at the same time. That's fine as long as shrink_dcache_for_umount() finds the dentry. It then either evicts it itself or waits for the eviction to finish. But it can't find a disconnected root as those are neither in the tree nor on ->s_roots. And they can be mounted on: fd = open_by_handle_at(mnt_fd, handle of a file with no dentry, O_PATH); tree = open_tree(AT_FDCWD, "/tmp/x", OPEN_TREE_CLONE); move_mount(tree, "", fd, "", MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH); close(fd); thread A thread B umount2("/proc/self/fd/", MNT_DETACH) namespace_unlock() up_write(&namespace_sem) umount of the filesystem shrink_dcache_for_umount() evict_inodes() "Busy inodes after unmount" shrink_dentry_list() dentry_kill() iput() of an inode of a superblock that is gone So put such a dentry on ->s_roots when it's put on the shrink list. From then on it's a secondary root like any other. This needs the previous patch. Otherwise do_one_tree() takes the dentry off ->s_roots and umount doesn't wait for an eviction in progress. The stable tag is narrower than the Fixes tag on purpose. Before commit e9895609cb7f ("wind ->s_roots via ->d_sib instead of ->d_hash") umount doesn't wait for a secondary root that is being evicted either. Fixes: 4edbe133f851 ("make struct mountpoint bear the dentry reference to mountpoint, not struct mount") Cc: stable@vger.kernel.org # v7.2+ Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-3-cd6b86e0ccc7@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 47f4eabefeea071d628969a072265dd4c9b55f73 Author: Josef Bacik Date: Fri Oct 30 13:38:23 2026 +0100 dcache: wait for a racing eviction of a secondary root commit 649918e04e0ead9bfc861aacdd2e5b39b5bdf869 upstream. Commit e9895609cb7f ("wind ->s_roots via ->d_sib instead of ->d_hash") keeps a secondary root on ->s_roots until dentry_unlist() so that shrink_dcache_for_umount() can find one that another thread is evicting and wait for it. But do_one_tree() takes every root off the list before its dput() which breaks that: thread A umount dentry_kill(root), refcount is 0 lock_for_kill() spin_trylock(->i_lock) fails spin_unlock(->d_lock) shrink_dcache_for_umount() dget_dlock(root) do_one_tree(root) unlink_secondary_root(root) spin_lock(->i_lock) dput(root), refcount is 0 lock_for_kill() trylock fails, waits spin_lock(->d_lock) refcount is 0 again, go on lockref_mark_dead() dentry_unlink_inode() drops both locks root is dead, give up ->s_roots is empty, done evict_inodes() "Busy inodes after unmount" iput() Thread A evicts without pinning the superblock. namespace_unlock() does that for old mountpoints after dropping namespace_sem, and a secondary root goes with its last child. So only take busy roots off the list. Leave the others to dentry_unlist() so that shrink_dcache_for_umount() finds them and waits for an eviction in progress. A root that becomes busy after the check is picked up again and taken off the list then. Fixes: 78db93943210 ("dcache: keep shrink_dcache_for_umount() making progress on busy roots") Cc: stable@vger.kernel.org # v7.2+ Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-2-cd6b86e0ccc7@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 86a1ac57fa7fc93c229fe060dd42947631f9c82c Author: Christian Brauner Date: Fri Oct 30 13:38:22 2026 +0100 dcache: let d_invalidate() wait for a d_set_mounted() in flight commit 20a6a9ec19e522ae85f87337886b3fb47efce5f3 upstream. d_invalidate() and d_set_mounted() are supposed to exclude each other. Either the mount fails with -ENOENT because an ancestor of the mountpoint was unhashed or d_invalidate() finds the mountpoint and detaches the mount. d_invalidate() unhashes the dentry first and then searches the subtree with d_walk() which starts out lockless and only looks at the seqcount of rename_lock. Since d_set_mounted() switched to read_seqlock_excl() nothing makes that walk wait or retry: CPU0: mount on A/M CPU1: d_invalidate(A) d_set_mounted(M) read_seqlock_excl(&rename_lock) A is hashed, go on __d_drop(A) shrink_dcache_parent(A) d_walk(A, find_submount) read_seqbegin(&rename_lock) M is not a mountpoint need_seqretry() == false return M->d_flags |= DCACHE_MOUNTED return 0 mount gets attached to M The mount ends up below an unhashed dentry. It can't be reached anymore and pins the subtree until its parent mount or the mount namespace goes away. The window grows with the depth of the mountpoint. With a FUSE directory 3000 levels deep a bind mount racing with FUSE_NOTIFY_INVAL_ENTRY for the parent of the mountpoint survived in 151 of 200 attempts. Before 5e317d23f6c6 the seqcount bump made the walk wait while d_set_mounted() ran and retry under the lock when one had run in the meantime. That was the right thing to wait for on the wrong counter: every rename_lock reader paid for it, d_lookup(), d_path(), the ".." step of the RCU walk. So give d_set_mounted() a seqlock of its own. It is the only writer and d_invalidate() is the only reader. After unhashing the dentry d_invalidate() runs an empty read_seqbegin()/read_seqretry() section on it. That spins while the count is odd, i.e. while a d_set_mounted() is between its ancestor check and its flag, and goes round once more if one started in the meantime. Nobody else retries anything. The ordering comes from the locks both already take: - If that d_set_mounted() saw the dentry hashed its check ran under the dentry's d_lock before __d_drop() took it. So the count is odd by the time d_invalidate() reads it and d_invalidate() waits. - Once the count is even again the flag has been set under the mountpoint's d_lock and the walk takes that lock to look at it. A d_set_mounted() that starts after the unhash fails its ancestor check and never touches the flag. So the only flag the walk can pick up belongs to the one mount that saw the dentry hashed and is still in flight, and there is at most one of those because namespace_sem serializes mounts. Either it gets attached and detach_mounts() takes it off after waiting for namespace_sem or it fails later on and drops the flag again. In that case the walk goes round once more and finds nothing. The same goes for the mountpoint that attach_recursive_mnt() preallocates on the root of the tree it attaches. IOW, d_invalidate() does at most one extra round, which the removed-name trap (cf. [1]) relies on. Note that on PREEMPT_RT read_seqbegin() takes the lock instead of spinning on a preempted d_set_mounted(). The cost is a seqlock around the ancestor walk for every new mountpoint and two loads of a cacheline that only d_set_mounted() writes for every d_invalidate() of a positive dentry. Walking the ancestors a second time after setting the flag would close the race as well but doubles the cost of d_set_mounted() with the depth of the mountpoint: about 1us at 64 levels and 75us at 4096 levels. [1]: https://patch.msgid.link/20261028-work-mount-trap-b4-v1-0-f20d9d0730d6@kernel.org Fixes: 5e317d23f6c6 ("d_set_mounted(): we don't need to bump seqcount component of rename_lock") Reported-by: Josef Bacik Cc: stable@vger.kernel.org # v6.17+ Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-1-cd6b86e0ccc7@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit ef857caf7f0ec6380d927b37a1b5378d0ac01e29 Author: Jérémy Jean Date: Fri Oct 16 07:50:31 2026 +0000 crypto: essiv - fix use-after-free in AEAD path commit e9ce64dce975a14700e835003847415e29918474 upstream. The request that ESSIV submits to its wrapped AEAD transform may finish before crypto_aead_encrypt() or crypto_aead_decrypt() returns. In case this happens, essiv_aead_done() calls aead_request_complete() on the original ESSIV request, which can end up freeing the request before essiv_aead_crypt() resumes, creating a UAF: BUG: KASAN: slab-use-after-free in essiv_aead_crypt+0x8e6/0x950 Read of size 8 at addr ffff888102af1360 by task init/66 Check the return status before dereferencing rctx after submitting that request. If the operation did not return -EINPROGRESS or -EBUSY, then the request cannot have been freed yet. Fixes: be1eb7f78aa8 ("crypto: essiv - create wrapper template for ESSIV generation") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Jérémy Jean Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman commit 49915365ba3f6bb99f79bf81052166ea3b1e1cf6 Author: Jérémy Jean Date: Thu Oct 8 09:35:53 2026 +0000 crypto: caam - reject overlong RSA CRT parameters commit 828c3b265b6df877dced3dde56ea41daa2e6181e upstream. caam_read_rsa_crt() right-aligns dP, dQ, and qInv in buffers sized from the corresponding prime. rsa_parse_priv_key() only bounds these integers against n, so a malformed key can provide, for example, a two-byte dP with a one-byte p. dstlen - nbytes then underflows and memcpy() writes outside the allocation during set_priv_key(). KASAN reports a slab-out-of-bounds write in caam_read_rsa_crt(). Reject empty or overlong CRT parameters after stripping leading zeros. qInv is consumed by CAAM as a p-sized value, so size it from p rather than q to match the DMA mapping in set_rsa_priv_f3_pdb(). Let the top-level key cleanup handle partial form-3 allocations and return the specific error to the caller. Also test nbytes before dereferencing it while stripping zeros, so an all-zero integer does not read one byte beyond its input. Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Jérémy Jean Reviewed-by: Sahil Malhotra Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman commit e3a9c67da7ba491c8fa238aeffdb65becf846245 Author: Mani Tofigh Date: Sun Nov 1 14:56:15 2026 -0500 cgroup: arm the notify timer only while the file exists commit fffbdad76a57eed26cff1be19f4cbb407f0b6e7c upstream. cgroup_rm_file() clears cfile->kn under cfile->lock and then deletes the notify timer. Since commit 4616120fca7f ("cgroup: add lockless fast-path checks to cgroup_file_notify()"), cgroup_file_notify() checks kn and arms the timer without that lock and can arm it right after it was deleted: Task A (memcg charge) Task B (subtree_control write) cgroup_file_notify() READ_ONCE(cfile->kn) != NULL cgroup_rm_file() cfile->kn = NULL timer_delete_sync() timer_reduce(&cfile->notify_timer) /* timer queued again */ If the css is only hidden, showing it again runs timer_setup() on the still queued timer and corrupts the timer wheel: [ 14.324093] ODEBUG: init active (active state 0) object: 0000000009e526fd object type: timer_list hint: cgroup_file_notify_timer+0x0/0x10 [ 14.324123] WARNING: lib/debugobjects.c:629 at debug_print_object+0x1a4/0x3b0, CPU#1: cgnotify/64 [ 14.329806] CPU: 1 UID: 0 PID: 64 Comm: cgnotify Tainted: G W 7.3.0-17087-gd865f2677c44 #1 PREEMPT [ 14.335109] RIP: 0010:debug_print_object+0x1ae/0x3b0 [ 14.354351] Call Trace: [ 14.354927] [ 14.356650] __debug_object_init+0x203/0x3c0 [ 14.361799] timer_init_key+0x2c/0x240 [ 14.362682] cgroup_addrm_files+0x754/0xc40 [ 14.366744] css_populate_dir+0x12e/0x440 [ 14.368636] cgroup_apply_control_enable+0x2f3/0xb60 [ 14.371769] cgroup_subtree_control_write+0x740/0xc10 [ 14.376924] cgroup_file_write+0x19e/0x700 [ 14.381809] kernfs_fop_write_iter+0x337/0x510 [ 14.382818] vfs_write+0x545/0x1250 [ 14.386491] ksys_write+0xfa/0x200 [ 14.390144] do_syscall_64+0xfb/0x590 [ 14.390994] entry_SYSCALL_64_after_hwframe+0x77/0x7f If the css is freed instead, the timer can fire on freed memory. Arm the timer under cfile->lock after checking kn again and keep only the kn and timer_pending() checks outside the lock. With the fix, the timer stays idle once the file is removed. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development. The C reproducer below however hits it within a minute. Fixes: 4616120fca7f ("cgroup: add lockless fast-path checks to cgroup_file_notify()") Cc: stable@vger.kernel.org Signed-off-by: Mani Tofigh Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit e045192f11a3e16624a61caefe1fc947084b5705 Author: Tejun Heo Date: Thu Nov 5 09:19:51 2026 -1000 cgroup/freezer: Fix exiting tasks left frozen forever after rmdir commit e1aed52b68a361f6fc047b24a37d9ec4d928a158 upstream. Since 93618edf7538 ("cgroup: Defer css percpu_ref kill on rmdir until cgroup is depopulated"), rmdir succeeds once cgroup.procs is empty, but exiting tasks hidden from it can stay in the cgroup until their final context switch. If such a task is frozen in a v1 freezer cgroup, nothing is left to thaw it after rmdir: freezer.state is gone with the cgroup, and a THAWED write to an ancestor clears only CGROUP_FREEZING_PARENT. 8ab6980c7007 ("cgroup/freezer: walk exiting tasks in the v1 freezer") made the freezer walks include exiting tasks. A FROZEN write now also freezes a hidden task in a freezable sleep on its exit path. The fix depends on that commit, as the thaw reaches hidden tasks through the same walk. Since 81933038f5e2 ("pid_namespace: make zap_pid_ns_processes() freezable"), an exiting pid namespace init sleeps that way until a parent outside the namespace reaps a zombie in it. Thaw the cgroup from ->css_killed(), as a THAWED write to it would. A descendant removed earlier can still hold hidden tasks frozen through CGROUP_FREEZING_PARENT. The thaw reaches it too, as its css stays online until its tasks are gone. rmdir removes freezer.state only after ->css_killed() returns, and a write to it takes no cgroup_mutex. A FROZEN write after the thaw would freeze the removed cgroup again, so refuse to freeze a dead cgroup. Verified with a reproducer, including under a frozen parent, from an already removed child and with a racing FROZEN write. Fixes: 93618edf7538 ("cgroup: Defer css percpu_ref kill on rmdir until cgroup is depopulated") Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Tejun Heo Reviewed-by: Tao Cui Tested-by: Tao Cui Signed-off-by: Greg Kroah-Hartman commit d419862267975e376e43e158078c18729a389d66 Author: Mani Tofigh Date: Tue Nov 3 13:09:20 2026 -0500 cgroup/freezer: walk exiting tasks in the v1 freezer commit 8ab6980c70076db5f8c0c66a5fac06472b254333 upstream. An exiting task can stay frozen after its v1 freezer cgroup is thawed. Since commit a72f73c4dd9b ("cgroup: Don't expose dead tasks in cgroup") the css task walk hides an exiting task once its process has no live threads left. That count drops when another thread of the process exits, which can happen between the freeze and the thaw walk. A pid namespace init hits this easily since it waits freezably in zap_pid_ns_processes() after commit 81933038f5e2 ("pid_namespace: make zap_pid_ns_processes() freezable"): Task A (pid ns init) Task B (A's thread) Task C do_exit() exit_signals() do_exit() zap_pid_ns_processes() write FROZEN /* A frozen */ /* live count 0 */ write THAWED /* A skipped */ A then stays frozen even after SIGKILL: [ 10.775155] task:fz-init state:D stack:28152 pid:65 tgid:65 ppid:1 task_flags:0xc0004c flags:0x00080000 [ 10.775176] Call Trace: [ 10.775180] [ 10.775188] __schedule+0x10f1/0x4760 [ 10.775252] schedule+0xd7/0x2c0 [ 10.775265] zap_pid_ns_processes+0x2c7/0x5f0 [ 10.775346] do_exit+0x1bf4/0x2560 [ 10.775403] __x64_sys_exit+0x3d/0x50 [ 10.775414] x64_sys_call+0x156c/0x1570 [ 10.775425] do_syscall_64+0xfb/0x590 [ 10.775450] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 10.775529] Use CSS_TASK_ITER_WITH_DEAD in the three v1 freezer walks so they all see the same tasks, as commit 60f21a264930 ("cgroup, sched_ext: Include exiting tasks in cgroup iter") did for sched_ext. With the fix, A is thawed and exits. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development. The C reproducer below however hits it within about 10s. Fixes: a72f73c4dd9b ("cgroup: Don't expose dead tasks in cgroup") Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Mani Tofigh Reviewed-by: Tao Cui Tested-by: Tao Cui Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit d51357affc3cfd485c14eb7f03cbe68366a51226 Author: Ridong Chen Date: Sat Nov 14 20:05:32 2026 +0800 cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug commit acec9637e03ca54bd3c3a0c1a6ad5c6dfa07c0df upstream. When a CPU hotplug leaves no CPU outside of the partitions for the top cpuset, cpuset_handle_hotplug() clears subpartitions_cpus and gives all the active CPUs back to the top cpuset. cpuset_hotplug_update_tasks() then walks the hierarchy and invalidates the partitions, as subpartitions_cpus is empty. However, an invalid partition visited in the same walk may be revived if its effective_xcpus is not empty. tasks_nocpu_error() doesn't catch it when its CPUs are all offline but it has no task. Its CPUs are put back into subpartitions_cpus, and the valid partitions visited after it are no longer invalidated, as subpartitions_cpus is not empty any more. The top cpuset is left with CPUs overlapping with these partitions. It can be reproduced on a system with 8 CPUs: # cd /sys/fs/cgroup # echo +cpuset > cgroup.subtree_control # mkdir A1 B1 # echo 1 > A1/cpuset.cpus # echo 1 > A1/cpuset.cpus.exclusive # echo 0,2-7 > B1/cpuset.cpus # echo root > B1/cpuset.cpus.partition # echo root > A1/cpuset.cpus.partition # cat A1/cpuset.cpus.partition root invalid (Parent unable to distribute cpu downstream) # echo 0 > /sys/devices/system/cpu/cpu1/online # cat A1/cpuset.cpus.partition B1/cpuset.cpus.partition root root # cat cpuset.cpus.effective 0,2-7 A1 can't take CPU 1, the last CPU of the root cgroup which has tasks. When CPU 1 is offlined, A1 is revived without any active CPU, and B1 stays valid while its CPUs are also in the effective CPUs of the root cgroup, which triggers WARNING: kernel/cgroup/cpuset.c:919 at rebuild_sched_domains_locked Only revive an invalid partition in hotplug if its effective_xcpus has an active CPU, the same as what is required to create a partition with tasks. With that, A1 and B1 are both invalidated in the above case. Fixes: 0c7f293efc87 ("cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2") Cc: stable@vger.kernel.org # v6.7+ Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261114083124.1340140-1-ridong.chen%40linux.dev?part=11 Signed-off-by: Ridong Chen Reviewed-by: Waiman Long Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit 6d916036615b0546ef4dca6f79b35d5ab269bfbe Author: Waiman Long Date: Mon Nov 9 21:24:00 2026 -0500 cgroup/cpuset: Correctly set isolated_cpus when switching partition state commit 56681bc448a80bb2473026b41c44c133766bc38d upstream. When update_prstate() is called to switch the partition state from root to isolated or vice versa, the whole effective_xcpus is passed to isolated_cpus_update(). However, if there are child partitions present, some of the effective_xcpus are dedicated to those child partitions and their partition states will remain the same or get invalidated in the case of child root partition with isolated parent in the latter update_cpumasks_hier() call. In the latter case, their exclusive CPUs will be returned to their parent. Therefore isolated_cpus may be set incorrectly with child partitions underneath. Fix that by excluding their exclusive CPUs in computing the correct cpumask of exclusive CPUs used by that partition alone. Add new test cases into test_cpuset_prs.sh to test for such cases. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Cc: stable@vger.kernel.org # v6.8+ Signed-off-by: Waiman Long Reviewed-by: Ridong Chen Tested-by: Ridong Chen Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman commit 08f9605b6b896be80bba555d32df54786c80d44d Author: Zhao Li Date: Mon Nov 9 21:21:43 2026 +0800 Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel commit 1f2ac56137c51be0601e18a163d817e02a15913f upstream. Reading buffered ERTM data after ACL link loss can clear local busy and send a supervisory frame after l2cap_conn_del() has destroyed the HCI channel, which oopses on a NULL pointer in hci_send_acl(). The socket still owns its L2CAP channel, so its lifetime does not protect the underlying HCI channel. Require BT_CONNECTED before clearing local busy in recvmsg. The socket lock already held here serializes this check and send with teardown, which closes the socket before the HCI channel is destroyed. Continue to allow buffered data to be read after disconnection. AI assistance was used. Fixes: 61aa4f5b9f43 ("Bluetooth: Use the transmit state machine for busy state changes") Cc: stable@vger.kernel.org # needs adjustments for 5.15 Signed-off-by: Zhao Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman commit a545b76352dc02c3d3b85b3567f9bfd3abbca65a Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Thu Nov 5 13:56:45 2026 +0800 Bluetooth: hci_qca: fix use-after-free in ibs debugfs files commit eeca795cec6d9c6c193c2c1bd0cb26cde44f9fc3 upstream. qca_debugfs_init() creates an "ibs" directory under hdev->debugfs and stores pointers to fields of struct qca_data in the debugfs files. qca_close() frees qca_data without removing that directory, while hdev->debugfs is only removed when the HCI device is released. The HCI device can outlive the driver data, for example when an HCI socket still references it, so reading or writing one of the ibs files then dereferences freed memory. Store the directory dentry in struct qca_data and remove the directory with debugfs_remove_recursive() before qca_data is freed. debugfs_remove() waits for callers that are already inside the file operations, and any later access fails with -EIO instead of reaching the debugfs helpers. This covers the two writable files as well. Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261102113654.8724-1-25031212351%40stu.xidian.edu.cn Fixes: 0ff252c1976d ("Bluetooth: hciuart: Add support QCA chipset for UART") Cc: stable@vger.kernel.org Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Reviewed-by: Bartosz Golaszewski Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman commit 1c8374b58ecb1482b39b7ad05bc142a9ab9f80b6 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Thu Nov 5 13:56:39 2026 +0800 Bluetooth: btusb: fix use-after-free in force_poll_sync commit 868c886f45f7c10dc888b94c6993352702a84d04 upstream. The force_poll_sync debugfs file uses the driver's struct btusb_data as its private data. The file is created under hdev->debugfs and is removed only when the HCI device is released, while btusb_disconnect() frees btusb_data unconditionally. The HCI device can outlive the driver data, for example when an HCI socket still references it, so reading or writing the already opened file then dereferences freed memory: BUG: KASAN: slab-use-after-free in force_poll_sync_read+0x129/0x140 Read of size 1 at addr ffff88800cfb7038 ... Freed by task ...: kfree btusb_disconnect Remove the debugfs file before the private data is freed. debugfs_remove() waits for callers that are already inside the file operations, and any later access fails with -EIO instead of reaching the driver, so the force_poll_sync file can no longer dereference btusb_data after it is gone. Fixes: 800fe5ec302e ("Bluetooth: btusb: Add support for queuing during polling interval") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman commit 8d7fe9e709c8fc46afcb5a2c696f1706a7440bd2 Author: Baoli Zhang Date: Mon Nov 9 08:56:04 2026 +0800 ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup commit e5c09fe3f9c8d9da33b177ee432db15b6ab46884 upstream. sof_ipc4_widget_setup_comp_process() allocates the input and output pin format arrays via sof_ipc4_get_audio_fmt(). When the following sof_ipc4_widget_setup_msg() fails, e.g. because the firmware does not provide a module matching the widget UUID, the error path jumps to the 'err' label, which frees the process struct and clears swidget->private but skips sof_ipc4_free_audio_fmt(). The arrays are then unreachable and are reported by kmemleak: sof_ipc4_get_audio_fmt+0xc9/0x420 [snd_sof] sof_ipc4_widget_setup_comp_process+0x8e/0x200 [snd_sof] snd_sof_load_topology+0x71a/0x840 [snd_sof] sof_pcm_probe+0x77/0x120 [snd_sof] snd_soc_component_probe+0x21/0x60 [snd_soc_core] ... Jump to 'free_available_fmt' instead, as the other process widget error paths after sof_ipc4_get_audio_fmt() already do. The other IPC4 widget setup functions (pga, mixer, src, asrc) free the audio formats in their common error label and are not affected. Fixes: f9efae954905 ("ASoC: SOF: ipc4-topology: Add support for base config extension") Cc: stable@vger.kernel.org Signed-off-by: Baoli Zhang Acked-by: Peter Ujfalusi Link: https://patch.msgid.link/20261109005604.1004362-1-baoli.zhang@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 3cb7a7cc7afd3b658763fb80f1d33fc67551d30a Author: Michael McAllister Date: Wed Oct 21 21:42:02 2026 +0100 ASoC: qcom: q6asm: Reset PCM positions when preparing a stream commit 54e89fab723d5a374972d3f5c3e0b89ae055bd18 upstream. Preparing an existing PCM stream closes the DSP stream and remaps its buffers, but leaves queue_ptr, dsp_buf and hw_ptr at their previous positions. ALSA resets appl_ptr during prepare, so q6asm_dai_ack() can subtract a stale queue_ptr from the new appl_ptr and queue an incorrect number of periods. On the Motorola Moto G10, playback works after opening the PCM device, but the first write after snd_pcm_drop() and snd_pcm_prepare() fails with -EBUSY and "Error queuing playback buffer -16". Reset queue_ptr in prepare, and reset the DSP buffer index and hardware pointer when allocating the new buffer ring. This keeps the queued, submitted and completed positions aligned with the new PCM stream. Fixes: e386c2cf3df2 ("ASoC: qcom: q6asm-dai: schedule all available frames to avoid dsp under-runs") Fixes: 44432315444c ("ASoC: qcom: q6asm-dai: use q6asm_get_hw_pointer") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Michael McAllister Link: https://patch.msgid.link/20261021204202.43738-1-me@michaelmcallister.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit c6ce18491e3215fb5675ef97ce0f49182f208fd9 Author: Bartosz Golaszewski Date: Thu Nov 5 16:46:45 2026 +0100 power: sequencing: pcie-m2: fix serdev controller reference leak commit b149b12f6a52997eded725ae5deae24620dbbbff upstream. In pwrseq_pcie_m2_create_serdev_one(), if serdev_ctrl->serdev is NULL but pdev is already tracked in ctx->pci_devices, we return early from the loop and skip the serdev_controller_put(), leaking the reference. Initialize ret to 0 and jump directly to the label that ensures the reference is released. Cc: stable@vger.kernel.org Closes: https://sashiko.dev/#/bug/linux-07754192-a8ad-42d6-ab1b-cd6f16bec846 Fixes: c4be520907a4 ("power: sequencing: pcie-m2: Create serdev for PCI devices present before probe") Link: https://patch.msgid.link/20261105-pwrseq-pcie-m2-serdev-ref-leak-v1-1-e2e022ca17ec@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 965765f5a9af841904e89f62e706ef5fc1eaa146 Author: Bartosz Golaszewski Date: Thu Nov 5 09:28:35 2026 +0100 power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable() commit cd5f26ed96604b18e4235052525abe6b4ba505d6 upstream. During device teardown or on the probe error path, a concurrent consumer access triggers a use-after-free in pwrseq_pcie_m2_vregs_enable() or pwrseq_pcie_m2_vregs_disable() due to a lifetime inversion between devm-managed device registration and manual resource cleanup. The driver exposes the power sequencer using devm_pwrseq_device_register(), meaning the device remains fully registered and accessible on the pwrseq_bus until the driver core schedules devm_pwrseq_device_unregister() to run after pwrseq_pcie_m2_remove() returns. However, the driver performs manual resource teardown within pwrseq_pcie_m2_remove() and the pwrseq_pcie_m2_probe() error path, prematurely destroying the backing regulator array. This creates a narrow vulnerability window where the globally visible power sequencer is backed by freed memory. If a concurrent consumer invokes pwrseq_enable() during this window, execution is routed to the sequencer callback and dereferences the destroyed ctx->regs array, resulting in a direct use-after-free and a kernel crash. Schedule a devres action for freeing the memory used for the regulator array to ensure it runs *after* the pwrseq provider was unregistered. Cc: stable@vger.kernel.org Fixes: 3f736aecbdc8 ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth") Closes: https://sashiko.dev/#/bug/linux-bd17e5b1-a000-4717-b392-0ff0c2a9c376 Link: https://patch.msgid.link/20261105-pwrseq-pcie-m2-uaf-v2-1-3e1dd415af9a@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 369751ac6e4706ef9f5cb038dfa78cc4db37218c Author: Dennis Chen Date: Fri Nov 6 15:31:15 2026 -0500 Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask" commit a74c332aaf46270101b32a32311275d86953a2b5 upstream. Commit 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in PMU cpumask") expanded cpumask to include all CPUs in the package. Since perf opens an event for every CPU in cpumask, the value returned for power/energy-pkg/ is roughly scaled by the number of CPUs. On a single-socket 72-core DMR machine the reported value is roughly 72x higher than when perf is restricted to reading from a single CPU: $ perf stat -e power/energy-pkg/ -- sleep 1 Performance counter stats for 'system wide': 8,052.48 Joules power/energy-pkg/ 1.010483558 seconds time elapsed $ perf stat -C 5 -e power/energy-pkg/ -- sleep 1 Performance counter stats for 'CPU(s) 5': 112.15 Joules power/energy-pkg/ 1.009685587 seconds time elapsed Reverting this commit restores the expected behavior for perf. Fixes: 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in PMU cpumask") Cc: All applicable Signed-off-by: Dennis Chen Link: https://patch.msgid.link/20261106203115.237269-1-dechen@redhat.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit bb77d679bdf64298cde7d345a3be830c19fe9049 Author: Rafael J. Wysocki Date: Fri Nov 6 12:31:41 2026 +0100 PM: runtime: Update last_busy in rpm_resume() for active devices commit 55b2b8af704f845e01fa2f31ee259b07641ce3a9 upstream. Setting an autosuspend delay for a device can be expected to cause a runtime suspend of the device after calling, say, pm_runtime_put() to be deferred, so the time between the last successful attempt to resume the device and its subsequent suspend is at least equal to the autosuspend delay. However, that expectation is only met after the device has been actually resumed in rpm_resume() by invoking its runtime resume callback. If the runtime PM status of the device is already "active" when rpm_resume() runs for it, the device's last_busy timestamp is not updated which may allow a subsequent pm_runtime_put() invocation (or similar) to suspend it right away. This is arguably inconsistent and confusing, so make rpm_resume() also update the device's last_busy timestamp when it finds that the device is already "active" and it is about to return 1 early. Fixes: 56f487c78015 ("PM / Runtime: Update last_busy in rpm_resume") Link: https://lore.kernel.org/linux-pm/CAJZ5v0jTX1FgeS9FCV=+V4uacSgLQBVsSPnU27ybgUGg57GUOA@mail.gmail.com/ Reported-by: Brian Norris Cc: All applicable Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Reviewed-by: Brian Norris Tested-by: Brian Norris Link: https://patch.msgid.link/13032301.O9o76ZdvQC@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit b932b5871829e25d0ed519e5c015cedc8ac5bc1e Author: Paolo Bertinetti Date: Tue Nov 3 13:07:53 2026 +0000 perf/hw_breakpoint: Clear stop state in hw_breakpoint_add() commit 6bea5e29daf123a78ae58cb5926023f4705f396f upstream. Since commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"), __perf_event_overflow() stops the event with pmu->stop() and disables it when the PERF_EVENT_IOC_REFRESH limit is reached. When userspace re-arms the event with PERF_EVENT_IOC_REFRESH, the event is enabled again and pmu->add() is called with PERF_EF_START. hw_breakpoint_add() sets PERF_HES_STOPPED when PERF_EF_START is missing, but never clears it. The flag set by pmu->stop() stays, and perf_bp_event() drops every later hit, so a breakpoint re-armed this way delivers only its first overflow. Set the state from PERF_EF_START on every add, as perf_swevent_add() does. Fixes: 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage") Assisted-by: LLM Signed-off-by: Paolo Bertinetti Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103130732.764081-3-paolobertinetti200f4@proton.me Signed-off-by: Greg Kroah-Hartman commit 84ef23287df05f2086af7a21eb6a6d44a095f119 Author: Phat Dinh Date: Fri Nov 6 17:16:42 2026 +0700 perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit commit 59f1398140869432c7171b9a2a279ca315467c4e upstream. perf_cgroup_switch() relies on: /* * cpuctx->cgrp is set when the first cgroup event enabled, * and is cleared when the last cgroup event disabled. */ It computes the next task's cgroup, schedules out the CPU context and then assigns cpuctx->cgrp unconditionally: ctx_sched_out(&cpuctx->ctx, NULL, EVENT_ALL|EVENT_CGROUP); /* * must not be done before ctxswout due * to update_cgrp_time_from_cpuctx() in * ctx_sched_out() */ cpuctx->cgrp = cgrp; However, ctx_sched_out() can disable events itself. If a cgroup event has a pending disable from perf_event_disable_inatomic() (e.g. its PERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not handled yet, event_sched_out() consumes it inline: if (event->pending_disable) { event->pending_disable = 0; perf_cgroup_event_disable(event, ctx); state = PERF_EVENT_STATE_OFF; } If that was the last cgroup event, perf_cgroup_event_disable() clears cpuctx->cgrp: if (--ctx->nr_cgroups) return; cpuctx->cgrp = NULL; and perf_cgroup_switch() then sets it again. cpuctx->cgrp is left non-NULL with ctx.nr_cgroups == 0, so the NULL check in perf_cgroup_switch() no longer catches it and the next switch trips: WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0); cpuctx->cgrp does not hold a reference on the cgroup. Once that cgroup is removed, the next ctx_sched_in() dereferences the stale pointer: BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0 Read of size 8 at addr ffff8881008972d0 by task swapper/3/0 Tainted: [W]=WARN Call Trace: ctx_sched_in+0xb1f/0xfa0 perf_event_sched_in+0x1a/0x70 ctx_resched+0x32b/0xac0 __perf_install_in_context+0x475/0xab0 remote_function+0x105/0x200 __flush_smp_call_function_queue+0x179/0x8d0 __sysvec_call_function_single+0x1b/0x1c0 sysvec_call_function_single+0x66/0x80 asm_sysvec_call_function_single+0x1a/0x20 Only assign cpuctx->cgrp when cgroup events remain after the context has been scheduled out, so that it stays NULL as the invariant requires. Fixes: e19cd0b6fa59 ("perf/core: Always set cpuctx cgrp when enable cgroup event") Signed-off-by: Phat Dinh Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261106101642.494674-1-phatdt1116@gmail.com Signed-off-by: Greg Kroah-Hartman commit f450bd834aa073debedc15bdc6505d935ae2a3c1 Author: Joas Antonio dos Santos Date: Mon Nov 2 01:45:35 2026 +0000 openvswitch: advance by the real header length in get_ipv6_ext_hdrs() commit dbce972650ed6348e3d3856e49308aa5603e02a7 upstream. get_ipv6_ext_hdrs() walks the IPv6 extension header chain to fill key->ipv6.exthdrs, but advances to the next header with ipv6_optlen() whatever the current header is. That is only right for Hop-by-Hop, Destination Options and Routing headers: - an Authentication Header is ((hdrlen + 2) << 2) bytes long (ipv6_authlen()), so with hdrlen = 4 the walk skips 40 bytes instead of 24 and reads the next "header" from the ICV and payload; - a Fragment header is always 8 bytes, and the byte read as hdrlen is its Reserved field, which the sender controls and receivers ignore, so a non-zero value makes the walk skip up to 2048 bytes and miss the headers that follow; - in a non-first fragment nothing after the Fragment header is a header at all, it is the middle of the fragmentable part, yet the walk keeps parsing it as an extension header chain. In all cases the OFPIEH12_* bits stored in key->ipv6.exthdrs depend on bytes chosen by the sender rather than on the headers that are actually present: payload bytes that look like another AH or a Hop-by-Hop header add OFPIEH12_UNREP/OFPIEH12_UNSEQ, and real headers after a Fragment header can go unreported. Flows that match on OVS_KEY_ATTR_IPV6_EXTHDRS then classify such packets wrongly. There is no memory safety issue, skb_header_pointer() bounds every read. Advance by sizeof(struct frag_hdr) for Fragment headers and by ipv6_authlen() for AH, and stop at the Fragment header if its offset is non-zero, as ipv6_find_hdr() does. Fixes: 28a3f0601727 ("net: openvswitch: IPv6: Add IPv6 extension header support") Link: https://lore.kernel.org/all/178905555085.219967.6617611783437228045@kernel.org/ Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Reviewed-by: Simon Horman Reviewed-by: Aaron Conole Reviewed-by: Eelco Chaudron Link: https://patch.msgid.link/20261102-ovs-exthdrs-v2-1-21ceef6a243d@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 786519919170e10f54b3e8b0fca3c60b88fc4f4d Author: Wahid Khan Date: Fri Nov 6 18:15:52 2026 +0530 ntfs: open the index allocation before reading or writing an index block commit bada7bbb11aaa6feba8904cf38ff833453f5b5d9 upstream. ntfs_ib_write() and ntfs_ib_read() use icx->ia_ni without checking it. ntfs_ir_reparent() only opens the index allocation through ntfs_ia_add() when the root is a small index. For a root that is already marked as a large index it calls ntfs_ib_write() directly. The lookup does not open the index allocation either when it ends in the root. If the last entry of the root has no child node, ia_ni is still NULL when the root has to be moved into an index block, and the write dereferences it: Oops: general protection fault, KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f] RIP: 0010:ntfs_inode_attr_pwrite+0x52/0x1600 ntfs_ir_make_space ntfs_ie_add ntfs_index_add_filename __ntfs_link ntfs_link vfs_link A single byte of an image from mkntfs is enough. In a directory that has one empty index block, clear INDEX_ENTRY_NODE (flags 3 -> 2) of the last entry of the $INDEX_ROOT and link() a file into the directory. Commit 9365c4a1357e ("ntfs: fix NULL dereference on index allocation open failure") covers the case where ntfs_ia_open() fails in the lookup. Here it was never tried. Open the index allocation on demand in both helpers and fail with -EIO if that does not work. ntfs_ia_open() also succeeds for a directory that has no $INDEX_ALLOCATION attribute. The inode it returns is then an empty resident stub that does not describe an index allocation, so reject that case too. Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations") Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Wahid Khan Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit 6186ed82a82036a592b2f4415ed9d6445cfbbca1 Author: Wahid Khan Date: Fri Nov 6 18:15:51 2026 +0530 ntfs: do not read an index block outside $INDEX_ALLOCATION commit 0ea30dd6eeabc09235d5c2cdb98ca4e0d593963f upstream. A directory whose $INDEX_ROOT has a child node but whose $INDEX_ALLOCATION is missing or damaged gets an empty index inode from ntfs_read_locked_index_inode(): size 0 and not non-resident. ntfs_lookup_inode_by_name() still follows the child node and reads a folio from that inode while it holds the mft record lock of the directory. Since the resident iomap read started to take base_ni->mrec_lock, that read waits for a lock the caller already holds: INFO: task init:1 is blocked on a mutex likely owned by task init:1. __mutex_lock __ntfs_read_iomap_begin ntfs_read_iomap_next iomap_read_folio ntfs_read_folio ntfs_lookup_inode_by_name ntfs_lookup The task never returns, and neither does anything else that needs the directory's mft record. It takes one corrupted byte on an image from mkntfs: change the first byte of the type of the $INDEX_ALLOCATION attribute header of a directory with index blocks from 0xa0 to 0x00. The first lookup in that directory hangs. Check that the index inode is non-resident and that the vcn lies inside it before every index block read, and fail with -EIO otherwise. This also rejects a negative vcn, which was only checked on later descents. Fixes: d9e00c457d4a ("ntfs: serialize resident iomap reads with mrec_lock") Cc: stable@vger.kernel.org # v7.3+ Signed-off-by: Wahid Khan Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit 6077c2da2f77b98fd55aa43f3510088fddaf9638 Author: Wahid Khan Date: Fri Nov 6 16:57:52 2026 +0530 ntfs: check the file name against the key length of an index entry commit 5e7143476219eac7cab7bdd341db68dab1649737 upstream. ntfs_index_entry_inconsistent() checks that the file name of a $FILE_NAME key fits in the index entry. It does not check that the name fits in the key, which is what key_length describes. Code that works on the key alone relies on that. ntfs_readdir() copies key_length bytes of the key of the next entry to resume the enumeration, and later uses the copy to search the index. If file_name_length is larger than the key holds, the name comparison reads past the copy: BUG: KASAN: slab-out-of-bounds in ntfs_file_compare_values+0x2d1/0x4b0 Read of size 2 at addr ffff88800a4ef2ce by task init/1 ntfs_file_compare_values ntfs_collate ntfs_ie_lookup ntfs_index_lookup ntfs_readdir iterate_dir Allocated by task 1: kmemdup_noprof ntfs_readdir The buggy address is located 0 bytes to the right of allocated 78-byte region Two bytes of an image from mkntfs are enough: in an entry whose name has six characters (key_length 78), change file_name_length from 6 to 7, so the key claims 80 bytes. The entry itself is 96 bytes, so the existing check lets it pass. The next readdir of the directory reads the extra bytes. Check the name against key_length, and check that the key is large enough to hold file_name_length in the first place. Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations") Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Wahid Khan Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman commit 1188e813f397866ebf557bf55ef9cfddd2025317 Author: Tim Menninger Date: Fri Oct 30 23:44:22 2026 +0000 NFSv4: Prevent indefinite waits for out-of-order OPEN stateids commit 151d95a1e696979a7d54b23c96338754be2fcc1f upstream. When processing an out-of-order OPEN stateid on an NFSv4.1 or later mount, nfs_set_open_stateid_locked() waits for stateid updates to be processed in order. A five-second timeout is intended to prevent indefinite waits when preceding updates never arrive. However, each iteration calls schedule_timeout() with a fresh five-second timeout. An update to the shared open state can wake the caller without satisfying its ordering check. The remaining timeout is then discarded, and the next iteration starts another full wait. Under sustained concurrent OPEN/CLOSE activity on the same open state, repeated wakeups can prevent the timeout from ever expiring. Some tasks can remain stuck in update_open_stateid() while others continue making progress. Compute a single deadline on entry and pass only the remaining time to schedule_timeout(). Once the deadline expires, take the existing timeout path rather than starting another wait. This prevents wakeups from extending the wait indefinitely. Observed on Linux 6.8.0 and reproduced on 7.3.0 with 96 concurrent O_RDWR|O_TRUNC open/close loops on one NFSv4.1/TCP file (nconnect=16). Ten workers made no progress for over 300 seconds while others ran. With the fix, all workers resumed after transient stalls. Fixes: c9399f21c215 ("NFSv4: Fix OPEN / CLOSE race") Cc: stable@vger.kernel.org Signed-off-by: Tim Menninger Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman commit 9928a1cb522a3aad20a28792a9201886ea38ec2c Author: Christian Brauner Date: Mon Nov 9 17:51:21 2026 +0100 minix: don't read the inode block in minix_sync_inode_metadata() commit ccb8bbf93985d89f60d904386e27aad60f34dbbf upstream. minix_sync_inode_metadata() looks the inode block up with minix_V1_raw_inode() or minix_V2_raw_inode() which read it from disk if it isn't cached. But a block that isn't cached is neither dirty nor under writeback, so there's nothing to write or to wait for. That read is also something we can't afford once inode eviction calls ->sync_inode_metadata() from reclaim. So look the block up with sb_find_get_block_nonatomic() instead. Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-6-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit facc99ab1efa83d3040834e671f04db53812c04e Author: Christian Brauner Date: Mon Nov 9 17:51:20 2026 +0100 minix: add minix_inode_block() helper commit 1037134824e9d5c8cc04eea5ec6a5eb3ef4312bb upstream. Move the lookup of the block that holds an inode out of minix_V1_raw_inode() and minix_V2_raw_inode() into a helper. minix_sync_inode_metadata() is going to use it to find the block without reading it from disk. No functional changes. Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-5-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit a9535834de431aa37bb7fdc436ec570562226da5 Author: Eric Dumazet Date: Thu Nov 5 15:45:43 2026 +0100 net: wait for in-flight device unregistrations before netns dismantle commit c164a431a646983275d0076ff5b0e4c326fbc10b upstream. A device can be unregistered by a context other than the cleanup_net() of its own netns, for instance a veth whose peer in another netns is deleted. If references on it are still held, it stays in netdev_wait_allrefs_any(), which rebroadcasts NETDEV_UNREGISTER every second. Meanwhile its netns can be dismantled: default_device_exit_batch() only takes care of devices still listed in the netns, then pernet exit handlers free their state, and finally struct net is freed while the device still points to it. The rebroadcasts then run notifiers against torn down pernet state, or freed memory. Three instances were reported so far: - netdev_genl_netdevice_event(): net->genl_sock is NULL [1] - nh_netdev_event(): net->nexthop.devhash is NULL [2] - nf_tables netdevice notifiers: use-after-free of the nftables pernet storage [3] but any notifier using dev_net(dev) is affected, as is netdev_wait_allrefs_any() itself (__rtnl_net_lock(dev_net(dev)) with CONFIG_DEBUG_NET_SMALL_RTNL=y). This was prevented by rtnl_lock_unregistering() until I removed it in commit 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()"), considering only the loopback dependency, and missing the notifiers one. Restore a per-netns counter of devices sitting in netdev_run_todo(), and make default_device_exit_batch() wait for it to reach zero, after it has unregistered all devices of the dying netns(es). At this point no new unregistration can be started for these netns. Unlike the old barrier, this only waits for devices of the netns being dismantled and runs after their own devices are gone. Tested on a KASAN kernel with a debug-only hack holding a reference on a veth device for 5 seconds after its unregistration: a nexthop on the veth in netns X, delete its peer from init_net, then delete X. Without this patch, the nexthop_flush_dev() null-ptr-deref from [2] triggers. With it, no splat; netns churn and dismantle of a netns whose own device is held still work. [1] https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/ [2] https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/ [3] https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/ Fixes: 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()") Cc: stable@vger.kernel.org Reported-by: syzbot+1269fe6cc2016008124e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/ Reported-by: Henry Martin Closes: https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/ Closes: https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/ Signed-off-by: Eric Dumazet Reviewed-by: Naman Gulati Link: https://patch.msgid.link/20261105144543.1624238-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 280ef33ca775a4507adf3fd120956e51b30ed585 Author: Jamal Hadi Salim Date: Tue Nov 3 06:50:30 2026 -0500 net/sched: act_ife: require a full Ethernet header on egress commit 11dbce09083473249c3843ff31bf8d8fa01bdeef upstream. This is a followup of commit 5b483f7791b0 ("net/sched: act_ife: Only operate on Ethernet frames") as reported by Sashiko. The finding was raised by both Sashiko providers (nipa and gemini) while reviewing the parent patchset. shaos independently reported the same undersized-egress path with a reproducer, which was reproduced and verified in our test environment. The issue: On egress tcf_ife_is_eth_skb() only checks the device type; it does not check that the skb carries a full Ethernet header. For an Ethernet or loopback device it returns true even when the skb has no Ethernet header. tcf_ife_encode() then calls ife_encode(), which copies ETH_HLEN bytes from skb->data. A short skb therefore reads past its linear data and the copied bytes, including stale kernel memory, are emitted in the outer Ethernet header. The parent commit fixed the reported ingress mac_len case but left the egress path without a length check. A total-length test is not sufficient: a non-GSO TUN skb can have a large total length while only a single byte sits in the linear area, so ife_encode() still reads past the linear header. Require instead that the Ethernet header the encoder copies is present in the linear part of the skb. The Fix: On egress require pskb_may_pull(skb, ETH_HLEN) before encoding, which ensures the Ethernet header is present in the linear data ife_encode() copies from; the ingress mac_len check is unchanged. A short egress skb is now dropped instead of being encoded. Conditions to recreate the bug: CONFIG_NET_ACT_IFE=y, CONFIG_NET_CLS_MATCHALL=y, CONFIG_NET_SCH_INGRESS=y, CONFIG_TUN=y, CONFIG_NET_ACT_MIRRED=y. In two user and network namespaces (a victim and an attacker), open a TUN device in IFF_TUN mode and attach clsact to it and to lo. Redirect ingress traffic from the TUN device to lo egress with mirred, and install an ife encode action on lo egress: tc qdisc add dev clsact tc qdisc add dev lo clsact tc filter add dev ingress matchall action mirred egress \ redirect dev lo tc filter add dev lo egress matchall action ife encode use mark 1 \ action ok Send a TUN packet shorter than ETH_HLEN (a one-byte payload is enough) and receive the emitted frame on the other side. Without the fix the outer Ethernet header contains bytes copied past the short packet; with the fix the short skb is dropped. The attacker needs CAP_NET_ADMIN in its user namespace; no init-net privilege is required. The same path is reachable when the total length is large but the Ethernet header is not linear: write a non-GSO virtio header with hdr_len=1 followed by an 8192-byte packet so that only one byte stays linear. Without the fix the copied header reads past the linear data; with the fix the header is pulled into the linear area before the copy. Fixes: 295a6e06d21e ("net/sched: act_ife: Change to use ife module") Reported-by: Sashiko (nipa) Reported-by: Sashiko (gemini) Reported-by: shaos Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260821164031.32824-1-victor%40mojatatu.com Link: https://sashiko.dev/#/patchset/20260821164031.32824-1-victor@mojatatu.com Link: https://lore.kernel.org/netdev/20261022144736.61227-1-shawnq1@163.com/ Cc: stable@vger.kernel.org Reviewed-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim Reviewed-by: Simon Horman Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-2@mojatatu.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit fbecb50e6e7ada17bf3896c541b36054e7e5302f Author: Jamal Hadi Salim Date: Tue Nov 3 06:50:29 2026 -0500 net/sched: act_ife: encode configured zero metadata values commit 7d02c07c738bf5c4b9a7d7ef498fbf465c446853 upstream. Reported by shaos with a reproducer for the 32-bit case, which was reproduced and verified in our test environment. The issue: ife_check_meta_u32() and ife_check_meta_u16() both reserve eight bytes of metadata for a configured value even when that value is zero, but the matching encoder returns without calling ife_tlv_meta_encode(). The encoder therefore writes neither the TLV header nor its value, while the enclosing IFE length still includes the reserved bytes, exposing stale skb headroom contents to the peer. The 32-bit helper has been present since the IFE action was introduced (v4.6); the 16-bit helper was added with the 16-bit metadata helpers used by the skbtcindex callback (v4.9). Both defects predate the oldest supported stable kernel (5.10), so they are fixed together in this patch. Each hunk keeps its own Fixes: tag for provenance. The fix: Encode any configured value, including zero; skip the TLV only when there is neither a configured nor a runtime value. The runtime fallback is unchanged. A raw TCA_IFE_METALST netlink request is needed to express the configured zero: the IFE_META_SKBMARK attribute carries four zero payload bytes for the u32 helper, and IFE_META_TCINDEX two zero payload bytes for the 16-bit helper (not an absent or zero-length attribute). Stock tc cannot build these requests; "use mark 0x0" emits no mark attribute and "allow mark" emits a zero-length one. Conditions to recreate the bug: CONFIG_NET_ACT_IFE=y, CONFIG_NET_IFE_SKBMARK=y, CONFIG_NET_IFE_SKBTCINDEX=y, CONFIG_NET_CLS_MATCHALL=y, CONFIG_NET_SCH_INGRESS=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y, CONFIG_VETH=y. In a fresh user and network namespace create a veth pair and attach clsact to the egress side. Install a matchall filter whose ife encode action carries a zero skb mark (or a zero tcindex) in TCA_IFE_METALST. Send a frame through the veth and inspect the IFE metadata in the received frame. The metadata region is eight bytes but holds neither a valid TLV header nor a value; it exposes prior headroom contents. Setting the value to a nonzero one does not trigger the leak. The namespace needs CAP_NET_ADMIN; no additional privilege is required. With the fix the zero TLVs are 0001000800000000 (u32) and 0005000600000000 (u16). Fixes: ef6980b6becb ("introduce IFE action") Fixes: 6a5d58b67e20 ("net sched ife action: add 16 bit helpers") Reported-by: shaos Link: https://lore.kernel.org/netdev/20261022144739.61342-1-shawnq1@163.com/ Cc: stable@vger.kernel.org Reviewed-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim Reviewed-by: Simon Horman Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-1@mojatatu.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit fda4263f036ec4c4672e17d407a3070d95481dad Author: Jamal Hadi Salim Date: Tue Nov 3 06:50:31 2026 -0500 net/sched: sch_teql: reject qdiscs from another network namespace commit 1ae84bdd736f8fab30180159996e1d193f8029ff upstream. Reported by shaos with a reproducer, which was reproduced and verified in our test environment. The issue: The teql master devices are created once in the initial network namespace and their Qdisc_ops are global. teql_qdisc_init() takes the teql_master embedded in the registered sch->ops and uses it without checking whether the new qdisc's device lives in the same network namespace as the master. A qdisc created in another netns can therefore attach to the init-net master and change its MTU and flags. The Fix: Reject a teql qdisc whose device is not in the master's network namespace with -EOPNOTSUPP and an extack message; same-netns teql still works. Initialize the private skb queue before any validation so every constructor failure path, including qdisc_create_dflt(), which resets the qdisc before destroying it, sees an initialized empty queue. Conditions to recreate the bug: CONFIG_NET_SCH_TEQL=y, CONFIG_DUMMY=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y. As an unprivileged UID, unshare a user and network namespace, create a dummy device, set its MTU to 60000, and add a root teql0 qdisc: unshare -Urn ip link add dummy0 type dummy ip link set dummy0 mtu 60000 tc qdisc add dev dummy0 root teql0 The init-net teql0 device changes from MTU 1500 to 60000. A pfifo control on the same device leaves the MTU unchanged, and a direct MTU change on init-net teql0 is denied. The namespace needs CAP_NET_ADMIN; no init-net privilege is required. With the fix the attach fails with "Operation not supported" and the init-net MTU stays 1500. Fixes: 7316ae88c43d ("net_sched: make traffic control network namespace aware") Reported-by: shaos Link: https://lore.kernel.org/netdev/20261022144830.67948-1-shawnq1@163.com/ Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/SER-NSBD.v1.r2.20261031160050-3%40mojatatu.com Link: https://lore.kernel.org/netdev/179366641863.488856.17368571591466000274@kernel.org/ Cc: stable@vger.kernel.org Reviewed-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim Reviewed-by: Simon Horman Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-3@mojatatu.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit cf8b4ac1598dc8d598d41193086ecc398402de9f Author: Paulo Alcantara Date: Thu Nov 5 21:01:54 2026 -0300 netfs: don't hang a read whose retry is abandoned commit d1bb754ab9e775b0fbb2743d3df425c25a561114 upstream. When ->prepare_read() fails while retrying a read, or a subrequest can't be allocated, netfs_retry_read_subrequests() marks the remaining subrequests failed without reissuing them. If none was reissued in that pass, nothing is in progress any more to wake the collector, which returned after the retry, so an offloaded read (readahead, async direct I/O) never completes and its folios stay locked. Wake the collector after abandoning, so it collects the failed subrequests and completes the request. Fixes: e2d46f2ec332 ("netfs: Change the read result collector to only use one work item") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 7c30f999ecf890cc7ca971d29f2ab554b43c6437 Author: Paulo Alcantara Date: Sun Nov 1 19:59:55 2026 -0300 netfs: keep the prepare_read errno when abandoning read retries commit d88a0c3a96fd6d7228d04532cecb23f23676aa2d upstream. When ->prepare_read() fails while retrying a read, netfs_retry_read_subrequests() marks the subrequest failed and abandons the rest, which overwrites the error of every failed subrequest with -ENOMEM. The reader then gets -ENOMEM for e.g. a handle that couldn't be reopened (-EHOSTDOWN, -ENOENT), a credit wait interrupted by a signal (-ERESTARTSYS) or umount -f (-EIO). The first pass doesn't have this problem, as netfs_cancel_read() keeps the errno. Record the errno of ->prepare_read() in the subrequest and keep the error of subrequests that already failed, using -ENOMEM only for those abandoned while still waiting for a retry. Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 8727bed8bec46a1f41f6e4f8cbd2410ec8d2bf29 Author: Iván Ezequiel Rodriguez Date: Wed Oct 28 15:12:28 2026 -0300 netfs: preserve prepare_write errno on reissue commit 62869ecb3aeca670b86058387e7533a33524b95b upstream. prepare_write() may call netfs_prepare_write_failed() (FAILED + errno) before write_retry calls netfs_reissue_write(). Clearing subreq->error to 0 for a clean I/O reissue (82e8885bd763) then makes netfs_do_issue_write() terminate with 0. The collector copies front->error into stream->error and mapping_set_error(), which ignores 0, so writeback failure is silent. Skip clearing error when NETFS_SREQ_FAILED is already set; do_issue_write() already terminates FAILED subrequests. Fixes: 82e8885bd763 ("netfs: when subreq is marked for retry, do not check if it faced an error") Signed-off-by: Iván Ezequiel Rodriguez Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 1719ad367083ce2ce8fab2c9d124eb97504adb3e Author: Michail Andreas Michalopoulos Date: Tue Oct 20 12:35:20 2026 +0200 netfilter: flowtable: extend ct timeout of offloaded GRE flows commit 46ecda278f6eedffb2898d41e3e56757c996a41f upstream. Since commit 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn timeout extension logic"), the flowtable gc worker extends the timeout of an offloaded conntrack entry from nf_flow_table_extend_ct_timeout() once it falls below 5 minutes. That function only knows about TCP and UDP and hits WARN_ON_ONCE() for any other layer 4 protocol. However, GRE flows can be offloaded too, both via nft_flow_offload and act_ct, since commit 4e8d9584d154 ("netfilter: flowtable: Support GRE"). The timeout of an offloaded GRE entry drops below that threshold as soon as a packet of the flow still goes through conntrack. With ip6gre tunnels using the default encapsulation limit this is ordinary traffic: the flowtable does not parse the Destination Options header in front of GRE, so every packet of the flow takes the classic forwarding path. It also happens for a packet with ttl <= 1, which the flowtable fast path passes up to the classic forwarding path. nf_conntrack_gre_packet() then refreshes ct->timeout to the GRE stream timeout (180 seconds by default), and the next gc run triggers, as reported by syzbot: WARNING: net/netfilter/nf_flow_table_core.c:553 at nf_flow_table_extend_ct_timeout+0x1ee/0x2f0 Workqueue: events_power_efficient nf_flow_offload_work_gc Call Trace: nf_flow_offload_gc_step+0x545/0x7b0 nf_flow_table_iterate+0x13c/0x1f0 nf_flow_offload_work_gc+0x22/0x70 process_scheduled_works+0xc3d/0x1630 worker_thread+0xa47/0xfb0 kthread+0x38b/0x480 Besides the splat, which panics the machine with panic_on_warn, the default branch sets the new timeout to 1 jiffy, so the conntrack entry expires right away and the offloaded flow is torn down. Handle GRE like UDP and extend the timeout to NF_CT_DAY. GRE conntrack has no protocol state to take into account, and NF_CT_DAY is also what flow_offload_add() already sets for every offloaded entry, GRE included. This also restores the behaviour from before commit 03428ca5cee9, when the conntrack gc worker extended offloaded entries of any protocol to NF_CT_DAY. Fixes: 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn timeout extension logic") Reported-by: syzbot+521f7e7e2b974abde99a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=521f7e7e2b974abde99a Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Michail Andreas Michalopoulos Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit de330c35537af8c94398c0b2a0e835fc7b628eb8 Author: Cen Zhang (Microsoft) Date: Wed Oct 28 17:44:43 2026 -0400 netfilter: xt_recent: do not call remove_proc_entry() under recent_lock commit 17c2e41736b62cfe444c64d67860b1fbc1e886ac upstream. recent_proc_net_exit() removes the /proc/net/xt_recent/ entries of a dying network namespace while holding spin_lock_bh(&recent_lock). remove_proc_entry() may sleep: proc_entry_rundown() waits until every task that is still inside the entry's file operations has left. A reader of such an entry is counted in by proc_reg_read() before recent_seq_start() takes recent_lock. So if a read is in flight when the namespace is torn down, cleanup_net() sleeps in atomic context holding the spinlock that the reader is spinning on, and neither side can ever make progress. An unprivileged user can trigger this from a user namespace by adding a rule with the "recent" match and reading its proc file while the namespace is being destroyed. As recent_lock is global, every later attempt to take it spins forever too: the spinning can spread to all CPUs, and network namespace teardown stops system-wide. BUG: sleeping function called from invalid context at kernel/sched/completion.c:116 #3: (recent_lock){+...}-{3:3}, at: recent_net_exit+0x2b/0x140 Workqueue: netns cleanup_net Call Trace: proc_entry_rundown+0x185/0x1b0 remove_proc_entry+0x21a/0x520 recent_net_exit+0x7f/0x140 cleanup_net+0x414/0x8f0 ... rcu: INFO: rcu_preempt self-detected stall on CPU Call Trace: queued_spin_lock_slowpath+0x313/0xc20 recent_seq_start+0x87/0x1b0 seq_read_iter+0x265/0x11e0 proc_reg_read+0x1ab/0x270 Fix by taking recent_mutex instead of recent_lock. According to commit a0e889bb1bdc ("[NETFILTER]: recent match: fix "sleeping function called from invalid context""), recent_mutex is the lock to use here: it protects recent_net->tables and was introduced so that proc entries are created and removed without recent_lock held, because those calls may sleep. hashlimit_proc_net_exit() does the same for xt_hashlimit. Fixes: 665e205c16c1 ("netfilter: xt_recent: fix namespace destroy path") Cc: stable@vger.kernel.org Cc: AutonomousCodeSecurity@microsoft.com Signed-off-by: Cen Zhang (Microsoft) Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 098c1cacf677a8c459b18cd6a137f99086617a09 Author: Zihan Xi Date: Fri Oct 16 16:14:17 2026 +0000 netfilter: nf_dup: preserve guard across NFQUEUE reinjection commit 82052e5b5ec36504fe1b9c3c28a711a78fcacf37 upstream. NFQUEUE can suspend traversal of a duplicated packet while the task-local duplication guard is set. The output call then returns and clears the guard before a later verdict resumes hook traversal. Save the guard in the queue entry and restore it while reinjection continues hook traversal. Preserve and restore the verdict task's prior state, including nested synchronous reinjection. Fixes: cd58bcd9787e ("netfilter: xt_TEE: have cloned packet travel through Xtables too") Cc: stable@vger.kernel.org Reported-by: Vega Assisted-by: LLM Co-developed-by: Luxing Yin Signed-off-by: Luxing Yin Signed-off-by: Zihan Xi Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit e5da3b8cec34860146bf7049b9475a70d77457a4 Author: Eric Dumazet Date: Wed Nov 4 16:10:42 2026 +0100 net: gro: invalidate frag0 after a pull commit 98d949a15ff9d3fffaa6983223178374aab92db6 upstream. Since commit bd56a29c7a4e ("net: gro: change skb_gro_network_header()"), skb_gro_header_slow() no longer invalidates NAPI_GRO_CB(skb)->frag0 after pskb_may_pull(). skb_gro_may_pull() keeps comparing against the frag0_len value set in skb_gro_reset_offset(), assuming that after a slow pull, all later accesses are beyond frag0_len. This is not true: - udp4_gro_receive() and udp6_gro_receive() read the network header with skb_gro_network_header() after udp_gro_udphdr() pulled the UDP header. - vxlan_gro_receive() calls skb_gro_remcsum_cleanup() at a lower offset after the inner handlers pulled their headers. - skb_gro_remcsum_process() can pull beyond the inner Ethernet header before eth_gro_receive() reads it. - napi_frags_skb() calls __skb_pull(skb, ETH_HLEN) after a slow pull, so frag0 still points to the Ethernet header. If the pull consumed the first page fragment, __skb_pull_tail() released it. If the head had to grow, pskb_expand_head() freed the old one. These reads, and the 2-byte write in skb_gro_remcsum_cleanup(), then access memory the skb no longer holds a reference on. esp4_gro_receive(), esp6_gro_receive(), skb_gro_receive_list() and udp_gro_receive_segment() also pull directly and never invalidated frag0. Add skb_gro_frag0_invalidate(), which only clears frag0_len, and call it before each of these pulls. This is a single store in the slow path, and frag0 stays non NULL, so skb_gro_network_header() does not need a NULL test. frag0 must be invalidated even if the pull fails: __pskb_pull_tail() can return NULL after pskb_expand_head() freed the old head, for instance if a frag_list member has to be cloned or pulled. As frag0 is now invalidated before a pull that can fail, gro_try_pull_from_frag0() can see an skb whose linear part does not cover skb_gro_offset() while frag0 still points to the start of the packet, for instance after skb_gro_remcsum_cleanup() pulled a shorter length. Copying from frag0 would then corrupt the headers: only use frag0 while frag0_len is not zero, and use pskb_may_pull() otherwise. If this pull fails, for instance after a failed pskb_pull() in esp4_gro_receive(), do not hold the packet: later GRO lookups and gro_complete() handlers expect its headers in the linear part. This was found by Taesoo Kim and Cen Zhang, using LLM assisted code analysis, and confirmed with reproducers. Fixes: bd56a29c7a4e ("net: gro: change skb_gro_network_header()") Fixes: 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.") Cc: stable@vger.kernel.org Reported-by: Taesoo Kim Reported-by: Cen Zhang Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261104151042.1157782-3-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit a309b402093c3b63a85412242651b1db6c3c67de Author: Eric Dumazet Date: Wed Nov 4 16:10:41 2026 +0100 net: gro: do not undo remote checksum offload on merged packets commit c817ec1b06875b98460fbd19591be541bc3fa924 upstream. skb_gro_flush_final_remcsum() calls skb_gro_remcsum_cleanup() to undo the checksum adjustment done by skb_gro_remcsum_process() when the packet was not consumed by GRO. When the inner handler merged the packet (NAPI_GRO_CB(skb)->same_flow is set), grc->offset can no longer be trusted: - skb_gro_receive() either gives the frags or the head of the skb to the held packet, or uses __skb_pull(skb, offset) before adding the skb to the frag_list of the held packet. - skb_gro_receive_list() uses skb_pull(skb, skb_gro_offset(skb)). grc->offset is relative to the original skb->data, so the 2-byte read-modify-write done by skb_gro_remcsum_cleanup() can land in the payload of a packet which now belongs to the GRO packet. pskb_may_pull() can also be called on this frag_list member. With fraglist GRO, this can also be a use-after-free: pskb_may_pull(skb, skb_gro_offset(skb)) in skb_gro_receive_list() or udp_gro_receive_segment() releases the first page fragment if it only contains headers. NAPI_GRO_CB(skb)->frag0 and frag0_len are not updated, so skb_gro_remcsum_cleanup() takes the fast path and writes through frag0 into a page the skb no longer holds a reference on. The non merged case, where frag0 is used after this pull, is handled in the following patch. For skbs merged by skb_gro_receive(), the cleanup can be skipped: the skb is freed, or its headers are rebuilt from the head skb in skb_segment(). Fraglist members keep their own inner headers, as skb_segment_list() only copies the link-layer and tunnel headers from the head skb. Their checksum can not be right in all cases: a packet forwarded with its tunnel header needs the original value, while a VXLAN packet decapsulated locally needs the adjusted one, as vxlan_remcsum() only adjusts the head skb. Make skb_gro_receive_list() refuse packets with skb->remcsum_offload set, so that fraglist members never carry an adjusted checksum. This affects VXLAN (VXLAN_F_REMCSUM_NOPARTIAL) and GUE (FOU_F_REMCSUM_NOPARTIAL). This was found while fixing a report from Taesoo Kim and Cen Zhang, who used LLM assisted code analysis and provided reproducers. Fixes: 26c4f7da3e41 ("net: Fix remcsum in GRO path to not change packet") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261104151042.1157782-2-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 5e2e65e1fb673bb8106bfbf0c87d89598e16ab1d Author: Kyle Zeng Date: Fri Oct 30 22:07:52 2026 -0700 net: gro: avoid parsing headers from shared fragments commit 44818c9a826d766dc0e21179dc76f229334f1dda upstream. When an skb has an empty linear head, skb_gro_reset_offset() can expose the first page fragment directly to GRO header parsers. For an SKBFL_SHARED_FRAG skb, those bytes may still be writable through a file mapping. Headers validated during receive can therefore differ from the headers later copied into the linear head and used during completion. For example, changing an IPv6 destination-options length between the short and full header fetches in ipv6_gro_pull_exthdrs() can make ipv6_gro_complete() pass an out-of-bounds offset to udp6_gro_complete(). A userspace reproducer triggered a KASAN slab-out-of-bounds read there on an unmodified kernel as UID 1000. The same completion path can write the UDP checksum and length through the invalid offset. The packet has trusted TCP GSO metadata and spliced file data, so it reaches completion without an skb zerocopy destructor or a second GRO packet. Disable the direct-fragment fast path for skbs with externally writable fragments. With an empty linear head, frag0_len remains zero, so skb_gro_header_slow() pulls each required header into the linear head before it is inspected. Subsequent pulls preserve the validated prefix. This covers both gro_receive_skb() and napi_gro_frags(), including other protocols using the same helpers. Linear headers and private fragments retain their existing fast paths. Codex assisted with review of the supplied report, reproducer and draft fix, related-path analysis, and this changelog. The patched net/core/gro.o builds with W=1 using the supplied x86-64 configuration, allyesconfig and allmodconfig. The fix was checked by code-path analysis; the reproducer and kernel selftests have not been run on a booted patched kernel. The issue was found by an LLM. Fixes: dff0b0161ad5 ("net: gro: parse ipv6 ext headers without frag0 invalidation") Cc: stable@kernel.org Signed-off-by: Kyle Zeng Link: https://patch.msgid.link/20261031050752.31869-1-kylebot@openai.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 71f395aa263fb30e92bb252eed50e1c8622d6586 Author: Andrea Parri Date: Fri Nov 6 13:39:18 2026 +0100 hv_sock: Report no unread data before a channel is available commit 71b06766b7c49ed5f489b8bd104f82ff164d67a3 upstream. The Hyper-V transport is assigned before the asynchronous VMBus channel offer completes. Its zero-initialized hvsock therefore has a NULL chan until hvs_open_connection() associates the channel with the socket. SIOCINQ can query the assigned transport while the socket is connecting, or after connect() fails once the transport has been assigned. Unlike poll(), that path does not check stream_is_active() before calling the transport's stream_has_data callback. hvs_stream_has_data() then passes the NULL channel to hvs_channel_readable_payload(), and any user in the guest can trigger an oops: BUG: kernel NULL pointer dereference, address: 0000000000000178 RIP: 0010:hvs_stream_has_data+0x23/0x120 Call Trace: ? vsock_ioctl+0x74/0xf0 sock_do_ioctl+0x42/0xf0 sock_ioctl+0x27d/0x310 do_vfs_ioctl+0x700/0x810 __x64_sys_ioctl+0x7d/0xf0 Return zero unread bytes when no channel is available, before accessing the receive state or ring. Leave the existing channel-backed receive handling unchanged. The oops was reproduced on an unmodified v7.4-rc1 kernel in a WSL2 guest with a small user-space program, available on request. With this patch, the program reports zero unread bytes and the kernel logs nothing. Other vsock_test cases were not run, as most of them need a host-side peer. AI assistance was used to identify the issue and develop the fix. Fixes: f7c722659275 ("vsock: Add support for SIOCINQ ioctl") Cc: stable@vger.kernel.org Signed-off-by: Andrea Parri Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Link: https://patch.msgid.link/20261106123920.162131-1-parri.andrea@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 49d81d2d22eac1856c99be36378008618978c625 Author: Erni Sri Satya Vennela Date: Fri Oct 30 02:34:59 2026 -0700 hv_netvsc: Stop PPI parsing on invalid metadata commit 19a227903e65c7a9c179156485660a4e017575fe upstream. rndis_get_ppi() uses continue when a per-packet information entry has an invalid size or offset, or cannot hold the requested metadata. However, the remaining length and entry pointer are only updated at the bottom of the loop. Each error path therefore retries the same invalid entry indefinitely, repeatedly logging the error and preventing receive processing from completing. Return NULL on these validation failures instead of continuing. This terminates the lookup when malformed metadata is encountered while preserving the existing behavior for valid entries. The issue was reported through an internal bug-tracking system and confirmed by manual code inspection. The pre-fix hang has not been reproduced locally. Fixes: 44144185951a ("hv_netvsc: Add validation for untrusted Hyper-V values") Cc: stable@vger.kernel.org Signed-off-by: Erni Sri Satya Vennela Reviewed-by: Haiyang Zhang Reviewed-by: Wei Liu Reviewed-by: Simon Horman Signed-off-by: Dave Miller Signed-off-by: Greg Kroah-Hartman commit 2f3f3fd9e922b84a8801c39b1597a2a6986b9ef5 Author: Joas Antonio dos Santos Date: Tue Nov 10 09:03:26 2026 +0000 gtp: free the skb after handling an echo response commit f17b293d155f377e4cff582b8113991d2ad346d6 upstream. gtp0_handle_echo_resp() and gtp1u_handle_echo_resp() return the result of genlmsg_multicast_netns() to gtp_encap_recv(). When the netlink notification is delivered that result is 0, and gtp_encap_recv() treats 0 as "the skb has been consumed": switch (ret) { case 1: netdev_dbg(gtp->dev, "pass up to the process\n"); break; case 0: break; case -1: netdev_dbg(gtp->dev, "GTP packet has been dropped\n"); kfree_skb(skb); ret = 0; break; } The echo response handlers only read from the skb and never free it or pass it on, so every echo response that is reported to a listener on the gtp multicast group leaks the skb. Echo responses are handled for any peer when the UDP sockets were created by the kernel, so a remote host can leak memory on the receiver by sending GTP echo responses while a process with CAP_NET_ADMIN is subscribed to the gtp multicast group, for example a daemon that monitors echo responses. The error paths do not leak but have a related problem. -ENOMEM and the error from genlmsg_multicast_netns() (-ESRCH when nobody listens) are not -1, so they are returned unchanged to the UDP stack, which takes a negative value from encap_rcv() as a request to resubmit the packet to the protocol with that number. Return -1 when the notification cannot be built, so that gtp_encap_recv() drops the skb, and consume the skb once the notification has been handed to netlink, whether or not anybody is listening. Found by LLM-assisted source review, untested. Fixes: d33bd757d362 ("gtp: Implement GTP echo request") Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Link: https://patch.msgid.link/20261110-gtp-echo-rsp-leak-v1-1-192c032f3dfa@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 3d8230282abfadd000f919c1f6ab7ab9208b1577 Author: Chengfeng Ye Date: Sun Sep 27 14:24:35 2026 +0800 ipvs: fix protocol data lifetime during namespace teardown commit 832aa3e89e806bb2667fe4e656b705f4088b3c9d upstream. IPVS frees its per-net protocol data before control cleanup cancels defense work and unregisters the sysctl table. A defense worker can load a protocol data pointer, then namespace cleanup can unlink and free that object before the worker dereferences pd->pp or pd->next. The worker's securetcp_lock does not serialize with protocol cleanup. A concurrent defense-mode sysctl write can reach the same timeout update path. KASAN reported: BUG: KASAN: slab-use-after-free in ip_vs_protocol_timeout_change Workqueue: events_long defense_work_handler Call Trace: ip_vs_protocol_timeout_change+0x1b4/0x1e0 update_defense_level+0x63e/0xd80 defense_work_handler+0x1e/0xc0 Allocated by task 125: ip_vs_protocol_net_init+0xda/0x2f0 __ip_vs_init+0x16b/0x240 setup_net+0xfc/0x310 Freed by task 12: ip_vs_protocol_net_cleanup+0x1d6/0x2e0 __ip_vs_cleanup_batch+0x7d/0x100 cleanup_net+0x38c/0x770 Run control cleanup before protocol cleanup so that defense work and active sysctl handlers have finished before their protocol data is freed. Initialize protocols before exposing the control interface, and unwind in reverse order, to enforce the same lifetime on initialization failure. Protocol initialization and exit do not depend on control state. Fixes: 9330419d9aa4 ("IPVS: netns, use ip_vs_proto_data as param.") Cc: stable@vger.kernel.org Signed-off-by: Chengfeng Ye Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 570ffcdb76a134f5f977ccf9f12a5db04f99fb32 Author: Chengfeng Ye Date: Sun Sep 27 01:51:29 2026 +0800 ipvs: Defer application parent freeing until after RCU readers commit 1e0808008e44d736e57a897a51d14fa995099010 upstream. unregister_ip_vs_app() removes each incarnation from its protocol list and uses call_rcu() to defer freeing it, but frees the parent application immediately. An RCU reader that already found an incarnation can still access the parent through inc->app in ip_vs_app_inc_get(). During FTP helper module unload, the following interleaving is possible: CPU 0 (RCU reader) CPU 1 (module unload) tcp_app_conn_bind() find inc in protocol list unregister_ip_vs_app() ip_vs_app_inc_release(inc) list_del_rcu(&inc->p_list) call_rcu(&inc->rcu_head, ...) kfree(a) ip_vs_app_inc_get(inc) try_module_get(inc->app->module) The helper module is already going away, so try_module_get() would fail, but evaluating its argument first reads the freed parent. The subsequent rcu_barrier() in pernet unregistration cannot protect this earlier free. KASAN reported: BUG: KASAN: slab-use-after-free in ip_vs_app_inc_get+0x7c/0x90 Call Trace: ip_vs_app_inc_get+0x7c/0x90 tcp_app_conn_bind+0x1bc/0x290 ip_vs_conn_new+0x1915/0x20d0 ip_vs_schedule+0x697/0xea0 tcp_conn_schedule+0x489/0x820 ip_vs_in_hook+0x7bf/0x1f40 Allocated by task 88: kmemdup_noprof+0x20/0x50 register_ip_vs_app+0x12d/0x2c0 __ip_vs_ftp_init+0x56/0x160 [ip_vs_ftp] Freed by task 104: kfree+0x131/0x3c0 unregister_ip_vs_app+0x2f4/0x5b0 unregister_pernet_operations+0x232/0x490 unregister_pernet_subsys+0x1c/0x30 __do_sys_delete_module+0x346/0x510 Use kfree_rcu() with the existing rcu_head to keep the parent alive until these readers finish. Successful helper references already prevent normal module unload, and incarnation RCU callbacks do not access the parent. Fixes: 363c97d7435e ("ipvs: convert app locks") Cc: stable@vger.kernel.org Signed-off-by: Chengfeng Ye Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 0f296ae8f4d69638b694ff69de1c868ce87942ac Author: Yingjie Wang <1075151112@qq.com> Date: Mon Nov 9 16:29:40 2026 +0800 ipv6: reject routes without an inet6_dev commit 08a1eb7a634f665718ebe74e0960e242f597135e upstream. ip6_route_output() and ip6_route_lookup() can return an error-free route whose rt6i_idev is NULL. Lowering an external nexthop device's MTU below IPV6_MIN_MTU tears down its inet6_dev, while fib6_ifdown() leaves routes using nexthop objects in the FIB. An unprivileged user with CAP_NET_ADMIN in a private user and network namespace can construct this state. Consumers which treat a route without an error as usable can then dereference the NULL rt6i_idev. This was reproduced as a KASAN NULL pointer dereference in ip6_tnl_xmit(). An audit of IPv6 route and tunnel users found this unchecked ip6_dst_idev() dereference. A similar missing inet6_dev check was fixed in commit 1b9b5323725e ("netfilter: ip6t_rpfilter: reject routes without inet6_dev"). However, the route construction path still marks routes without an inet6_dev as successful, leaving every consumer responsible for the same check. Acquire the inet6_dev reference before initializing the destination. If a non-reject route has no inet6_dev, initialize it as RTN_UNREACHABLE instead of a successful route. Explicit reject routes keep their original type and error. This establishes that ordinary error-free IPv6 routes have an inet6_dev while retaining the existing defensive checks at callers. The modified route object builds cleanly with W=1. A full x86_64 KASAN bzImage build completes; it reports two pre-existing kernel-doc warnings outside this change. Tests: - `make W=1 net/ipv6/route.o` - full x86_64 KASAN `bzImage` build with `W=1` - KASAN QEMU with an unprivileged user and network namespace: after lowering the MTU, the stale route returned `No route to host`, a normal route still resolved, and the collect_md trigger completed without KASAN, oops, or panic - `tools/testing/selftests/net/ip6_tunnel.sh` in the same KASAN QEMU Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects") Closes: https://lore.kernel.org/netdev/DMP4WRIOGMBX.3VW2KNLBGDZ0K@gmail.com/ Suggested-by: Alexei Starovoitov Reviewed-by: Hangbin Liu Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang <1075151112@qq.com> Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/tencent_91DA7FD8277B509C55906702D1E425FBC906@qq.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 5eeb982f3e377477067ca087b12b24b6c77b129f Author: Xia Yan Date: Mon Nov 9 09:45:25 2026 +0800 ipv6: fix cached route reuse for control messages commit f778e80b3daf5033fb996f45c2b5d0ce1e82c0a7 upstream. A connected IPv6 UDP or ping socket can reuse its cached route when an SO_MARK cmsg requests another mark. A packet can then bypass a prohibit rule instead of failing with EACCES. ip6_sk_dst_lookup_flow() reads the cache even when connected is false. UDP clears connected after parsing IP or socket control messages. Ping always passes false. Only read the cache when connected is true. Ordinary connected UDP sends keep using the cache. Ping sends do a fresh lookup. Found during code review of IPv6 UDP route caching. On UML, the same connected-socket selftest fails four IPv6 cases before the fix and passes all 54 with it. Fixes: c6af0c227a22 ("ip: support SO_MARK cmsg") Suggested-by: Willem de Bruijn Link: https://lore.kernel.org/netdev/willemdebruijn.kernel.1e0038bcc3ef8@gmail.com/ Cc: stable@vger.kernel.org Signed-off-by: Xia Yan Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261109014400.9025-1-yanxia@cmss.chinamobile.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 056d0beca16b93a54f533f51bfd3190652e3d7a1 Author: Daniël Trujillo Date: Fri Nov 6 05:02:23 2026 +0000 ipv4: fib_trie: prevent speculative out-of-bounds child access commit fd3d73286662950656f54616d0b3fea29e2dc99a upstream. fib_table_lookup() checks the child index against the bounds before passing it to get_child_rcu(). The index is derived from the lookup key, which in turn is derived from flp->daddr. A userspace process can therefore influence the index by triggering lookups for chosen destination IPv4 addresses. If this bounds check is mispredicted as in-bounds, an out-of-bounds index can be transiently passed to get_child_rcu(). The value loaded beyond the child array is then treated as a node pointer. A later transient dereference of that pointer can cause a data-dependent cache footprint. This was found during Spectre-v1 research. Leakage was demonstrated with instrumentation that delays branch resolution with a CLFLUSH before the mispredicted branch and makes the leaked location deterministic for reproducible measurement. In that setup, a userspace-controlled IPv4 lookup key was able to trigger a transient out-of-bounds child access. The transient use of the loaded value as a pointer caused a data-dependent cache footprint that was recoverable from userspace using Prime+Probe. A real-world attacker would likely need to delay branch resolution, which was not demonstrated end-to-end without the added CLFLUSH. Sanitize the index with array_index_nospec() before accessing the child array. This removed the observed leakage in the described setup. Apply the hardening before setting cindex in fib_table_lookup(), because cindex can later be used by the backtrace path to load another child pointer. fib_find_node() has the same pattern, with the checked index derived from a user-provided key in fib_table_insert() and fib_table_delete(). leaf_walk_rcu() has a similar checked cindex before get_child_rcu(), and the traversed state can be influenced by userspace actions. fib_find_node() runs under RTNL and leaf_walk_rcu() is not on the packet lookup hot path, so harden those analogous accesses in the same way. Also harden fib_trie_get_next(), where a mispredicted loop condition could transiently read one child past the array. I see a slowdown of roughly 10% in a microbenchmark where we call fib_table_lookup() with 64 routes directly from inside the kernel. I observed no slowdown in a loopback UDP sendto() microbenchmark. Fixes: 9f9e636d4f89 ("fib_trie: Optimize fib_table_lookup to avoid wasting time on loops/variables") Cc: stable@vger.kernel.org Reviewed-by: Eric Dumazet Signed-off-by: Daniël Trujillo Link: https://patch.msgid.link/20261106-fib-trie-nospec-v3-1-53da6550dcf8@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit abe22654487724fe96bfaeacc502884d981adb06 Author: Kyle Zeng Date: Thu Oct 29 21:22:29 2026 -0700 ipv4: keep XFRM headers out of corked skb lengths commit 0f47fce51a98d3d9f439c16861d519a7b833a176 upstream. __ip_append_data() allocates space for dst.header_len in the first skb, but includes that space in skb->len until __ip_make_skb() pulls it. Fragment accounting uses an MTU that already excludes the XFRM headers. As a result, the next skb can have a fraggap larger than its capped datalen, and skb_copy_and_csum_bits() can overwrite its shared info. For example, five AH tunnel states can reserve 500 bytes while leaving an effective MTU of 348. With 40 bytes of IPv4 options, the second skb has room for 288 bytes of fragment data but receives a 500-byte gap copy. The overwritten shared info is subsequently consumed by the skb release paths. Reserve the XFRM headers together with the link-layer headroom instead. This keeps skb->len, the gap-copy offsets and the trim lengths relative to the IPv4 packet throughout corking. The network and transport header addresses and the headroom available to XFRM at output are unchanged. Both paged and linear allocations, including subsequent corked appends, use the corrected accounting. Fixes: 353e5c9abd90 ("ipv4: Fix IPsec slowpath fragmentation problem") Cc: stable@vger.kernel.org Signed-off-by: Kyle Zeng Link: https://patch.msgid.link/20261030042229.74068-1-kylebot@openai.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 21417a6a763bb2effde3fb319a11ef22253d8214 Author: Kyle Zeng Date: Wed Nov 4 14:07:47 2026 +0100 mptcp: reject DATA_ACKs against a reversed send interval commit d75e5cd72995ec2fa77ec77a593cea28e2490ff1 upstream. ack_update_msk() samples snd_nxt before taking the data lock, but reads snd_una after taking it. Concurrent transmission and ACK processing can therefore leave the sampled upper bound behind snd_una. Active-open completion also exposes a reversed interval when it initializes snd_una to IDSN + 1 while the socket-owned state synchronization is deferred. A peer-supplied 64-bit Data ACK half a sequence space away can pass both wraparound comparisons against such an interval. The resulting snd_una can make __mptcp_retrans() inflate a fragment's already_sent field. Later ACKs can then underflow data_len and cause out-of-bounds page fragments to be passed to TCP. Read snd_nxt after acquiring the data lock and reject reversed intervals before checking the received Data ACK. This keeps the interval shorter than half the sequence space, so the existing upper-bound check cannot accept an advance beyond snd_nxt. Preserve the existing handling of old ACKs and keep the transmit fields under their existing socket locking. Cc: stable@vger.kernel.org Fixes: 7439d687b79c ("mptcp: avoid a few atomic ops in the rx path") Fixes: 3f83d8a77eee ("mptcp: fix more tx path fields initialization") Signed-off-by: Kyle Zeng Signed-off-by: Eric Dumazet Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20261104130747.1045741-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 8a85a717144087ecac0407b8459a78967e7ed4ea Author: Zixuan Chai Date: Fri Nov 6 11:30:19 2026 +0800 seg6: validate state in netfilter continuations commit 549484dd3e80a721d51bd695f22a800d2e05bea1 upstream. When nf_hooks_lwtunnel is enabled, End.DX4 sends decapsulated packets through NF_INET_PRE_ROUTING. If DNAT changes the inner destination, nf_nat_ipv4_pre_routing() drops skb_dst(), and the continuation then dereferences the missing dst's lwtstate. This causes a KASAN NULL pointer dereference and fatal exception panic. End.DX6 has the same issue with IPv6 DNAT. In seg6_iptunnel, POST_ROUTING SNAT with an outbound XFRM policy can replace the dst before the continuation resumes. Validate the current dst and expected lwtstate type in each NF_HOOK() continuation before calling the existing handler. Drop packets with missing or incompatible state while preserving direct no-hook paths. The helpers return bool because callers only need a validity check. Testing shows that the End.DX4 DNAT reproducer triggers a KASAN NULL pointer dereference without this change and no longer does so with the fix. The SNAT+ESP/XFRM reproducer also completes without the reported fault. The in-tree End.DX4 netfilter forwarding selftest passes all four bidirectional checks with nf_hooks_lwtunnel disabled and enabled. Fixes: 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane") Cc: stable@vger.kernel.org Reported-by: Vega Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260720204430.1886091-1-xmei5@asu.edu Signed-off-by: Zixuan Chai Signed-off-by: Ren Wei Reviewed-by: Hangbin Liu Acked-by: Pablo Neira Ayuso Reviewed-by: Andrea Mayer Link: https://patch.msgid.link/8574739acd6f5d9eb0a5640e893122619e9f79ef.1793726355.git.petalzu987@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 8a8043bb3b7093f92e776a8125be7bd4ad0214d4 Author: Hyunwoo Kim Date: Wed Nov 11 15:24:03 2026 +0900 tcp: fix request_sock use-after-free during Fast Open accept() commit 62754aad50d0b30938bd8ce30b43474ce502a2af upstream. Commit e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()") made inet_csk_accept() check tfo_listener before taking fastopenq.lock to avoid taking the lock for connections that did not use Fast Open. reqsk_fastopen_remove() clears tfo_listener while holding fastopenq.lock, then reads req->sk. If inet_csk_accept() concurrently observes tfo_listener after it has been cleared, it skips fastopenq.lock and drops the last reference to the request_sock. This can free the request_sock while reqsk_fastopen_remove() is still using it. If the freed memory is reused for a new request_sock with req->sk == NULL, the reset path in reqsk_fastopen_remove() can append the new request_sock to the original listener's list of requests that caused an RST. After the new request_sock is freed, the next append writes through the stale rskq_rst_tail into freed memory. KASAN reported the following use-after-free when writing fastopenq->rskq_rst_tail->dl_next = req: BUG: KASAN: slab-use-after-free in reqsk_fastopen_remove+0x142/0x210 Write of size 8 at addr ffff888108230688 by task swapper/5/0 ... Call Trace: ... reqsk_fastopen_remove+0x142/0x210 tcp_check_req+0x96f/0xdd0 ... tcp_rcv_state_process+0x19c/0x26b0 ... tcp_v4_do_rcv+0x16e/0x490 tcp_v4_rcv+0x14a0/0x1af0 ... ip_protocol_deliver_rcu+0x39/0x1e0 ip_local_deliver_finish+0x124/0x1e0 ip_local_deliver+0xfb/0x1e0 ... To widen the race windows, mdelay(5) was added after newsk = req->sk, mdelay(20) after the if (req) reqsk_put(req) block, and mdelay(100) after tcp_rsk(req)->tfo_listener = false. The KASAN report above was reproduced with this kernel. For the lockless check, use tcp_sk(newsk)->syn_fastopen_child instead of tfo_listener, which reqsk_fastopen_remove() clears. syn_fastopen_child is a field of the Fast Open child TCP socket referenced by newsk, not of the request_sock. It is set before the child socket is added to the accept queue. The paths that call reqsk_fastopen_remove() in response to a remote ACK or RST do not clear this field. inet_csk_accept() uses this field to take fastopenq.lock only for Fast Open child sockets and rechecks tfo_listener while holding the lock. Connections that did not use Fast Open continue to avoid the lock. Fixes: e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()") Cc: stable@vger.kernel.org Signed-off-by: Hyunwoo Kim Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/avQKA_YTAThtbsYU@v4bel Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 9761df82ee9e68fd5cbe3bab578476992939353a Author: Jérémy Jean Date: Sat Nov 7 22:47:33 2026 +0000 tcp: fix authentication bypass via unsupported TCP auth options commit 7cc235fb1251fec1183e3158c60d2e504c2a8e8b upstream. tcp_inbound_hash() parses both TCP-MD5 and TCP-AO options when at least one of the two features is enabled. With TCP_MD5SIG=y and TCP_AO=n, a packet carrying an AO option reaches the disabled tcp_inbound_ao_hash() stub. That stub returns success, so sockets configured to require MD5 authentication end up accepting unauthenticated data. A forged AO option skips the unsigned fast path, which is the only place where tcp_inbound_hash() can return SKB_DROP_REASON_TCP_MD5NOTFOUND. The inverse configuration with TCP_MD5SIG=n and TCP_AO=y has the same problem for an MD5 option on AO sockets. Note that TCP-AO depends on 64BIT: therefore, every 32-bit kernel with TCP_MD5SIG=y is in the vulnerable configuration. Make the disabled stubs reject options for the unsupported authentication scheme. This matches the real helpers' behavior for sockets without keys. It also means that kernels with TCP_MD5SIG=n and TCP_AO=y now drop segments carrying an MD5 option on unkeyed sockets, as kernels configured with TCP_MD5SIG=y already do. Fixes: 0a3a809089eb ("net/tcp: Verify inbound TCP-AO signed segments") Cc: stable@vger.kernel.org Signed-off-by: Jérémy Jean Reviewed-by: Kuniyuki Iwashima Acked-by: Dmitry Safonov Link: https://patch.msgid.link/20261107224733.1104094-2-Jeremy.Jean@oss.cyber.gouv.fr Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit c9484616ef9b00343bb880b1f11100822b877b3e Author: Hyunwoo Kim Date: Fri Nov 6 21:25:21 2026 +0900 tcp: do not coalesce segments after FIN commit 1c46780dec48893b8c25fd5e33a3127e8dc39dd4 upstream. A FIN consumes a sequence number. If another FIN segment is coalesced into an skb that already carries FIN, end_seq advances to account for the additional FIN, but tcp_flags still contains only one FIN bit. When the preceding gap is filled and tcp_ofo_queue() processes the coalesced skb, rcv_nxt advances to the skb's end_seq. When the receive path consumes all data in the skb, copied_seq advances by the data length and one sequence number for FIN. If three or more FIN segments have been coalesced into one skb, tcp_inq() can still return a positive value after the receive queue becomes empty and the SOCK_DONE adjustment is applied. TCP_ZEROCOPY_RECEIVE is another consumer affected by this state. tcp_zerocopy_receive() takes its length from tcp_inq() and follows skb->next without checking for the end of the receive queue. Software kTLS receive is one consumer affected by this state. When strp->copy_mode is false, tls_strp_msg_consume() calls the TCP helper tcp_read_done() to consume the current TLS record. In the reproducer, tcp_read_done() consumed the record data and one FIN before freeing the receive skb. When kTLS looked for the next record, tcp_inq() reported at least TLS_HEADER_SIZE bytes even though the receive queue was empty. tcp_recv_skb() returned NULL, so tls_strp_load_anchor_with_queue() hit WARN_ON_ONCE() and returned without updating the anchor. Since tcp_inq() had reported at least TLS_HEADER_SIZE, tls_strp_read_sock() proceeded to tls_strp_check_queue_ok(). skb_shinfo(strp->anchor)->frag_list still pointed to the freed receive skb. tls_strp_check_queue_ok() then read TCP_SKB_CB(first)->seq through the stale pointer, causing a use-after-free. The reproducer followed this call path: tls_rx_rec_done() tls_strp_msg_consume() tcp_read_done() // frees the receive skb tls_strp_check_rcv() tls_strp_read_sock() tls_strp_load_anchor_with_queue() // returns after WARN_ON_ONCE() tcp_recv_skb() == NULL tls_strp_check_queue_ok() TCP_SKB_CB(first)->seq // reads the freed receive skb KASAN reported: BUG: KASAN: slab-use-after-free in tls_strp_check_queue_ok.isra.0+0x5f/0x100 Read of size 4 at addr ffff888103169ca8 by task ktls-server/71 ... Call Trace: ... tls_strp_check_queue_ok.isra.0+0x5f/0x100 tls_strp_check_rcv+0x2a9/0x400 ... tls_sw_recvmsg+0x3ce/0xa10 ... sock_recvmsg+0xea/0x100 __sys_recvfrom+0x142/0x1f0 ... __x64_sys_recvfrom+0x76/0x90 do_syscall_64+0xdd/0x4a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... ... Freed by task 71: ... napi_skb_cache_put+0x24/0xf0 skb_attempt_defer_free+0x183/0x3b0 tcp_read_done+0x2d4/0x340 tls_strp_msg_consume+0x45/0x80 tls_sw_recvmsg+0x3c4/0xa10 ... In tcp_try_coalesce(), skip coalescing when the destination skb already carries FIN. tcp_add_backlog() calls skb_try_coalesce() directly instead of using this helper, so add the same check there. Since both paths check only the destination skb, a final segment carrying data and FIN can still be coalesced into an skb without FIN when the other coalescing checks pass. Fixes: e93a0435f809 ("tcp: allow segment with FIN in tcp_try_coalesce()") Fixes: 4f693b55c3d2 ("tcp: implement coalescing on backlog queue") Cc: stable@vger.kernel.org Signed-off-by: Hyunwoo Kim Reviewed-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/au3HMfqNW3_DRMqS@v4bel Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit d5e87d39681a48250e40fcd24e780a981a32adbc Author: Yingjie Wang Date: Wed Nov 4 12:32:19 2026 +0000 tcp: free saved_syn after an RCU grace period commit 2b9fd1a0abf0c1c7200be7a33cfeeca1c68089b6 upstream. tcp_reqsk_record_syn() allocates saved_syn separately from its request socket. bpf_sock_ops_get_syn() can load that pointer while processing a retransmitted SYN under RCU. There are two ownership transfers which can let another CPU reclaim the allocation while such a reader is still using it. First, tcp_move_syn() transfers req->saved_syn to a newly created child socket. The child can be closed and tcp_saved_syn_free() can reclaim the allocation before a reader of the old request finishes. Second, inet_reqsk_clone() shallow-copies request_sock during request migration. After reqsk_migrate_reset() clears the old request pointer, the migrated clone owns it. However, a reader which already loaded the pointer from the old request can still be using it when the clone is released. I found this through LLM-assisted concurrency fuzzing. Mark the request-socket saved_syn pointer as RCU protected and use RCU accessors for its reads and updates. Keep the full-socket pointer plain because all of its accesses hold the socket lock. Embed an rcu_head in struct saved_syn and use kfree_rcu() in both teardown paths. This lets a request-side reader which loaded the object before an ownership transfer finish. This follows commit e3f33b0a1d89 ("ipv4: free inet_opt and ireq_opt after an RCU grace period"), which fixed the same ownership-transfer pattern for IPv4 options. The issue was confirmed with KASAN on v7.3-16007-g36aad21d50d1 using temporary kernel instrumentation to widen the reader and request-migration window. KASAN reported a slab-use-after-free read in bpf_sock_ops_get_syn(), with the allocation freed by __reqsk_free() from reqsk_timer_handler(). The same explicit migration test completed without a report with deferred reclamation. A patched kernel without the delay instrumentation also completed a successful migration and seven saved-SYN reads without a KASAN report. Fixes: 0813a841566f ("bpf: tcp: Allow bpf prog to write and parse TCP header option") Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.") Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang Reviewed-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/38fa9f2cc476502e9b1c1fef09ebba1df5dd5901.1793795528.git.x-professor@outlook.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit f887b37519d5a2a228d16d42e58e6996bc9edf2a Author: Eduardo Mucelli Rezende Oliveira Date: Tue Nov 10 20:08:45 2026 +0100 tools/bootconfig: Close only opened braces in compact output commit 26fa92f351d4993428268afebf6c60c987477af5 upstream. A key may have both a value and subkeys. When it has only one subkey, xbc_show_compact_tree() can print that subkey using dotted notation without opening a brace. During backtracking, however, it treats the value node followed by a subkey as evidence that a brace was opened. For example, a.b=v, a.b.c=w and a.z=q are printed with the brace for a closed before z. Reading that output back changes a.z into the root key z, silently changing the configuration. Check the key children when deciding whether to close a brace. Skip the value child, and account for a sole subkey that itself has both a value and subkeys, since that combination is not compacted. This follows the conditions used to open braces without keeping a depth-indexed array. Extend the mixed-value/subkey sample to cover the lost sibling. Link: https://lore.kernel.org/all/6ad67e4cda05238cd173c99e820a85de2c13f5fc.1794337724.git.edumucelli@gmail.com/ Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key") Cc: stable@vger.kernel.org Signed-off-by: Eduardo Mucelli Rezende Oliveira Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 18f4e9564c974f71fd542110accead449452e746 Author: Rishikesh Jethwani Date: Mon Nov 2 14:30:06 2026 -0700 tls: only install push_pending_record for a TX context commit c47e766c5307c06a78304582b2b5b5ab01ee1358 upstream. tls_set_sw_offload() assigns ctx->push_pending_record for both directions, but the hook is a TX-side dispatcher. On a socket whose TX side is HW offloaded, tls_set_device_offload() installs tls_device_push_pending_record(); any later TLS_RX setsockopt overwrites it with tls_sw_push_pending_record(), because tls_set_device_offload_rx() itself calls tls_set_sw_offload(sk, 0, NULL) for the software half of a successful HW RX offload, and so does the fallback when the RX offload is declined (NIC with TX-only offload, tls_dev_add() failure). From then on tls_handle_open_record() (a TLS_SET_RECORD_TYPE cmsg after a MSG_MORE send, or the close path with a pending writer) runs tls_sw_push_pending_record() against priv_ctx_tx, which is a struct tls_offload_context_tx, not a struct tls_sw_context_tx, and reads open_rec from inside the offload context. On x86_64 without lock debugging that field overlays sg_tx_data[2].dma_address, which is never set, so the push is silently skipped and the data buffered by the MSG_MORE send is later sent under the cmsg's record type, e.g. application data in a handshake or alert record. Enabling CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_LOCK_ALLOC and CONFIG_LOCKDEP, but not CONFIG_LOCK_STAT, in the tested x86_64 configuration moves open_rec over sg_tx_data[5].page_link. Once populated, its page pointer and scatterlist flags are interpreted as a tls_rec pointer and dereferenced while reading msg_plaintext.sg.size. Only set the hook when initialising the TX side. Found by code review while developing TLS 1.3 HW offload rekey support. Tested with HW TLS TX and RX offload on Mellanox ConnectX-6 Dx (Crypto Enabled): after setting TLS_RX, send() "AAAA" with MSG_MORE, then sendmsg() "BBBB" with a TLS_SET_RECORD_TYPE cmsg for a handshake record. Without this patch the peer receives a single handshake record "AAAABBBB"; with it, an application data record "AAAA" followed by a handshake record "BBBB". Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Cc: stable@vger.kernel.org Signed-off-by: Rishikesh Jethwani Link: https://patch.msgid.link/20261102213011.4191020-1-rjethwani@purestorage.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit efb739f1e258e953e0a1aa910c2b16f91702721a Author: Hungyu Lin Date: Fri Oct 30 05:42:27 2026 +0000 tsacct: Keep task begin times stable across suspend commit c49b3c20a2d0b22700e2100a527e68e829ece7f0 upstream. bacct_add_tsk() derives ac_btime and ac_btime64 by subtracting a CLOCK_MONOTONIC elapsed duration from CLOCK_REALTIME. MONOTONIC stops during suspend while REALTIME continues, so querying an existing task after resume moves its reported begin time forward by the time spent suspended. Calculate the begin time from the wall-clock boot timestamp and the task's CLOCK_BOOTTIME start timestamp instead. This accounts for suspend and adds the nanoseconds before truncating to seconds. Keep ac_etime and ac_tgetime on CLOCK_MONOTONIC and retain the existing rebasing when the wall clock is adjusted. The new begin time can be negative: setting CLOCK_REALTIME is bounded by CLOCK_MONOTONIC, which excludes suspend, rather than CLOCK_BOOTTIME. A permitted backward clock adjustment after suspend can therefore put the task's begin time before the epoch. Clamp ac_btime64 at zero too, instead of wrapping in the unsigned field, and retain its positive range. Fixes: f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats") Reported-by: Oleg Nesterov Suggested-by: Thomas Gleixner Signed-off-by: Hungyu Lin Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20130611200600.GA15168@redhat.com Link: https://lore.kernel.org/r/alpine.DEB.2.21.1911071335320.4256@nanos.tec.linutronix.de Link: https://patch.msgid.link/20261030054227.35453-3-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c0f02fb47cc5c6471d99623f625e3fa146b07ad Author: Jerome Mohm Date: Mon Nov 9 20:39:24 2026 +0100 vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore commit 2a24ba1694f14299fbde3fa107e5d56629f2f8b6 upstream. virtio_vsock_vqs_del() frees the virtqueues but leaves vsock->vqs[] pointing at them. If virtio_vsock_restore() then fails, the driver stays bound with a dangling vqs[], and the next freeze or unbind passes a freed virtqueue to virtqueue_detach_unused_buf(): BUG: KASAN: slab-use-after-free in virtqueue_detach_unused_buf virtio_vsock_vqs_del (net/vmw_vsock/virtio_transport.c:785) virtio_vsock_remove Freed by task ...: vp_del_vqs virtio_vsock_freeze Clear vqs[] after del_vqs() and when virtio_find_vqs() fails. Return early from virtio_vsock_vqs_del() when vqs[] is empty: the detach loops would pass NULL to virtqueue_detach_unused_buf(), and a second del_vqs() would free virtio-mmio's IRQ again, which only WARNs in free_irq() ("Trying to free already-free IRQ"). Found with the help of Anthropic's Claude and reproduced on virtio-pci and virtio-mmio by failing the restore with failslab, without other kernel changes; the virtio-mmio WARN was found by the netdev Sashiko review and reproduced with v1 of this patch. With this patch neither report appears on virtio-pci or virtio-mmio guests, and the vsock vmtest.sh single-VM tests pass. A find_vqs() failure after some virtqueues were set up was not exercised. Fixes: bd50c5dc182b ("vsock/virtio: add support for device suspend/resume") Cc: stable@vger.kernel.org Signed-off-by: Jerome Mohm Reviewed-by: Stefano Garzarella Link: https://patch.msgid.link/20261109-vsock-restore-uaf-send-v4-1-1df8dfb5d5de@eldare.de Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 3362415ed9cf1a0be9f771f4650c13a6f34345ff Author: Ian Rogers Date: Tue Oct 20 09:32:09 2026 -0700 vdso: Add VDSO_UNALIGNED_PACKED config option commit 2727aca4439ee4b9085141a3babadc8de580397f upstream. Commit a339671db64b ("vdso: Switch get/put_unaligned() from packed struct to memcpy()") switched __get_unaligned_t() and __put_unaligned_t() from using a __packed struct to __builtin_memcpy() to avoid strict aliasing undefined behavior. On targets without efficient unaligned memory accesses (such as ARMv5), GCC may not inline __builtin_memcpy() into byte shifts and instead emit stack spills or much slower out-of-line memcpy() calls. Add CONFIG_VDSO_UNALIGNED_PACKED, defaulting to !HAVE_EFFICIENT_UNALIGNED_ACCESS, to use the __packed struct implementation on strict-alignment targets while keeping __builtin_memcpy() elsewhere and in tools/. Fixes: a339671db64b ("vdso: Switch get/put_unaligned() from packed struct to memcpy()") Reported-by: Stefan Kerkmann Signed-off-by: Ian Rogers Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261020163210.742728-1-irogers@google.com Closes: https://lore.kernel.org/lkml/47f8c30b-e326-4ff0-a2bc-5683209a9e2d@pengutronix.de/ Signed-off-by: Greg Kroah-Hartman commit 0198d11de9604fb2ff0d3a4207487aa6ec21e2c7 Author: Christian Brauner Date: Mon Nov 9 17:51:22 2026 +0100 udf: don't allocate the inode block in udf_sync_inode_metadata() commit 05ad4c91fe2852a19d04311883420ffefb02300d upstream. udf_sync_inode_metadata() looks the block that holds the inode up with sb_getblk() which allocates a buffer for it if it isn't cached. But a block that isn't cached is neither dirty nor under writeback, so there's nothing to write or to wait for and the buffer just gets thrown away again. That allocation is also something we can't afford once inode eviction calls ->sync_inode_metadata() from reclaim. So look the block up with sb_find_get_block_nonatomic() instead. Cc: stable@vger.kernel.org # v7.3 Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-7-91ac6c024018@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 99a75944b94578e4268cd52461a1aa981aceeab5 Author: Rongzheng Wang Date: Wed Nov 4 11:48:08 2026 +0800 xsk: defer software checksum until the skb is complete commit f2eddafbfcc004098425fee7c5664adbe29152d7 upstream. When XDP_UMEM_TX_SW_CSUM is used with multi-buffer TX, xsk_skb_metadata() calls skb_checksum_help() while only the first descriptor has been added to the skb. The checksum therefore covers just the first fragment, and skb_checksum_help() sets ip_summed to CHECKSUM_NONE, so the remaining fragments are never included in the checksum. Move the software checksum calculation to the point where the last descriptor has been added to the skb. On a checksum failure the packet is now dropped instead of being returned to the application for a retry. This path is not reachable with the existing metadata validation, but the behavior change is intentional. Fixes: 11614723af26 ("xsk: Add option to calculate TX checksum in SW") Cc: stable@vger.kernel.org Reviewed-by: Maciej Fijalkowski Acked-by: Stanislav Fomichev Reviewed-by: Jason Xing Signed-off-by: Rongzheng Wang Link: https://patch.msgid.link/20261104034809.24545-2-testwrzwrz@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit e18dac856ce469655ad93fb40a08b6bd8230eb25 Author: Tim Menninger Date: Tue Nov 10 18:27:27 2026 +0000 xprtrdma: serialize unmap_sync with xprt_disconnect commit 1fa415883c37b02ff17acdd7977ed591d3d389ee upstream. frwr_unmap_sync() posts LOCAL_INV Work Requests to the QP and waits for the matching CQE. This can race with rpcrdma_xprt_disconnect(): 1. frwr_unmap_sync() samples r_xprt->rx_ep 2. rpcrdma_xprt_disconnect() drains the QP 3. frwr_unmap_sync() posts LOCAL_INV WRs after the drain 4. No CQE arrives, so wait_for_completion() blocks indefinitely The hung task appears in the rpciod workqueue: Workqueue: rpciod rpc_async_schedule [sunrpc] wait_for_completion() frwr_unmap_sync() xprt_rdma_free() xprt_release() Serialize synchronous MR invalidation against QP teardown with rx_unmap_rwsem. frwr_unmap_sync() holds the read side while it builds and submits the LOCAL_INV chain. Disconnect holds the write side across QP drain and resource teardown. Drop the read side before waiting so disconnect can drain the submitted Work Requests and deliver their CQEs. Disconnect can reset a request while frwr_unmap_sync() waits for the read side. Recheck rl_registered after acquiring the rwsem and return without posting if the request has already been reset. Move the synchronous invalidation completion from the final MR to the request, whose lifetime covers xprt_rdma_free(). This allows disconnect to destroy MRs after draining the QP while frwr_unmap_sync() is still waiting. On a post failure, call rpcrdma_force_disconnect() before dropping the read side so the endpoint is not dereferenced after disconnect can run. frwr_unmap_async() runs inline from Receive completion processing. rpcrdma_xprt_drain() drains the Receive Queue before the Send Queue, so asynchronous LOCAL_INV Work Requests are submitted before Send Queue drain. frwr_unmap_sync(), however, runs from xprt_rdma_free() after the transport send lock has been released, so it is not ordered against disconnect. Tested on v7.4-rc1 under pNFS load with repeated data server restarts to provoke rapid QP disconnect/reconnect cycling. Without the fix, a hung task in frwr_unmap_sync() reproduced twice in six attempts. With the fix, no hang occurred across 200 cycles. Also observed on v6.8 and v6.18.34. Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt") Cc: stable@vger.kernel.org Assisted-by: Claude:opus-4-7 Reviewed-by: Chuck Lever Signed-off-by: Tim Menninger Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman commit 804e9f713633e25d903690fa712d7dc995d370bf Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Sun Nov 1 00:52:13 2026 +0800 net: usb: lan78xx: let unregister_netdev() stop phylink commit 9280128245612b30ca4a238daa6a777b0f4e583e upstream. lan78xx_disconnect() stops phylink before unregistering the net device. phylink_start() is only called from lan78xx_open(), so when the device is unplugged before the interface has been brought up, the attached PHY is still in PHY_READY and phy_stop() reports: called from state READY WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0xad/0x380 The same warning is emitted after an ifup/ifdown cycle, where the PHY is already in PHY_HALTED. unregister_netdev() already closes a running device, which calls lan78xx_stop() and phylink_stop() with dev->dev_mutex held and after the URBs have been terminated. Unregister first and disconnect the PHY afterwards, so the interface is stopped exactly once and only while it is running, and the net device can no longer be opened while its phylink instance has no PHY attached. Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Reviewed-by: Oleksij Rempel Link: https://patch.msgid.link/20261031165213.2738-1-25031212351@stu.xidian.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 2e6f5dc0a316162ade8a98603fa76fa184e02552 Author: James Clark Date: Wed Nov 4 12:25:04 2026 +0700 net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl commit b66fca408bf85bb40f48a689daac75421f5283f8 upstream. Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info") modified the PTP core to validate the supported flags of external timestamp requests, rather than relying on each driver to check them. stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any .supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for this driver with -EOPNOTSUPP, where before that commit the same requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works. Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the auxiliary snapshot inputs timestamp just the rising edge. The reference manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC 3.70a, which uses dwmac1000_ptp_clock_ops) say the same. Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the rising edge then succeeds, and one for the falling edge or for both edges fails with -EOPNOTSUPP. Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info") Cc: stable@vger.kernel.org Signed-off-by: James Clark Reviewed-by: Maxime Chevallier Reviewed-by: Lorenzo Bianconi Reviewed-by: Kory Maincent Link: https://patch.msgid.link/20261104052504.1886335-1-jjc@jclark.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 25de7edc0c032bc0b8fc9a6061e4092c2140a20f Author: Zhao Gongyi Date: Wed Nov 11 11:35:25 2026 +0800 net: netns: fix INT_MAX nsid cleanup commit dd6f1e7582f0f7f12c2d620cf50446aa987d7327 upstream. A syzkaller reproducer assigning INT_MAX as a peer nsid triggers an idr_get_next() warning during netns cleanup. With panic_on_warn, this panics the kernel. alloc_netid() also overflows reqid + 1 for this nsid. Use idr_alloc_u32() for requested IDs and idr_get_next_ul() for cleanup so the cursor can advance past INT_MAX. QEMU/KVM reproduced the warning without kernel changes or fault injection. The same reproducer ran without warnings after this change. Kernel selftests were not run. Fixes: 7acee67a6bce ("netns: optimize netns cleaning by batching unhash_nsid calls") Cc: stable@vger.kernel.org Signed-off-by: Zhao Gongyi Link: https://patch.msgid.link/20261111033525.65828-1-zhaogongyi@bytedance.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 80454ac14c8e41e54330dd4ab7994a9c44bfc0ce Author: Hamza Mahfooz Date: Mon Nov 9 09:28:56 2026 -0500 net: mana: report RX checksum offload for IPv6 commit bbcd02741c4cfbf9e1c59b1906f21ef772bd15eb upstream. The hardware validates TCP and UDP checksums for both IPv4 and IPv6 and reports the result in rx_tcp_csum_succeed and rx_udp_csum_succeed. However, mana_rx_skb() also requires rx_iphdr_csum_succeed before it sets CHECKSUM_UNNECESSARY. That bit is only set for IPv4 (since IPv6 has no header checksum), so IPv6 TCP and UDP traffic is always checksummed again in software. So, only look at the L4 result. For IPv4 this makes no material difference since CHECKSUM_UNNECESSARY only covers the L4 checksum, and ip_rcv_core() always verifies the IPv4 header checksum in software. Between two Azure Standard_E16s_v6 VMs (VF enabled), IPv6 TCP and UDP packets (including VXLAN over IPv6), now arrive with CHECKSUM_UNNECESSARY instead of CHECKSUM_NONE, so GRO no longer checksums them in software. Calls to __skb_gro_checksum_complete() on the receiver during an 8 second iperf3 run: before after TCP/IPv4, 12.2 Gbps 23 28 TCP/IPv6, 12.1 Gbps 8728419 25 UDP/IPv6, 1.5 Gbps 1071380 20 TCP/VXLAN/IPv6, 10.9 Gbps 7934373 18 Cc: stable@vger.kernel.org Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Reviewed-by: Haiyang Zhang Signed-off-by: Hamza Mahfooz Link: https://patch.msgid.link/20261109142856.779955-1-hamzamahfooz@linux.microsoft.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit a735475d51d5617599d68a5c4ea92c9e019743e0 Author: Jens Axboe Date: Fri Nov 6 16:50:46 2026 -0700 net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls commit bdc350ddbcbe4788158019d4d8e8e9345cb16235 upstream. ____sys_sendmsg() and ____sys_recvmsg() turn O_NONBLOCK on the socket into MSG_DONTWAIT. That is right for the system calls, but io_uring uses __sys_sendmsg_sock() and __sys_recvmsg_sock() for a blocking attempt from io-wq as well, after the non-blocking attempts with MSG_DONTWAIT have failed. On an O_NONBLOCK socket that attempt can't block either and the request completes with -EAGAIN, unlike IORING_OP_SEND and RECV, which call sock_sendmsg() and sock_recvmsg() directly and don't look at O_NONBLOCK at all. Move the O_NONBLOCK handling to ___sys_sendmsg() and ___sys_recvmsg(), which the sendmsg, sendmmsg, recvmsg and recvmmsg system calls go through. The io_uring helpers then pass the flags the caller asked for. Cc: stable@vger.kernel.org Fixes: 0fa03c624d8f ("io_uring: add support for sendmsg()") Fixes: aa1fa28fc73e ("io_uring: add support for recvmsg()") Link: https://lore.kernel.org/io-uring/a5589b66-9a20-4b1c-a0f1-1b5b31af3667@app.fastmail.com/ Reported-by: Lukáš Lalinský Signed-off-by: Jens Axboe Signed-off-by: Dave Miller Signed-off-by: Greg Kroah-Hartman commit 3fc2e8afcaed6ad571fa2a8d0ef0ce46b2b56506 Author: Tapio Reijonen Date: Wed Nov 4 07:58:35 2026 +0000 net: dsa: microchip: initialize the IRQ access mutex commit ba1dc196502f3435f4ae53ed6745caacf066f83e upstream. ksz_switch_register() initializes dev_mutex, regmap_mutex, alu_mutex and vlan_mutex but not lock_irq, which the IRQ chip takes in its bus lock callbacks on every mask and unmask of a switch interrupt, and the PTP code takes the same way. The zeroed mutex happens to work on the uncontended fast path, but with CONFIG_DEBUG_MUTEXES the first lock, from the IRQ domain mapping during probe, warns: DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: kernel/locking/mutex.c:625 at __mutex_lock ... ksz_irq_domain_map irq_domain_associate_locked irq_create_mapping_affinity ksz_irq_common_setup ksz9477_setup dsa_register_switch ksz_spi_probe and turns lock debugging off for the rest of the boot. Initialize it with the other mutexes. Triggered at every boot of a KSZ9897S over SPI on an i.MX6 SoloX board with CONFIG_DEBUG_MUTEXES, on v7.4-rc1 and earlier. With this patch the same board boots with lock debugging enabled and it stays enabled (debug_locks 1) through two hours of unrelated stress tests. Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link") Cc: stable@vger.kernel.org Signed-off-by: Tapio Reijonen Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261104-ksz-irq-mutex-init-v1-1-e3bb7d9dbd80@vaisala.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 17a2022d2d1425ef4d6620bcff0acbad2a7522f2 Author: Jun Yang Date: Tue Nov 3 15:54:37 2026 +0800 net: bridge: use one headroom snapshot for ND replies commit e573df093ef849bb7c763aed591cb6556b110671 upstream. br_nd_send() calls LL_RESERVED_SPACE(dev) once to size the reply skb and again to reserve its headroom. When a port requiring more headroom is added to the bridge, br_add_if() can increase dev->needed_headroom between the two calls. The reserved headroom can then exceed the space accounted for by alloc_skb(). Take one headroom snapshot and use it for both the allocation size and skb_reserve(). Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports") Cc: stable@kernel.org Reported-by: TencentOS Corvus AI Signed-off-by: Jun Yang Acked-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261103075439.43644-1-juny24602@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 1e1ccba5ecef761de3138d485563b06f57b32011 Author: Mahanta Jambigi Date: Fri Nov 6 14:04:57 2026 +0100 net/smc: fix link group ownership in handshake abort commit e227b511582828c5a6513f70fc6a71211e5efbf0 upstream. An aborted first-contact handshake can hang the handshake worker on the socket lock it already holds, reset the clcsock of a socket that has fallen back to TCP, or corrupt the alert-node lookup when the handshake retries with the same connection. The abort leaves a connection registered in a link group that another context has already unlinked for termination: smc_conn_free() skips the unregister when lgr->list is empty, so the alert token and alert node stay in lgr->conns_all. If the handshake retries another device or SMC version, smc_conn_create() creates a second link group and smc_lgr_register_conn() inserts the same alert node into it: the token loop is skipped, rb_link_node() links a node that is still in the old tree into the new one, and a second sock_hold() is taken where only one sock_put() will follow. The old group's terminator then keeps returning that node from rb_first() and can kill a connection that now belongs to the new group. smc_lgr_cleanup_early() also starts a second termination of the link group that is already being terminated, which takes lock_sock() on the socket the handshake worker holds; if the termination work wins the race instead, it later kills the freed connection and aborts the clcsock of a socket that has fallen back to TCP. Making the unregister unconditional also lets smc_conn_free() reach the delayed free work on a claimed link group, where the lockless freeing check can arm it after the owner has cancelled it. Always unregister the connection, claim a link group for termination once under lgr_lock, keep the link group alive across the abort, and arm the delayed free work only under the same lock and cancel it synchronously before the teardown. Drop an already freed connection in smc_conn_kill() without running the connection and socket teardown. Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups") Fixes: f9aab6f2ce57 ("net/smc: immediate freeing in smc_lgr_cleanup_early()") Cc: stable@vger.kernel.org Signed-off-by: Mahanta Jambigi Link: https://patch.msgid.link/20261106130457.1092203-1-mjambigi@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 3871bd1cc528b3f9c13eec6d7f8de4a33461c1af Author: Mahanta Jambigi Date: Mon Nov 2 09:31:22 2026 +0100 net/smc: fix lgr/lnk lifetime vs diag reader race commit d7900fa51642fbc2a5a03354238e71050a7d391d upstream. The diag dump walks the socket hash table under a read_lock and dereferences conn->lgr and conn->lnk. Several paths expose a window where a hashed socket has freed or partially freed conn/lgr/lnk state. First, smc_conn_abort() calls smc_conn_free() during early handshake aborts while the socket is still hashed in SMC_INIT, synchronously freeing the lgr on the smc_lgr_cleanup_early() path without holding the hash write_lock. A concurrent diag reader can load a non-NULL conn->lgr and dereference it after the kfree. Skip the connection, link group and DMB attributes in __smc_diag_dump() for sockets in SMC_INIT or SMC_CLOSED or fallen back to TCP, and take diag_mode from an is_smcd flag cached at connection creation. The state filter alone does not close the race. A connection aborted by a failed handshake can keep its alert token, because smc_conn_free() skips the unregister when smc_lgr_terminate_sched() has emptied lgr->list; close_work may also have been queued before the abort, as the CDC receive path is not excluded by the handshake's socket lock. smc_close_passive_work() would then move the hashed socket from SMC_INIT to SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not cover, and later run a passive-closing sock_put() that smc_connect_decline_fallback() dropped already. Return early from smc_close_passive_work() when the connection was freed; the check holds the socket lock that every smc_conn_free() caller holds as well, so a hashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED until release. This changes the sock_diag output for such sockets: the connection, link group and DMB attributes are omitted, which smcss does not read for sockets in these states, while SMC_DIAG_FALLBACK is still reported and an SMC-D socket in SMC_INIT or SMC_CLOSED still reports SMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain TCP socket with no SMC connection state to report; the stale conn fields left behind by smc_conn_abort() must not be read. Second, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach() NULLs and frees conn->sndbuf_desc while the socket is still hashed. A concurrent diag reader entering the CONNINFO block can dereference the freed descriptor. Unhash the socket right before smcd_buf_detach(). As a result, killed ACTIVE and APPCLOSEWAIT sockets that are still open are no longer visible to smcss on loopback-ism devices. Third, in the terminal teardown branches of smc_close_active_abort() (PEERCLOSEWAIT and PROCESSABORT groups) and in smc_close_passive_work(), smc_conn_free() drops lgr and lnk references while the socket is still hashed. Unhash immediately before each smc_conn_free() call at those sites. Sockets killed in those close states are therefore unhashed, and their inuse accounting dropped, before close(), even if the fd is still open. Fourth, use smp_load_acquire() / smp_store_release() on sk_state to order these checks on weakly ordered CPUs. A reader that observes SMC_ACTIVE is guaranteed to see the connection setup that preceded the store; a reader that observes SMC_CLOSED from smc_listen_out_err() skips the connection fields in any case, so that particular store is hardening kept for uniformity, not a required ordering. Additionally, in __smc_diag_dump(), use the cached link->ibname instead of link->smcibdev->ibdev->name, avoiding a NULL pointer dereference or use-after-free of the IB device when __smcr_link_clear() zeroes the link during concurrent SMC-R link failover. The link data is still read without conns_lock or send_lock, so a dump racing a failover may transiently report zeroed or mixed link fields; this does not affect memory safety and the next dump reports the new link. Like the SMC netlink link dump and the tracepoints, the name is the one cached at link creation time. Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets") Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups") Fixes: 46c28dbd4c23 ("net/smc: no socket state changes in tasklet context") Fixes: 9dbe086c69b8 ("net/smc: fix invalid link access in dumping SMC-R connections") Fixes: ae2be35cbed2 ("net/smc: {at|de}tach sndbuf to peer DMB if supported") Cc: stable@vger.kernel.org Signed-off-by: Mahanta Jambigi Reviewed-by: Sidraya Jayagond Link: https://patch.msgid.link/20261102083122.1098393-1-mjambigi@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit f4475b415a930fc820f7af62d0e68b2dc1f1a385 Author: Kyle Zeng Date: Fri Nov 6 20:18:04 2026 -0800 net/rds: Do not unpin a page after a failed atomic pin commit 8d5ce4751fad9499ea408163af7f410f18a85782 upstream. rds_cmsg_atomic() assumes that a non-NULL output from rds_pin_pages() represents a pin that it owns. However, pin_user_pages_fast() can roll back a fast-GUP pin after racing fork() and then fail in the slow path, for example after a concurrent mprotect(PROT_NONE). The output slot can still contain the already-unpinned page. The common error path calls unpin_user_page() on that stale pointer. This can consume another subsystem's pin and allow the page to be freed while it is still in use. A local unprivileged reproducer triggers a KASAN use-after-free write through an io_uring registered buffer. Clear page when rds_pin_pages() does not return one. The error path continues to release the page on errors after a successful pin, and successful requests retain their existing ownership and behavior. All four RDS atomic ancillary operations share this path. The issue was found by an LLM. Fixes: 15133f6e67d8 ("RDS: Implement atomic operations") Cc: stable@kernel.org Signed-off-by: Kyle Zeng Reviewed-by: Allison Henderson Signed-off-by: Dave Miller Signed-off-by: Greg Kroah-Hartman commit 8b5412c9ed33e4f7c6ce54905e42ddb2c3d525cc Author: Jiabin Deng Date: Tue Nov 10 11:57:23 2026 +0800 net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported commit 68c183619f24982a635930697bf8e148f2d78f71 upstream. When SHAMPO and relaxed ordering writes are enabled, aligned RQ end padding can corrupt received TCP data. Due to reordering, alignment padding written at the end of one packet can overwrite data from the next packet. The current RQ end padding selection avoids alignment padding for LRO, but not for SHAMPO. Extend the condition to SHAMPO to prevent this corruption. The issue was observed in a two-host test using a BlueField-3 NIC and an NVIDIA H20 GPU. In the original test with MTU 1500, 354 of 400 transfers contained corrupted data before the fix. After applying this change, all 400 transfers across eight message sizes from 32 KiB to 4 MiB, with 50 transfers per size, completed successfully, with no incorrect bytes or corrupted intervals. Fixes: e5ca8fb08ab2 ("net/mlx5e: Add control path for SHAMPO feature") Closes: https://lore.kernel.org/r/CAFxp=AY2cVRQrZvB9WNnigbsobuw11NMG-cagHx0_V+ur2ToFw@mail.gmail.com Link: https://lore.kernel.org/r/atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com Suggested-by: Dragos Tatulea Reviewed-by: Dragos Tatulea Reviewed-by: Tariq Toukan Cc: stable@vger.kernel.org Signed-off-by: Jiabin Deng Link: https://patch.msgid.link/20261110035723.26587-1-dengjiabin2023@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit bae3442c750ffe5aaca0cf1e03dc541742376403 Author: Breno Leitao Date: Wed Nov 4 09:04:11 2026 -0800 net/mlx5e: Fix queue stats access to queues without stats commit 9a24799e219b1699bb1c144248c8c500b9504db5 upstream. I am seeing the following mlx5e crash in the Meta fleet: pc : mlx5e_get_queue_stats_rx+0x4c/0xc8 Call trace: mlx5e_get_queue_stats_rx+0x4c/0xc8 (P) netdev_stat_queue_sum+0x78/0x480 netdev_nl_qstats_get_dump_one+0xf0/0x268 netdev_nl_qstats_get_dumpit+0x7c/0x1f8 When dumping device-wide qstats, the core calls the per-queue callbacks for every queue below real_num_{rx,tx}_queues, regardless of whether the netdev is up. Some of those queues have no stats behind them: - RX stats live in priv->channel_stats[], which only has entries for channels that have been opened (stats_nch). real_num_rx_queues can be larger, for example after the channel count is raised while the netdev is down, or after opening the channels failed part way. - TX stats are looked up in priv->txq2sq_stats[], which is NULL for SQs that were never activated and for HTB queues while the channels are closed. In both cases the callback dereferences a NULL pointer. The dump needs no privileges, so any user can trigger it. Return early for RX queues at or above stats_nch and for TX queues without SQ stats. Fixes: 7b66ae536a78 ("net/mlx5e: Add per queue netdev-genl stats") Cc: stable@vger.kernel.org Signed-off-by: Breno Leitao Reviewed-by: Tariq Toukan Link: https://patch.msgid.link/20261104-mlx5e-qstats-null-v1-1-a6a003245cec@debian.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 5e255d86b76f866cbf64a942cb401bc15b6ed63e Author: Davidlohr Bueso Date: Thu Nov 5 08:07:04 2026 -0800 mctp: accept MSG_CMSG_COMPAT in recvmsg commit 350e1d0d3b386fcc0cff2d37aa920fab4800bf72 upstream. 32-bit userspace running on a 64-bit kernel is unable to receive MCTP messages on an AF_MCTP socket, even though sending succeeds. There is nothing for MCTP to do with it beyond not rejecting it, as af_packet, af_key and can/isotp already do, for example. Fixes: 833ef3b91de6 ("mctp: Populate socket implementation") Cc: stable@vger.kernel.org Signed-off-by: Davidlohr Bueso Link: https://patch.msgid.link/20261105160704.2546031-1-dave@stgolabs.net Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 8a66dd77c4344b729f9ea5986d7c6eacc1147586 Author: Kyle Zeng Date: Thu Oct 29 21:22:37 2026 -0700 macsec: reject frames that decapsulate into runt Ethernet frames commit 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22 upstream. When an SCI is unknown and the C bit is clear, macsec_handle_frame() removes the SecTAG and the default ICV without checking how much of the frame remains. A short frame can therefore become an skb shorter than ETH_HLEN. eth_type_trans() cannot pull its Ethernet header, and a second stacked MACsec device can copy stale skb headroom into a packet delivered to a packet socket. The matched-SCI path has a related hole: macsec_validate_skb() accepts a short_length of one, so a frame that passes the existing length check can still become a 13-byte Ethernet frame. Require enough bytes for the MACsec overhead and a complete Ethernet header before decapsulating an unknown-SCI frame. Apply the same bound in macsec_validate_skb(), using the selected SecY's ICV length, to cover the no-SA, synchronous-decrypt and asynchronous-decrypt delivery paths. Leave other unknown-SCI handling unchanged. Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver") Cc: stable@vger.kernel.org Signed-off-by: Kyle Zeng Signed-off-by: Dave Miller Signed-off-by: Greg Kroah-Hartman commit 577aae13bd081849d16adc958c2d63cd84f7e280 Author: Christian Aurich Zanettini Martins Date: Tue Nov 3 12:39:28 2026 -0300 liveupdate: check for duplicate session before growing block set commit cc448e44f6e9fc83f1527f926f52ebfa5a3d1ce9 upstream. luo_session_insert() grows the outgoing block set before checking for a duplicate session name. On -EEXIST the new block stays in the set. If the session count is an exact multiple of the per-block capacity (51 with 4K pages), that block stays empty. It is serialized with count 0, which kho_block_set_restore() rejects in the next kernel: luo: Block contains invalid entry count: 0 Kernel panic - not syncing: The incoming tree failed to initialize properly [-EINVAL], disabling live update Check for the duplicate before growing the block set, as luo_preserve_file() does with the token. Fixes: 2a441a14c2c0 ("liveupdate: Remove limit on the number of sessions") Cc: stable@vger.kernel.org Signed-off-by: Christian Aurich Zanettini Martins Reviewed-by: Pratyush Yadav (Google) Link: https://patch.msgid.link/20261103153928.716753-1-christian.aurichzm@gmail.com Reviewed-by: Pasha Tatashin Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Greg Kroah-Hartman commit f007c10d88e145804e6442ec3b550415b59f28c4 Author: Jean-Paul Sergent Date: Mon Nov 9 00:24:10 2026 -0800 net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp commit 74a7db839308dd7d1c3f72dd1e3299784df3affb upstream. Commit 3fcece12bc1b6 ("net: store port/representator id in metadata_dst") dropped the options_len equality check when converting skb_metadata_dst_cmp() to a type switch, so the memcmp length is taken from skb a alone. When skb b carries fewer options than a, the comparison reads past b's allocation. Hit in practice with Cilium geneve GRO aggregation, comparing an skb carrying 12 bytes of tunnel options against one carrying none: memcmp: detected buffer overflow: 108 byte read of buffer size 96 WARNING: CPU: 0 PID: 15 at lib/string_helpers.c:1036 __fortify_report __fortify_panic+0x9/0x10 skb_metadata_dst_cmp+0x11b/0x120 dev_gro_receive+0x303/0x620 gro_cell_poll+0x67/0xa0 Restore the check: unequal options_len means different metadata and no aggregation; the memcmp only runs when both sides carry the same options length. Fixes: 3fcece12bc1b6 ("net: store port/representator id in metadata_dst") Cc: stable@vger.kernel.org Cc: Ilya Maximets Cc: Sasha Levin Cc: Jakub Kicinski Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: Simon Horman Cc: Sridhar Samudrala Cc: Kees Cook Signed-off-by: Jean-Paul Sergent Link: https://patch.msgid.link/20261109082410.206140-1-jpsergent@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 95030c86ae04ce3e8691846d0287b643f6cfe00d Author: Florian Bezdeka Date: Fri Oct 30 13:31:41 2026 +0100 entry: Fix return type of syscall_trace_enter() commit 75b1663222d7aa0b3c33cc3522a347757e6d1d26 upstream. All return values of syscall_trace_enter() were migrated to bool in commit 71ff30013f19 ("entry: Make return type of syscall_trace_enter() bool"), but the function declaration has not been updated. Fix that up now. Fixes: 71ff30013f19 ("entry: Make return type of syscall_trace_enter() bool") Signed-off-by: Florian Bezdeka Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261030-wip-flo-fixup-entry-code-v1-1-7724c29e800b@siemens.com Signed-off-by: Greg Kroah-Hartman commit 6ce44530a404066a1f677f51d4092f1188c98608 Author: Florian Bezdeka Date: Fri Oct 30 13:31:42 2026 +0100 entry: Complete syscall_enter_from_user_mode_work() to bool migration commit efe191f1605a149b06eb0fe1ff975e7d3137c9bb upstream. The return type of syscall_enter_from_user_mode_work() was changed to bool in the commit referenced below. While doing so, one caller in syscall_enter_from_user_mode_randomize_stack() was overlooked and stayed at the previous type: long. Update this caller accordingly. Fixes: 05c033db7e9a ("entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution") Signed-off-by: Florian Bezdeka Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261030-wip-flo-fixup-entry-code-v1-2-7724c29e800b@siemens.com Signed-off-by: Greg Kroah-Hartman commit 198db2210918236ecbaeeac1a8d42336a4ee77ec Author: Hungyu Lin Date: Thu Nov 5 05:14:06 2026 +0000 coda: honor the append state of each write commit 87ea037a9166a5842356ce68e3585fc6e756603b upstream. coda_open() adds O_APPEND to the container file's f_flags after it has been opened, without updating its cached f_iocb_flags. An O_APPEND write can therefore overwrite existing data instead of appending. For example, writing "Z" to a file containing "abc" produces "Zbc" rather than "abcZ". Pass RWF_APPEND or RWF_NOAPPEND to vfs_iter_write() according to the incoming IOCB_APPEND state. This also honors changes made with F_SETFL and per-write append overrides instead of relying on the container's open-time flags. Fixes: 164f4064ca81 ("keep iocb_flags() result cached in struct file") Cc: stable@vger.kernel.org # 6.9+ Signed-off-by: Hungyu Lin Link: https://patch.msgid.link/20261105051406.52442-1-dennylin0707@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 82356969bd8125c6519737dbe8afb4c5b0cecb75 Author: Cheng Yongkang Date: Sat Oct 31 23:25:39 2026 -0700 btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT commit 9a58e56e70f610e29b53821e9c706600e529cca3 upstream. btrfs_ioctl_subvol_sync() assumes that a cached root with zero references has BTRFS_ROOT_SUBVOL_DEAD set, and asserts that before waiting for the cleaner. Two states break the assumption: - A corrupt ROOT_ITEM with zero references and a matching orphan item, on a writable filesystem. - A failed subvolume deletion. btrfs_delete_subvolume() zeroes the root references, aborts the transaction, which forces the filesystem read-only, and then clears DEAD again. No on-disk metadata is corrupted in this case. With CONFIG_BTRFS_ASSERT=y, both reach a BUG(). Change the ASSERT() into a proper rejection to avoid triggering a BUG(). Fixes: 6c83d153ed86 ("btrfs: add new ioctl to wait for cleaned subvolumes") CC: stable@vger.kernel.org Suggested-by: Qu Wenruo Link: https://lore.kernel.org/linux-btrfs/dd97efe9-91ec-495b-b698-acff1447421c@gmx.com/ Signed-off-by: Cheng Yongkang [ Rework the commit message, drop the ad-hoc RW check. ] Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman commit d72253b60d43901c873f0ada101ff4474774eecc Author: Mani Tofigh Date: Tue Nov 3 15:03:21 2026 -0500 btrfs: fix bio counter and bioc leak when async checksumming fails commit d27d0039bc1334be8a72c769e14c0b0c3efc317d upstream. A single failed checksum allocation can make a later device replace hang forever. btrfs_submit_chunk() takes a dev-replace bio counter reference and a bioc before it hands a write to the checksum worker. If the checksum fails there (e.g., its allocation fails), run_one_async_done() ends the bio but drops neither. The counter then never gets back to zero and the next replace waits for it: [ 8.369] BTRFS info (device ram0): dev_replace from /dev/ram0 (devid 1) to /dev/ram1 finished [41.534] INFO: task btrfscsum:80 blocked for more than 20 seconds. [41.534] btrfs_rm_dev_replace_blocked+0x135/0x180 [41.534] btrfs_dev_replace_finishing+0xefe/0x13b0 The worker is only used when CONFIG_BTRFS_EXPERIMENTAL is off and the checksum isn't a fast one, e.g., sha256. We hit it on a sha256 filesystem. We put the bioc and drop the counter in that error branch. We also put the bioc on the synchronous error path and on the btrfs_split_bio() error path, which both only drop the counter. With the fix, the replace doesn't hang anymore. This bug was identified and confirmed with the help of fault-injection testing on a deterministic hypervisor currently under development. Our C reproducer however hits it within about 35s. Fixes: f8a53bb58ec7 ("btrfs: handle checksum generation in the storage layer") Fixes: c7c97ceff98c ("btrfs: handle bio_split() errors") CC: stable@vger.kernel.org # 6.6+ Reviewed-by: Qu Wenruo Signed-off-by: Mani Tofigh Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman commit 04c1c69a1f9e7b1d9b95f848f6df0fd18d0917a6 Author: Eduardo Mucelli Rezende Oliveira Date: Tue Nov 10 20:08:46 2026 +0100 bootconfig: Trim unquoted values at end of file commit 381b391bfaa3f10d52da4740529804b0b6b8160d upstream. __xbc_parse_value() trims an unquoted value when it encounters a delimiter, but leaves trailing whitespace intact when it reaches the end of the input. Thus "key = value " has a different value depending on whether the file ends with a newline. The extra whitespace also reaches the rendered kernel command line. Trim unquoted values after the scan finishes, including at end of input. Skip trimming after a closing quote so intentional whitespace in quoted values remains unchanged. Add checks for scalars, arrays and quoted values without a final newline. Link: https://lore.kernel.org/all/31f248f330e716b925add3a0ba76f62826527312.1794337724.git.edumucelli@gmail.com/ Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support") Cc: stable@vger.kernel.org Signed-off-by: Eduardo Mucelli Rezende Oliveira Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 2b1ce4ca53ecc400f8bc06e66d59a95e866b397f Author: Breno Leitao Date: Fri Oct 30 05:18:49 2026 -0700 ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() commit cf12faa1e76d43f97b1486aaec959b16baca498a upstream. ghes_log_hwerr() is meant to count recoverable GHES errors in hwerror_data[], but it skips them and counts informational records instead. As a result, recoverable CPU, memory, CXL and vendor-specific errors reported through GHES never show up in a vmcore. ghes_do_proc() passes ghes_log_hwerr() the record severity after ghes_severity() has converted it to a GHES_SEV_* value. ghes_log_hwerr() compares it against CPER_SEV_RECOVERABLE, which is 0 in the CPER enum and matches GHES_SEV_NO, so only informational records pass and GHES_SEV_RECOVERABLE ones return early. Compare against GHES_SEV_RECOVERABLE instead. Recoverable PCIe errors that ghes_handle_aer() hands to AER are also counted by pci_dev_aer_stats_incr(), so with the check fixed they are counted twice under HWERR_RECOV_PCI. That is not addressed here. Fixes: 3fa805c37dd4 ("vmcoreinfo: track and log recoverable hardware errors") Cc: stable@vger.kernel.org Signed-off-by: Breno Leitao Reviewed-by: Shuai Xue Link: https://patch.msgid.link/20261030-ghes-hwerr-sev-v1-1-145ceb996c77@debian.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit ff1b87e0b25b5f21fef73df4bddeb9f86a0c8e9d Author: Vlastimil Babka (SUSE) Date: Tue Nov 3 17:16:51 2026 +0100 mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() commit 2122887b04f3f2d76daa80055c2c273926032fa0 upstream. Whenever the flags of a pageblock are read or written, a kernel with CONFIG_DEBUG_VM makes sure that the pfn lies within the zone of the page. Unlike bad_range(), that check reads zone->zone_start_pfn and zone->spanned_pages without zone->span_seqlock. Memory hotplug changes the two fields one after the other. If the lower end of a zone moves, the zone seems to end before its last pages in between. A page of that part which is freed at that moment, on another CPU, ends in page dumped because: VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn)) kernel BUG at mm/page_alloc.c:372! free_unref_folios+0x55e/0xed0 folios_put_refs+0x2b5/0x530 An attempt has been made [1] to fix this with the span seqlock check. But that can trigger all sorts of problems in restricted contexts, as noted by sashiko [2]. Since this is just a sanity debug check and anything with BUG_ON is frowned upon anyway, just remove it altogether. Reported-by: Josef Bacik Closes: https://lore.kernel.org/all/20261027-pgalloc-ai-hotfixes-v1-9-9c7d1aca801e@kernel.org/ [1] Link: https://lore.kernel.org/all/sashiko-outbox-188081@kernel.org/ [2] Fixes: 86051ca5eaf5 ("mm: fix usemap initialization") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-5-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 04f8feced6059c267c35cce715921beb4cc07021 Author: Josef Bacik Date: Tue Nov 3 17:16:47 2026 +0100 mm/page_alloc: clear ->private of deferred free pages commit aae6b83fe47ed8bff9195efbe1d191ec52e5436e upstream. free_pages_nolock() and free_frozen_pages_nolock() put the page on zone->trylock_free_pages if they get neither the pcp lock nor zone->lock. add_page_to_zone_llist() keeps the order of the page in page->private. The next free_one_page() which does get zone->lock passes these pages to split_large_buddy() with ->private still set. __free_one_page() writes ->private of the head of the resulting free page only. If the deferred page is merged with its lower buddy, it becomes a tail of that free page and keeps the order in ->private. All other free pages which are not the head of a buddy have a ->private of zero, and since commit 819bfbd47e49 ("mm/page_alloc: remove set_page_private() in prep_compound_tail()") the allocator relies on it. When the stale page is allocated again as a tail of a larger page: - prep_compound_tail() hits VM_WARN_ON_ONCE(tail->private); - with the page checks enabled, __free_pages_prepare() reports "BUG: Bad page state", "nonzero private", and leaks the whole page; - without them the value is seen by whoever uses that page next, e.g. as folio->private of a folio which is split off a large folio. Only pages of an order above zero are affected. Those can be freed through _nolock() by the stack depot (order 2) and by SLUB (a new slab which cannot be added to the partial list by kmalloc_nolock()). Clear ->private when the page is taken off the list. Fixes: 8c57b687e833 ("mm, bpf: Introduce free_pages_nolock()") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Reviewed-by: Johannes Weiner Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-1-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit bb9ead495018bd31ae8d42b6a284e5f4dedcccba Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:34 2026 -0400 mm/page_alloc: snapshot the preferred zone against shrink rebuilds commit b3e3a760eb68449e2794ef68ab212173d9c3e8c7 upstream. get_page_from_freelist() and alloc_pages_bulk_noprof() reread ac->preferred_zoneref->zone at every use. Offlining a zone's last block rebuilds the zonelists in place, and the shrunk list's NULL terminator can land on the preferred slot mid-walk: CPU 0 CPU 1 get_page_from_freelist(GFP_KERNEL | __GFP_THISNODE) zone = NORMAL (slot 1) offline_pages() build_all_zonelists() [MOVABLE, NORMAL, NULL] -> [NORMAL, NULL] rmqueue(zonelist_zone(slot 1), zone) zone_statistics(NULL, zone) BUG: kernel NULL pointer dereference, address: 0000000000000060 RIP: 0010:get_page_from_freelist+0x6a5/0x15f0 Call Trace: __alloc_frozen_pages_noprof+0x125/0x330 Read the slot once. Zones are never freed, so a stale zone is safe, and a NULL slot fails the same way as walking off the end. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Reviewed-by: Vlastimil Babka (SUSE) Link: https://patch.msgid.link/20261101021340.2251928-7-gourry@gourry.net Acked-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 948f5a4e23c30283bccb39d8ed2ac4c40c8b9d14 Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:32 2026 -0400 mm/page_alloc: detect zonelist rebuilds from memory hot-add commit e5db040c3d09c5d85dda70f736d4d1a6714b741e upstream. The zonelist_update_seq retry was limited to CONFIG_MEMORY_HOTREMOVE, presumably because only hot-remove takes zones out of a zonelist. However, build_zonerefs_node() rewrites the zonelists in place, so onlining the first block of a zone shifts the entries that follow it in every zonelist containing that zone. This can cause a spurious allocation failure for a __GFP_THISNODE caller. For a node with only ZONE_NORMAL, onlining its first ZONE_MOVABLE block rewrites the node's ZONELIST_NOFALLBACK list as: [NORMAL, NULL] -> [MOVABLE, NULL] -> [MOVABLE, NORMAL, NULL] A concurrent GFP_KERNEL | __GFP_THISNODE allocation can observe the intermediate list, skip ZONE_MOVABLE, and find no eligible zone. With CONFIG_MEMORY_HOTREMOVE=n, check_retry_zonelist() returns 0 and the allocation fails even though the node has free ZONE_NORMAL memory. Gate the sequence checks on CONFIG_MEMORY_HOTPLUG, which covers every configuration that rebuilds zonelists after boot. Fixes: 3d36424b3b58 ("mm/page_alloc: fix race condition between build_all_zonelists and page allocation") Cc: stable@vger.kernel.org Reviewed-by: Vlastimil Babka (SUSE) Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261101021340.2251928-5-gourry@gourry.net Acked-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit dc7501fe9cc9053b9ed24d9f299e6a6af297e4ca Author: Josef Bacik Date: Sat Oct 31 22:13:30 2026 -0400 mm/page_alloc: keep the pagesets of an empty zone commit 7bfcf81b1cb469bc016fa8e07939c0924b9ff8db upstream. When the last memory of a zone goes offline, zone_pcp_reset() frees zone->per_cpu_pageset and zone->per_cpu_zonestats. Nothing waits for those who found the zone populated and still use the two pointers. They take neither the memory hotplug lock nor any other lock which offline_pages() holds, and some of them can sleep: CPU0 vmstat_update() CPU1 offline_pages() refresh_cpu_vm_stats() for_each_populated_zone(zone) pcp = zone->per_cpu_pageset cond_resched() adjust_present_page_count() zone_pcp_reset(zone) free_percpu(zone->per_cpu_pageset) decay_pcp_high(zone, pcp) __this_cpu_write(pcp->expire, 0) The same goes for drain_all_pages(NULL), which takes pcp->lock, for zone_pcp_update(), show_free_areas() and the readers and writers of the zonestats. If the per-cpu memory has got a new owner in the meantime, it is corrupted. The pagesets are only freed because setup_zone_pageset() would otherwise leak them when the zone gets memory again. Keep them instead and let setup_zone_pageset() and zone_pcp_init() use them again, like it is done with pgdat->per_cpu_nodestats. Their lists are empty, and their limits have been calculated for a zone without memory by the init_per_zone_wmark_min() of offline_pages(), which is what setup_zone_pageset() would come up with as well. Fixes: 340175b7d14d ("mm/hotplug: free zone->pageset when a zone becomes empty") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Johannes Weiner Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261101021340.2251928-3-gourry@gourry.net Reviewed-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 3e1e163a94099b63f917ee6afb72cc68375179b5 Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:29 2026 -0400 mm/page_alloc: reset can_retry_reserves when the slowpath restarts commit b35ce030893929b3670de82bdac2713cb7b20d90 upstream. Commit 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath() flow") retries an allocation once with reserve_flags when the caller becomes eligible for reserves, guarded by can_retry_reserves. A restart after a cpuset update or a zonelist rebuild retries with can_retry_reserves already set to false, so a caller that cannot reclaim (GFP_NOWAIT | __GFP_MEMALLOC), fails without trying reserves. Reset can_retry_reserves on restart. Only a cpuset or zonelist change restarts the slowpath, so the retry still runs at most once per change. With a kprobe helping to make the race deterministic, an allocation can be made to return NULL. With this patch the allocation will succeed. Fixes: 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath() flow") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261101021340.2251928-2-gourry@gourry.net Acked-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 535d63d7595bf2d85f7730026392881bd9b2014c Author: Gregory Price (Meta) Date: Tue Oct 27 00:22:02 2026 -0400 mm/page_alloc: don't undo another isolation in alloc_contig_range commit 7d9c29ed8feec8bfbe5e5f673ba2b5926da11375 upstream. An alloc_contig_range() that overlaps a block going offline can leave the offline spinning until it gets a signal, holding the device hotplug lock. When isolation fails, alloc_contig_frozen_range() undoes it over the whole range, clearing the offline's MIGRATE_ISOLATE too: CPU 1 (offline_pages) CPU 2 (alloc_contig_range) start_isolate_page_range() blocks are MIGRATE_ISOLATE start_isolate_page_range() -EBUSY on CPU 1's blocks undo_isolate_page_range() blocks are MIGRATE_MOVABLE test_pages_isolated() never succeeds again start_isolate_page_range() fails only on a block someone else isolated, after undoing its own, so this undo only ever clears another caller's. Return directly, as before alloc_contig_range() went pageblock granular. With offline_pages() parked after isolating a DIMM block and a 1G hugetlb allocation made over it, the offline on base still loops 30s later in 4 of 4 runs: offline_pages+0x5b2/0x1570 memory_subsys_offline+0x17e/0x470 device_offline+0x250/0x340 state_store+0x88/0x110 With this patch the allocation still fails, and the offline completes in 3 of 3 runs. Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261027042204.3741307-5-gourry@gourry.net Reviewed-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 0974390faff088fa2111beaaad1bdc0e2379cf93 Author: Josef Bacik Date: Tue Nov 3 17:16:49 2026 +0100 mm: page_isolation: do not take slab pages for free commit 213268869301f747d19ca00a391757a6cf2d4fa8 upstream. page_is_unmovable() regards a page with a reference count of zero as free or about to be freed. Since slab allocates frozen pages, they will be wrongly considered to be freed if order 0 (higher-order compound pages are caught earlier). If such slabs are the only unmovable pages of a memory block, memory offlining now isolates the block, this can lead to offline_pages() looping without progress. Thus detect the slab pages as removable to return -EBUSY, as would happen before commit 9aec2fb0fd5e ("slab: allocate frozen pages"). Fixes: 9aec2fb0fd5e ("slab: allocate frozen pages") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Reviewed-by: Johannes Weiner Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-3-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 6a02770091f61e100acace079dfb6343d0cb2518 Author: Josef Bacik Date: Tue Nov 3 17:16:50 2026 +0100 mm/memory_hotplug: resize zones under their seqlock commit 58e81bb7de5aac8ec5e4aa21d401e7dafbd4058b upstream. With CONFIG_DEBUG_VM the page allocator checks that a page which is freed, split or allocated lies within its zone. The check reads zone->zone_start_pfn and zone->spanned_pages under zone->span_seqlock, as memory hotplug can change the two at any time. Commit 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") removed the write side, since all resizing is serialized by the hotplug lock. That leaves the reader without protection. When memory below the start of a zone goes online, the start is lowered first and the size is raised afterwards. When the lowest memory of a zone goes offline, the size is reduced first. In between, the zone seems to end before its last pages. If one of them goes through the allocator at that moment, it is reported as being outside of the zone triggers VM_BUG_ON_PAGE(). Write the two fields in a write section of the seqlock. Interrupts are disabled as pages are freed from interrupts, too, and the reader would wait for the writer which it has interrupted. Fixes: 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-4-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 5c9c3f7591547ecc8414fbf966183864bddd7b64 Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:35 2026 -0400 mm/mmzone: read each zoneref slot once when filtering by nodemask commit e55119ab611a0e47595db7e1d2ac1e69f7a73ff0 upstream. __next_zones_zonelist() tests a slot's zone for NULL, then reads the slot again to look up the zone's node. Offlining a zone's last block rebuilds the zonelists in place, so the second read can return the terminator: CPU 0 CPU 1 __next_zones_zonelist(nodemask) zonelist_zone(slot 1) = NORMAL offline_pages() build_all_zonelists() [MOVABLE, NORMAL, NULL] -> [NORMAL, NULL] zref_in_nodemask(slot 1) zone_to_nid(NULL) Current GCC and clang merge the two reads, but nothing requires it. With mm/mmzone.o built with -fno-inline -fno-ipa-sra, holding a nodemask allocation between the reads while the node's last movable block goes offline oopses every time: BUG: kernel NULL pointer dereference, address: 0000000000000060 RIP: 0010:zone_to_nid+0x0/0x10 Call Trace: zref_in_nodemask+0x9/0x20 __next_zones_zonelist+0x23/0x70 prepare_alloc_pages.constprop.0+0x16c/0x190 __alloc_frozen_pages_noprof+0xaf/0x330 Read the slot once and test that zone. A NULL zone still ends the walk. To achieve that, rename zref_in_nodemask() to zone_in_nodemask() and pass a zone instead of zoneref pointer. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Reviewed-by: Vlastimil Babka (SUSE) Link: https://patch.msgid.link/20261101021340.2251928-8-gourry@gourry.net Reviewed-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit dceaac38481028e5649189e50a87321b9aefb94b Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:39 2026 -0400 mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() commit 4cc1bcdf2e4ebcd319005ce2ea132489f6155139 upstream. For a bind or preferred-many policy, mempolicy_slab_node() tests the first matching slot's zone for NULL, then reads the slot again to look up the zone's node. Offlining a zone's last block rebuilds the zonelists in place, so the second read can return the terminator: CPU 0 CPU 1 mempolicy_slab_node() zonelist_zone(slot 4) = node 2 NORMAL offline_pages() build_all_zonelists() slot 4 = NULL zonelist_node_idx(slot 4) zone_to_nid(NULL) Current GCC merges the two reads, but nothing requires it. With mm/mempolicy.o built with -fno-inline -fno-ipa-sra, holding a bound task's slab_strict_numa allocation between the reads while a movable block earlier in the zonelist goes offline oopses every time: BUG: kernel NULL pointer dereference, address: 0000000000000060 RIP: 0010:zone_to_nid+0x0/0x10 Call Trace: kmem_cache_alloc_noprof+0x294/0x610 do_getname+0x34/0x230 mempolicy_slab_node() and zonelist_node_idx() are tail calls here, so neither appears in the trace. Read the slot once and use that zone. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Reviewed-by: Vlastimil Babka (SUSE) Link: https://patch.msgid.link/20261101021340.2251928-12-gourry@gourry.net Reviewed-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 55d7a6a995a2e23b0a8325025bcd13812b7d2729 Author: Josef Bacik Date: Tue Nov 3 17:16:48 2026 +0100 mm: page_frag: refill the cache for large fragments commit c028ecdf15131a2ab70d78a76657b81c00fa240d upstream. A fragment which is larger than PAGE_SIZE can only be served from the 32K page of a page_frag_cache. If memory is low and the cache had to fall back to a single page, __page_frag_alloc_align() returns NULL and keeps that page. Since the offset counts up, this check comes first and is made whenever the fragment does not fit behind nc->offset, no matter how big the page of the cache is. So the cache is never refilled on behalf of a large fragment: with fragsz = 10000 the first three allocations succeed, the fourth one and all the following ones fail although memory is plentiful. nc->offset does not move either, so this lasts until smaller fragments have used up the rest of the page, which never happens if the cache has no other user. The nfp driver allocates its receive buffers with napi_alloc_frag() and netdev_alloc_frag(). They are larger than a page with a jumbo MTU. Only give up if the fragment does not fit into the page at all, which is what the comment describes. The fourth allocation in the scenario above with a 32k page will thus now proceed to refill the cache. Fixes: 8218f62c9c9b ("mm: page_frag: use initial zero offset for page_frag_alloc_align()") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Johannes Weiner [vbabka@kernel.org: make the comment more obvious] Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-2-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 64f45cf685e7f9ad311c1e39e0ae9574b1334098 Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:38 2026 -0400 mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt commit da0d7a895e9021dc2cffa90fb6fafd8b9379e544 upstream. Onlining the first block of a zone rebuilds every zonelist in place, shifting the slots after the new zone. alloc_contig_frozen_pages_noprof() approves a slot by the caller's gfp and nodemask, then loads the zone from it: CPU 0 CPU 1 alloc_contig_frozen_pages_noprof(GFP_HIGHUSER | __GFP_THISNODE) slot 0 (NORMAL1) approved online_pages() build_all_zonelists() [NORMAL1] -> [MOVABLE1, NORMAL1] zone = zonelist_zone(slot 0) /* MOVABLE1 */ alloc_contig_frozen_range(MOVABLE1 pfns) A gigantic hugetlb page can then land in ZONE_MOVABLE, and a nodemask caller can get a range from another node. Gigantic pages are kept out of ZONE_MOVABLE since commit 79b63f12abcb ("mm, hugetlb: do not allocate non-migrateable gigantic pages from movable zones"). Check zonelist_update_seq before using each zone, and restart the walk if it changed, as the hugetlb pool walk does. Check again before escalating to the pass that may migrate hugetlb pages, so a pass a rebuild cut short is redone rather than escalated. With kprobes holding the walk across the online, the base kernel put the 1G page in ZONE_MOVABLE in 3 of 3 runs, and this change put it in ZONE_NORMAL in 3 of 3. Direct GFP_KERNEL calls with nodemask {1} and {2} got a ZONE_MOVABLE range and a node 1 range on base, 3 of 3 each, and neither with this change. Fixes: 5e27a2df03b8 ("mm/page_alloc: add alloc_contig_pages()") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Reviewed-by: Vlastimil Babka (SUSE) Link: https://patch.msgid.link/20261101021340.2251928-11-gourry@gourry.net Acked-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 9b0dbf9484265e1060d15ab98674c17124321a8a Author: Josef Bacik Date: Sat Oct 31 22:13:31 2026 -0400 mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone commit 6c48b3ab4ee435c41c3395d31e8ec3dbccc3478c upstream. should_reclaim_retry() walks a zonelist and passes the zoneref pointer to the reclaim_retry_zone tracepoint, which loads the zone from the entry again to find the node. Memory hotplug rebuilds the zonelists in place while allocations are under way. When a zone in front of the zoneref entry has become empty, the entries move up, and this one can be the end marker by the time the tracepoint looks at it. zonelist_node_idx() then dereferences a NULL zone. Short of that, the event can name another zone than the one its numbers belong to. Pass the zone pointer instead of the zoneref pointer. Fixes: d379f01de095 ("oom, trace: add oom detection tracepoints") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Gregory Price (Meta) Reviewed-by: Gregory Price (Meta) Tested-by: Gregory Price (Meta) Acked-by: Zi Yan Link: https://patch.msgid.link/20261101021340.2251928-4-gourry@gourry.net Reviewed-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit e3f7bb9c121eb5601639dc15790f152d5a628f74 Author: Gregory Price (Meta) Date: Sat Oct 31 22:13:33 2026 -0400 mm/mmzone: read the zoneref slot once in zonelist_zone() commit 9c52ebe9c89d41c56fcb5d94efe9e539414175a9 upstream. Memory hotplug rebuilds zonelists in place while allocations walk them, so a zoneref slot can change between two loads of it. zonelist_zone() loads the slot with a plain access. The compiler may load it again later instead of keeping the zone it already read, so a caller can check one zone and then use another, or the NULL terminator. Use READ_ONCE(). Callers that take a zone from a slot and keep using it, such as get_page_from_freelist() with ac->preferred_zoneref, need that single load. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261101021340.2251928-6-gourry@gourry.net Acked-by: Zi Yan Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Greg Kroah-Hartman commit 8e73d0c32376b3d3864624700a153ec02ccb76e4 Author: Christian Brauner Date: Sun Nov 1 11:57:20 2026 +0100 libfs: make i_rwsem the lock of the offset tree commit e7d73cef9726bea49de97ae1fd76405df4050a75 upstream. The offset tree of a directory is only changed with the directory's i_rwsem held exclusive and offset_readdir() walks it with i_rwsem held shared. But the maple tree doesn't know that. It is set up with its internal spinlock, which every mtree_*() helper takes, and readdir takes rcu_read_lock() around each lookup. The next patch makes readdir keep one ma_state across dir_emit(), which can sleep. That is safe because no writer can run while readdir holds i_rwsem. But the maple tree only allows keeping a ma_state across a sleep if it is protected by the tree's lock. A reader that relies on rcu_read_lock() has to mas_pause() before it drops it, and that means a walk from the root for every entry again. So tell the tree what protects it. Initialize it with MT_FLAGS_LOCK_EXTERN and the directory's i_rwsem as its lock and switch the writers from the mtree_*() helpers to the mas_*() api. They all run with i_rwsem held exclusive already. With lockdep enabled the maple tree now also checks that every writer holds i_rwsem exclusive. Nothing can reach the offset tree anymore when the directory inode is destroyed. So clear the external lock with mt_on_stack() and destroy the tree with __mt_destroy() instead of taking i_rwsem in ->destroy_inode(). Cc: stable@vger.kernel.org # v6.14+ Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-1-c621125b56d1@kernel.org Reviewed-by: Chuck Lever Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 7a97b007838868c033063104dee100f747fdebc8 Author: Avi Weiss Date: Sat Oct 31 11:59:23 2026 +0200 splice, net: avoid MSG_MORE when the bvec array fills commit 8eaa35c6c29ae669949f4b5b0814c3d34c8ed658 upstream. splice_to_socket() leaves tail at the last included pipe buffer when its 16-entry bvec array fills. If the requested length exceeds the available pipe data, pipe_occupancy() counts that buffer again and sets MSG_MORE even though the pipe is empty. Small TCP transfers can then be delayed until the cork timeout expires. Advance tail before checking the array limit so the occupancy test counts only pipe buffers that have not been included in the send. Fixes: ca2d49f77ce4 ("splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page") Cc: stable@vger.kernel.org Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261031095922.3577591-2-thnkslprpt@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 1ea5b26e88172647ac98ec852e05b741f2e0a8b1 Author: Christian Brauner Date: Fri Nov 6 14:14:35 2026 +0100 fs: fix the SEEK_CUR f_lock condition commit 1448959fe3d013ffdb8302d17e4a8fdad2d2da95 upstream. Commit da06e3c51794 ("fs: don't needlessly acquire f_lock") wanted to skip f_lock for SEEK_CUR on files that already serialize f_pos through f_pos_lock, i.e. FMODE_ATOMIC_POS files and directories, and keep it for everything else. The condition it added does the opposite: file_seek_cur_needs_f_lock() returns false exactly for the files that never take f_pos_lock and true for the ones that do. So since v6.15 a SEEK_CUR on a shared block device or on a character device that uses fixed_size_llseek() updates f_pos without any lock and two concurrent calls can lose an update, while regular files and directories pay for a spinlock they don't need. Invert the condition. Fixes: da06e3c51794 ("fs: don't needlessly acquire f_lock") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261106-work-file-seek_f_lock-v1-1-5b9a6c2928d4@kernel.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 12710a697096e51c66b988bb47b3c5aef2d7349c Author: Christian Brauner Date: Fri Oct 30 17:15:21 2026 +0100 aio: don't let exit_aio() return before complete() is done commit ac4b449b39e605123c12ea10042cafc9b6f39603 upstream. exit_aio() kills all contexts in one go and waits for them with a single on-stack struct ctx_rq_wait. The count starts at table->nr, each killed context drops one count in free_ioctx_reqs() and exit_aio() subtracts the empty slots afterwards. Whoever drops the last count either calls complete() or, if it is exit_aio(), skips the wait. With a full table skipped is zero and atomic_sub_and_test(0, ...) only tells us whether the count already hit zero. free_ioctx_reqs() runs from the percpu_ref RCU callback, so if exit_aio() is off the CPU long enough the last callback can have done its atomic_dec_and_test() but not yet called complete(): free_ioctx_reqs() exit_aio() atomic_dec_and_test() // 1 -> 0 atomic_sub_and_test(0) // true kfree(table) return complete(&wait.comp) complete() then locks and writes a completion on a stack frame that is gone. So hold an extra count for exit_aio() itself. Then the last count is always dropped by exit_aio() after it waited, or by a callback while exit_aio() waits for it. An unprivileged user gets there with four io_setup() calls and an exit without io_destroy(). Reported-by: Kyle Zeng Fixes: dc48e56d7616 ("aio: fix serial draining in exit_aio()") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261030-work-aio-exit_aio-v1-1-83942022a4c4@kernel.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 2f7d8187f8f08c37a18397275b32422faa5ded82 Author: Mani Tofigh Date: Tue Nov 3 13:19:01 2026 -0500 eventpoll: wake the next waiter when a woken waiter is killed commit 9f4413e522faed76f4cf610098b2369eb3ba1f1c upstream. Processes sharing an epoll instance can sleep forever while an event is ready. An event wakes only one waiter, which then wakes the next one in ep_done_scan() if events are still ready. Since commit c257a340ede0 ("fs, epoll: short circuit fetching events if thread has been killed"), ep_send_events() returns before the scan when the waiter has a fatal signal. If the woken waiter is killed before it runs, nobody wakes the next one: Task A Task B Task C epoll_wait(ep, -1) epoll_wait(ep, -1) write(efd) /* wakes A only */ kill(A, SIGKILL) ep_send_events() return -EINTR /* skips ep_done_scan() */ /* still asleep */ B then sleeps until another file on the instance becomes ready, if ever. This can hit eg a pre-fork server whose worker gets OOM killed. Commit 7fab29e35630 ("fs/epoll: restore waking from ep_done_scan()") fixed the same kind of hang when the wakeup in ep_done_scan() was removed. Keep the early return so that a dying task still doesn't take events nobody will see, but wake the next waiter there if events are ready, as ep_done_scan() would have. With the fix, B gets the event. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development. The C reproducer below however hits it within about 2s. Fixes: c257a340ede0 ("fs, epoll: short circuit fetching events if thread has been killed") Cc: stable@vger.kernel.org Signed-off-by: Mani Tofigh Link: https://patch.msgid.link/20261103-epoll-killed-waiter-v1-1-36e08c16b8a2@columbia.edu Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 22d32eff150b45dbf46913967209f45fd64378ea Author: Chen Linxuan Date: Tue Oct 27 16:22:15 2026 +0800 pidfd: restrict task access ioctls to the caller's pid namespace commit ee8323fdc827c580425644db605a4be776cace57 upstream. pidfds can cross pid namespace boundaries: a task may obtain one for a process outside of its own pid namespace hierarchy through SO_PASSPIDFD or SO_PEERPIDFD, via SCM_RIGHTS, or through file descriptor inheritance. The namespace ioctls gate access with a ptrace check against the target's credentials only. That check does not account for the pid namespace relationship between the caller and the target, so a task inside a pid namespace can use a pidfd obtained across that boundary to acquire namespace file descriptors of a task outside of its hierarchy. procfs exposes the equivalent information only for tasks visible in the reader's pid namespace, and PIDFD_GET_INFO already answers with -EREMOTE for targets outside the caller's hierarchy. Extend that policy to the namespace ioctls: fail with -EREMOTE unless the target is visible in the caller's active pid namespace. Callers in ancestor pid namespaces are unaffected. Unlike PIDFD_GET_INFO, the visibility check is performed after the task lookup here, so reaped targets outside of the caller's pid namespace hierarchy answer -ESRCH instead of -EREMOTE. Link: https://lore.kernel.org/all/CAG48ez1T5-tUHVK_iHsgUtWa-inVdrZxA3E-ZCW0iENJvasKfg@mail.gmail.com Link: https://lore.kernel.org/all/20260925-gewischt-auftrag-tierzucht-c153cb3f9f74@brauner Suggested-by: Jann Horn Suggested-by: Christian Brauner Fixes: 5b08bd408534 ("pidfs: allow retrieval of namespace file descriptors") Cc: stable@vger.kernel.org Signed-off-by: Chen Linxuan Link: https://patch.msgid.link/20261027-pidfd-task-access-v1-1-d46cf0fa4ca1@black-desk.cn Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit a00454f04c77eed67b53a446fb8490d8fc3f2ae1 Author: Chris Mason Date: Sun Nov 1 13:34:40 2026 +0100 backing-file: pass RWF_NOAPPEND to synchronous writes commit afa735786a89bde4959db52f20e3579de54ec740 upstream. pwritev2() with RWF_NOAPPEND ignores the offset and appends the data on an overlayfs or FUSE passthrough file that was opened with O_APPEND, and the call still returns success. The flag must make the write go to the given offset even though the file is in append mode. Any user who can write to the file is affected, with the default mount options. overlayfs and FUSE passthrough forward the reads and writes on their files to a backing file on an underlying filesystem, through the helpers in fs/backing-file.c. The flag works for the file that the user opened: kiocb_set_rw_flags() clears IOCB_APPEND in the write's kiocb. It also copies RWF_NOAPPEND into ki_flags, as it does with every RWF_ flag. overlayfs and FUSE passthrough then pass the write on to the backing file. They opened it with the open flags of the user's file, so it is in append mode too. For a synchronous write, do_backing_file_write_iter() calls vfs_iter_write(), which sets up a new kiocb for the backing file. That kiocb starts out with IOCB_APPEND set. vfs_iter_write() is only given the flags of the user's kiocb that are in BACKING_IOCB_MASK, and RWF_NOAPPEND is not one of them. So nothing clears IOCB_APPEND again, and the data goes to the end of the file while the call returns success. An asynchronous write reuses the flags of the user's kiocb and is not affected. Reproduced by calling pwritev2() with RWF_NOAPPEND at offset 0, on an overlayfs file and on a FUSE passthrough file opened with O_APPEND: the data was at the end of the file afterwards. Fix this by adding RWF_NOAPPEND to BACKING_IOCB_MASK. Fixes: 73fa7547c70b ("vfs: add RWF_NOAPPEND flag for pwritev2") Cc: stable@vger.kernel.org Signed-off-by: Chris Mason Signed-off-by: Amir Goldstein Link: https://patch.msgid.link/20261101123440.3184069-1-amir73il@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit a06aca98fb2d0deb3a5be25e1482d07c7267c15a Author: Shashank Mohan Jain Date: Sun Sep 27 10:47:25 2026 +0530 errseq: don't let errseq_check_and_advance() hide later errors commit 94defd41d80f10bbe883c0c8d1b28d1665b6b153 upstream. errseq_check_and_advance() reads the errseq_t, sets ERRSEQ_SEEN with a cmpxchg() and then advances *since to the value it computed, ignoring whether the cmpxchg() succeeded. When it fails because errseq_set() recorded a different error in the meantime, *since ends up holding a value that was never stored in the errseq_t. errseq_set() only bumps the counter when ERRSEQ_SEEN is set. So as long as nobody has seen the new error, recording the original errno again recreates exactly the old value, and once another subscriber marks it seen, it is equal to the stale *since. The next check through that cursor then reports nothing, although -ENOSPC was recorded after the value that check reported, and -EIO was recorded again after it returned: cursor f writeback cursor g -------- --------- -------- set(-EIO) check_and_advance(&f) old = [c, EIO] set(-ENOSPC) -> [c, ENOSPC] cmpxchg() fails f = [c, EIO, SEEN] returns -EIO set(-EIO) -> [c, EIO] (no bump: unseen) check_and_advance(&g) -> [c, EIO, SEEN] returns -EIO check_and_advance(&f) [c, EIO, SEEN] == f returns 0 <- -ENOSPC and the second -EIO are lost For file->f_wb_err this means that fsync() on one descriptor can return 0 although writeback failed after the previous fsync() on that descriptor returned, when writeback errors race with fsync() on another descriptor of the same file. The same applies to syncfs() through sb->s_wb_err, which every file on the filesystem shares, and to the ext4 and jbd2 cursors on the block device mapping. The kernel-doc promises "Negative errno if one has been stored, or 0 if no new error has occurred". Retry with the value found when the cmpxchg() fails, so that *since is only ever advanced to a value that was actually stored with ERRSEQ_SEEN set. Every later errseq_set() then has to bump the counter, and the error is reported. The retry loop terminates because each iteration needs a concurrent update, like the loop in errseq_set(). A TLA+ model of errseq_set() and errseq_check_and_advance(), checked with the TLC model checker, finds the lost error with the current code; with this change TLC checks that an error recorded after a check returned is always reported by the next check (exhaustively for two subscribers with three checks each, and one writer recording four errors or two writers recording two each). The KUnit race test added in the next patch misses the error in 1-6% of 2 million rounds on 4-CPU UML before this change (depending on host load), and in none after it. Fixes: 84cbadadc6ea ("lib: add errseq_t type and infrastructure for handling it") Cc: stable@vger.kernel.org Signed-off-by: Shashank Mohan Jain Link: https://patch.msgid.link/20260927051726.71337-2-jain.sm@gmail.com Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit 8365c5aca9f43441968e6cd9d64afc6506619176 Author: Joshua Mulloy Date: Sun Oct 4 06:28:48 2026 -0400 memstick: core: don't clear dev->driver in memstick_device_remove() commit 6f2b998a52746892968741cbf8fc226985cbf286 upstream. memstick_device_remove() sets card->dev.driver to NULL after calling the driver's remove() callback. Since commit a995fe1a3aa7 ("rust: driver: drop device private data post unbind"), device_unbind_cleanup() dereferences dev->driver after the bus remove() callback has returned, so this should result in a NULL pointer dereference whenever a MemoryStick card is removed or its driver is unbound. The driver core clears dev->driver itself in device_unbind_cleanup(), so there is no need for the bus code to do it. Remove the assignment. This was found by code inspection, with the help of an AI coding assistant, after hitting the same bug in the TI FlashMedia bus code (drivers/misc/tifm_core.c), which oopsed on SD card removal. It has only been compile-tested: no MemoryStick hardware was available. Fixes: a995fe1a3aa7 ("rust: driver: drop device private data post unbind") Cc: stable@vger.kernel.org Signed-off-by: Joshua Mulloy Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit f44d60ad15b266dc768258417ea48383644da52a Author: Igor Velkov Date: Fri Oct 9 17:02:57 2026 +0000 mmc: meson-gx: name the limit of the CMD_CFG timeout field commit e1644210d15f7f8adbe6315199b4b73bead63a2c upstream. The data timeout is capped at a literal 32768 ms with a comment next to it. Give the limit a name beside the other timeout constants. Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov Reviewed-by: Neil Armstrong Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit b9c6c703b91b052ce55b7e9db6fd2212f54558df Author: Igor Velkov Date: Fri Oct 9 17:03:00 2026 +0000 mmc: meson-gx: report the longest busy wait the controller can do commit 18e9f7fb05ada68d491ff49165b9644f790e0e0c upstream. The driver does not set max_busy_timeout, so the core takes the host for one that can wait for busy indefinitely and sends erase and cache flush as R1b with busy timeouts of up to 60 s and 30 s. The CMD_CFG timeout field holds at most 32768 ms, so the controller times out first. Report 32768 ms as max_busy_timeout. The core then sizes discards to fit and, for a longer wait, sends R1 and polls for busy itself. Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov Reviewed-by: Neil Armstrong Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 72bb6078348f914ed6e38ea2396831a99f710f69 Author: Igor Velkov Date: Fri Oct 9 17:02:58 2026 +0000 mmc: meson-gx: honour the busy timeout for R1b commands commit 7e3cc541aa5855bc36e6cbffa82efc2795955a10 upstream. For a command without data the driver programs a fixed 1024 ms into the CMD_CFG timeout field, and for R1b the controller waits for the card to release busy within that time. The core sends erase and cache flush as R1b with busy timeouts of up to 60 s and 30 s, and the controller gives up after one second: mmc_erase: erase error -110, status 0x0 mmc1: cache flush error -110 Program the timeout from cmd->busy_timeout, kept between 1024 ms, the fixed value until now, and 32768 ms, the most the field holds, and rounded up to a power of two. The clamp comes first: MMC_IOC_CMD passes cmd_timeout_ms from user space straight into busy_timeout, and roundup_pow_of_two() of a value above 2^31 does not fit in unsigned int. sdhci takes its command timeout from cmd->busy_timeout in the same way. Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov Reviewed-by: Neil Armstrong Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 40e2a3b7b7cf838c3c39ad62bef6a5753621b26c Author: Igor Velkov Date: Fri Oct 9 17:02:59 2026 +0000 mmc: meson-gx: report busy from DAT0 alone commit 318fdb75f4dc9d18ae621b9fb25eb11160c95649 upstream. meson_mmc_card_busy() reports busy only while DAT0..3 are all low. A busy card drives DAT0 low and leaves DAT1..3 to the pull-ups, and the callback is defined as "Check if the card is pulling dat[0] low". So a busy card is reported free, and the core, which prefers card_busy over CMD13 in mmc_busy_cb(), stops polling after CMD6 and erase at once. The controller hides this on R1b commands, where it waits for busy itself. Once max_busy_timeout is reported, the core sends the longer waits, the 120 s BKOPS and 240 s sanitize switches among them, as R1 and has only the polling left. Look at DAT0 only, as sdhci_card_busy() does. The checks around the voltage switch in mmc_set_uhs_voltage() still hold: the card drives DAT0..3 low together after CMD11 and keeps them low together on failure. Fixes: 186cd8b7f586 ("mmc: meson-gx: implement card_busy callback") Cc: stable@vger.kernel.org Signed-off-by: Igor Velkov Reviewed-by: Neil Armstrong Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit e4cc9ce0ed160fe17f0d97c66db1302625dc529c Author: Ian Ray Date: Wed Oct 7 10:03:12 2026 +0300 mmc: sdhci-esdhc-imx: map unsupported driver type to Type B commit d35d93c2902592a84347a15deac4d67a323694c9 upstream. Since commit 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type"), the eMMC driver strength is passed directly to mmc_set_driver_type(), which propagates the value through ios.drv_type all the way to sdhci_set_ios(). For value 4, SDHCI correctly warns: mmc2: invalid driver type, default to driver type B The host driver type has no effect on this controller: esdhc_writew_le() never programs the driver-type field of SDHCI_HOST_CONTROL2. Hook set_ios() and force drv_type to the always-valid Type B, so that SDHCI never sees an unsupported value. Tested on i.MX8MP (usdhc3, eMMC in HS400) with `fixed-emmc-driver-type = <4>`: the warning is gone and the HS_TIMING register contains 0x43 as expected. Fixes: 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type") Link: https://lore.kernel.org/all/20260926122908.866-1-ian.ray@gehealthcare.com/ Cc: stable@vger.kernel.org Suggested-by: Adrian Hunter Signed-off-by: Ian Ray Acked-by: Adrian Hunter Reviewed-by: Haibo Chen Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit af50c1d3644142250c4de40edd67663697813587 Author: Runyu Xiao Date: Tue Sep 29 20:45:22 2026 +0800 mmc: omap: synchronize clock timer before disabling fclk commit c931c51681e33b24bc8d65c6df35b70e1827daa2 upstream. mmc_omap_select_slot() removes clk_timer with timer_delete() before switching slots and changing the functional clock state. timer_delete() only removes a pending timer and does not wait for a callback that is already running. If mmc_omap_clk_timer() is already running, it can therefore call mmc_omap_fclk_enable() while the request or slot-switch path changes the same clock state. During host removal, the same window can overlap the final clock shutdown. Use timer_delete_sync() so the callback has completed before slot switching or changing the functional clock state. Keep the timer restartable for normal request handling. Fixes: 0807a9b5739a ("MMC: OMAP: Lazy clock shutdown") Cc: stable@vger.kernel.org Signed-off-by: Runyu Xiao Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 148a01097648bf804b8147d7d740b94dff4f5091 Author: Anfernee Cao Date: Sat Oct 17 00:37:07 2026 +0800 mmc: mmci: fix DMA channel leak when mmc_add_host() fails commit 2d8927fadbf95e2d2dfa95bcc73882d6e19c2ce4 upstream. mmci_probe() calls mmci_dma_setup(), which acquires the RX and TX DMA channels via dma_request_chan(). These channels are not managed by devres, and are released only by mmci_dma_release(). If the following mmc_add_host() fails, probe jumps to the clk_disable label, which only disables the clock. As probe then fails, mmci_remove() is never called, so both DMA channels are leaked. Release them by adding a dedicated unwind label, reached only after mmci_dma_setup(). This issue was found by manual code inspection. Fixes: b38a20f29a49 ("mmc: mmci: fix return value check of mmc_add_host()") Cc: stable@vger.kernel.org Signed-off-by: Anfernee Cao Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 496b07ea6e5f5e4841e1ebd17d54ec782febb359 Author: Anfernee Cao Date: Tue Oct 20 23:36:47 2026 +0800 mmc: sunxi: fix clock and runtime PM leaks on probe failure commit e35e360bd66898a977c296ab71fe4bae17ddceb7 upstream. sunxi_mmc_resource_request() enables the bus, card, output and sample clocks before returning. Several failure paths later in sunxi_mmc_probe() leave them running: - If devm_request_threaded_irq() fails, the clocks enabled by sunxi_mmc_enable() are never disabled. - If dma_alloc_coherent(), mmc_of_parse() or sunxi_mmc_init_host() fails, probe only frees the DMA buffer and the mmc_host. - If mmc_add_host() fails, runtime PM has already been enabled, but pm_runtime_disable() is never called. Besides leaking the clocks, this leaves the clock enable counts unbalanced, so a reprobe (for example after -EPROBE_DEFER) calls clk_prepare_enable() on the same clocks again. Disable the IRQ and the clocks in the probe error path, and disable runtime PM on the mmc_add_host() failure path. Also handle a failure of devm_request_threaded_irq() in sunxi_mmc_resource_request(). Tested with QEMU's orangepi-pc machine: with forced sunxi_mmc_init_host() and mmc_add_host() failures the MMC clocks stay disabled in clk_summary, and a normal probe with an emulated SD card still works. This issue was found by manual code inspection. Fixes: 3cbcb16095f9 ("mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs") Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Anfernee Cao Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 0539458d1994125e3b143f013f5b35467dd1870b Author: Karl Mehltretter Date: Fri Oct 9 02:32:01 2026 +0200 mmc: sdhci-brcmstb: don't log an error for missing BOOT registers commit cf4a8d8b82db7f8e88e6ef4f3020a72860a9c440 upstream. The BOOT register range is optional: the probe function ignores a failure to map it and the suspend/resume code checks for NULL. It is mapped with devm_platform_get_and_ioremap_resource(), though, which calls dev_err_probe() when the resource does not exist. Every non-removable host without a third reg entry therefore logs an error at probe time and then works normally. The binding only describes the "host" and "cfg" ranges, so this is the case for the in-tree users. On the Raspberry Pi 5 family (BCM2712), where the SDIO host of the Wi-Fi module is non-removable, each boot prints: sdhci-brcmstb 1001100000.mmc: error -EINVAL: invalid resource (null) Look the resource up with platform_get_resource() first and map it only when it is present. Hosts that do have the range are mapped by the same two calls as before. Fixes: b7e614802e3f ("mmc: sdhci-brcmstb: save and restore registers during PM") Cc: stable@vger.kernel.org Signed-off-by: Karl Mehltretter Reviewed-by: Gregor Herburger Acked-by: Adrian Hunter Reviewed-by: Florian Fainelli Reviewed-by: Kamal Dasu Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit ad0495ee589c9dd60b9ab7f13d27f9cb0dc6f0b5 Author: Olivier Louvignes Date: Mon Oct 26 09:33:23 2026 +0100 mmc: jz4740: Remove the host before resetting the controller commit 6b8b1e8827837bf4cf1f87219038fddae9e81b0b upstream. jz4740_mmc_remove() masks every interrupt and resets the controller before mmc_remove_host(), which removes the card and lets the card's driver send its last commands. Those commands then run on a controller that was just reset, and can wait out the driver's 5 s request timeout. With an SDIO card that cost 5 s on every unbind: on a HiBy R1 (Ingenic X1600, a BCM43430A1 driven by brcmfmac), the CMD52 that sdio_release_irq() sends from brcmfmac's remove waited 5.1 s. The command had finished (END_CMD_RES set in MSC_STAT), but MSC_IMASK read 0xffffffff although the request had unmasked END_CMD_RES. MSC_STAT can still show IS_RESETTING after jz4740_mmc_reset() returns, so the reset most likely completed after that write and undid it. Remove the host first, then quiesce the controller, as other host drivers do. On the R1, unbinding the Wi-Fi's MSC now takes 0.65 s. Fixes: 61bfbdb85687 ("MMC: Add support for the controller on JZ4740 SoCs.") Cc: stable@vger.kernel.org Signed-off-by: Olivier Louvignes Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman commit 492fd4f20eb035342a39bf2af19219966c5f4a50 Author: Masami Hiramatsu (Google) Date: Wed Nov 4 08:58:45 2026 +0900 kprobes: Validate re-registration earlier in register_kretprobe() commit a553b499f22bf054964d4fd16d136f3d4f836c23 upstream. register_kretprobe() only checked for re-registration if rp->kp.addr was specified, skipping the check when rp was registered with symbol_name and rp->kp.addr was NULL. In that scenario, register_kretprobe() proceeded to allocate a new rethook (or kretprobe holder), and when register_kprobe(&rp->kp) subsequently failed due to re-registration, the error path freed and NULL-ed rp->rh (or rp->rph) on the still-active kretprobe, leading to NULL pointer dereferences when the active probe was hit. Resolve the target address via _kprobe_addr() up-front and check whether the probe is already registered at that address via check_kprobe_rereg_at() before allocating any resources, and drop the WARN_ON_ONCE() in the re-registration check now that re-registration is gracefully detected and rejected. Link: https://lore.kernel.org/all/179375032568.247640.17429793187163536192.stgit@devnote2/ Fixes: 0188b87899ff ("kretprobe: Avoid re-registration of the same kretprobe earlier") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit df4d20bd67eb1b594856b80b42dd2061af40fb73 Author: Masami Hiramatsu (Google) Date: Wed Nov 4 08:58:36 2026 +0900 kprobes: Fix double free and NULL deref in unregister_kretprobes() commit 2053bac1d6e47b33fa2e570c87518395e64f7da0 upstream. In unregister_kretprobes(), if __unregister_kprobe_top() returns an error (e.g., if the kretprobe was not registered or was already unregistered), rethook_free(rps[i]->rh) or rcu_assign_pointer(rps[i]->rph->rp, NULL) is still executed. For rethook-based kretprobes, calling rethook_free() on an already-freed rethook causes a double-free / list corruption in RCU. For legacy kretprobes, rps[i]->rph is NULL after previous cleanup, resulting in a NULL pointer dereference. Skip rethook_free() and rph cleanup if __unregister_kprobe_top() fails, and clear rps[i]->rh after synchronize_rcu() has waited for in-flight pre_handler_kretprobe() invocations to complete. Link: https://lore.kernel.org/all/179375031660.247640.6349602689169856649.stgit@devnote2/ Fixes: 73f9b911faa7 ("kprobes: Use rethook for kretprobe if possible") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 249ddbd45b67a0138b6677e66677e546090019e1 Author: Masami Hiramatsu (Google) Date: Wed Nov 4 08:58:27 2026 +0900 kprobes: Fix error return and slot leak in __register_kprobe() commit 6a658cc2d605e5acf35e638c62f480460d5939cd upstream. When arm_kprobe() fails in __register_kprobe(), the probe is removed from kprobe_table and synchronize_rcu() is executed, but the error code ret was ignored and try_to_optimize_kprobe(p) was executed, returning 0. Additionally, the instruction slot allocated by prepare_kprobe() was leaked. Fix this by releasing the instruction slot via arch_remove_kprobe(p) and returning ret when arm_kprobe() fails. Link: https://lore.kernel.org/all/179375030756.247640.10859474201266455798.stgit@devnote2/ Fixes: 587e8e6d640b ("kprobes: Adopt guard() and scoped_guard()") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 9b7e8867c69c9e6d4ca8d8a5bcd28950e0b344fb Author: Steven Rostedt Date: Thu Oct 29 21:12:18 2026 -0400 tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc commit 88d5f8cb8a6276194ac8c1de44f3ed77d7e938ce upstream. The checkbashism is giving a false positive to the kprobe test of: ($"foo" should be eval_gettext "foo"): if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then This is because it sees the $" at the end of the grep as a bash symbol. Instead, escape the '$' with a backslash as it is within quotes and that '$' is for grep to process an end of line character and not a bash variable. Link: https://lore.kernel.org/r/20261029211218.3749963a@fedora Cc: stable@vger.kernel.org Fixes: d22c3e0088e85 ("selftests/ftrace: Fix unique symbol check in kprobe_non_uniq_symbol.tc") Signed-off-by: Steven Rostedt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman commit c785e14d033924531a91e7081cf71da71912e2e9 Author: Jaewon Jung Date: Wed Oct 28 10:18:49 2026 +0900 selftests/ftrace: Add missing spaces after ! in probe syntax tests commit 36990c8fda77d918b1e52d5d6df3a144b552d86e upstream. Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support. Link: https://lore.kernel.org/r/20261025075044.1750113-1-jaewon8868@gmail.com Fixes: 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)") Cc: stable@vger.kernel.org Signed-off-by: Jaewon Jung Acked-by: Masami Hiramatsu (Google) Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman commit 4d6783a1334646c926d76aba4eff0d535c81174e Author: Andrew Davison Date: Fri Nov 6 17:55:18 2026 +0000 ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set commit fda103c1432f344e1cd548f346d157b1e67ee7c5 upstream. parse_codec_mode() reads the vendor and subsystem IDs of a patch file's [codec] line into an int, and skips the check when the value is zero or negative, as documented. An ID with bit 31 set, such as SigmaTel's 0x8384xxxx or Intel's 0x8086xxxx, comes out negative, so it is taken as a wildcard and the section is applied to every codec instead of the one it names. This was seen on an OpenPeak OpenFrame 2 with an IDT 92HD75B2X5 (0x111d7608). A patch file written for the STAC9202 (0x83847632) in the related OpenFrame 1 was applied to it, swapping the headphone and speaker pin configurations, so auto-mute never muted the speaker. Read the IDs as long long, so real IDs are compared exactly. Values written as negative numbers (e.g. -1) still act as wildcards, as documented; a hex value such as 0xffffffff is now compared as written. Tested on 6.18.60 on an OpenFrame 2, with a rebuilt snd-hda-codec and the STAC9202 patch file: user_pin_configs stays empty for the IDT codec, and the headphone and line-out pins are assigned as the BIOS sets them. Not tested on a STAC9202 itself. The bug was tracked down and this fix written with an AI coding assistant (Claude Code, Claude Opus 5.5), which also ran the tests above. I have reviewed the change and the tests. Fixes: ef940b0403d4 ("ALSA: hda - Allow patching with any vendor/subsystem ids") Cc: stable@vger.kernel.org Signed-off-by: Andrew Davison Link: https://patch.msgid.link/20261106175518.18629-1-andy@dvsn.net Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit df8865d0e977fe72497280aebdec66857d533a08 Author: Gichoon Han Date: Tue Nov 10 15:00:21 2026 +0900 ALSA: usb-audio: Drop capture packets with bogus actual_length commit eed0e9583a290e6adbe3a8480bdae911f31e1ed9 upstream. retire_capture_urb() copies urb->iso_frame_desc[i].actual_length bytes out of urb->transfer_buffer at the packet's offset, but never checks that value against the requested packet length. A host controller reporting more data than requested makes memcpy() read past the end of the URB transfer buffer. Commit 06be918062ad ("ALSA: usb-audio: Bound packet copies by the PCM buffer size") clamps the count to the PCM ring buffer size, which protects the destination. The source slot is only ep->curpacksize bytes per packet, though, so the over-read remains. This was hit on an ARM32 system (vendor 5.4 kernel; the code path is unchanged in mainline) with a full-speed UAC1 microphone behind a high-speed hub, i.e. the EHCI siTD path. sitd_complete() computes actual_length as desc->length - SITD_LENGTH(t); the controller reported a remaining length larger than the programmed one, the value wrapped to ~4G, and the capture copy faulted on the first unmapped page after the URB buffer: Unable to handle kernel paging request at virtual address e8756000 Internal error: Oops: 7 [#1] PREEMPT SMP ARM r3 : 00000000 r2 : 0001e700 r1 : e8756000 r0 : e878fc80 Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8) A packet can never legitimately carry more than its requested length, so warn and skip it instead of copying. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Gichoon Han Link: https://patch.msgid.link/20261110060021.2146383-1-gichoon.han@samsung.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 87f27e5919c47cc53a14d2e9105edaa05e1cf182 Author: Angel J Date: Tue Nov 3 07:03:36 2026 -0800 ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone commit ae28ba98f55a2f30fed57371899b8cecd7cbde64 upstream. The Dell XPS 8940 (1028:09c5) has an ALC3861 codec (0x10ec0899). Its BIOS marks the headset microphone pin at NID 0x19 as disconnected (0x411111f0). With no external microphone input in the pin configuration, the generic parser creates a shared headphone/mic input on NID 0x1b instead. Headphone playback works, but the headset microphone is silent. Override NID 0x19 as a front microphone without independent presence detection. This gives the generic parser the dedicated microphone input and preserves NID 0x1b for simultaneous headphone playback. I encountered this issue on my XPS 8940. Similar symptoms were also reported by a user on Ubuntu: https://bugs.launchpad.net/bugs/1971232 Cc: stable@vger.kernel.org Assisted-by: Codex (GPT-6.1 Sol) Signed-off-by: Angel J Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261103150336.507675-1-iamanaws@httpd.dev Signed-off-by: Greg Kroah-Hartman commit e391625fc71c6bd859eba48bc969010e62bc2dca Author: Takashi Iwai Date: Thu Nov 12 13:48:42 2026 +0100 Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2" commit d1a1f361e08311f6d9a4aea2da2d1bcb3891f4ef upstream. This reverts commit 82cfab6a52621febf36752bd5ed5184f82c96e07. The quirk entry seems matching with other multiple irrelevant models that lead to a regression on those. Maybe we should use HDA_CODEC_QUIRK() entry for the corresponding codec SSID, instead. But let's revert for addressing the regression at first. Fixes: 82cfab6a5262 ("ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2") Closes: https://lore.kernel.org/71fb1e29-60e1-4522-a071-c53557cea39b@icloud.com Closes: https://lore.kernel.org/CABWzDrqrskmtb7MVFgJ54k4WNSqby7Qo3R1XeoVBaJ+djaO1ew@mail.gmail.com Cc: Link: https://patch.msgid.link/20261112124844.694544-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit e6d9a5376b40dfcb6c9d1dc09146e0b95bebc043 Author: Sergei Nizovtsev Date: Thu Nov 12 10:48:54 2026 +0100 ALSA: caiaq: Kill EP1 URB before unregistering the input device commit 5d325345185015024a86abca4cc5fa6a3f75294e upstream. snd_disconnect() unregisters the input device via snd_usb_caiaq_input_disconnect() and only afterwards kills the EP1 command URB (cdev->ep1_in_urb). The EP1 completion handler usb_ep1_command_reply_dispatch() feeds snd_usb_caiaq_input_dispatch() for EP1_CMD_READ_{ERP,ANALOG,IO} replies, which report into cdev->input_dev. Since commit b04dcbb7f7b1 ("ALSA: caiaq: Use snd_card_free_when_closed() at disconnection") the input device is unregistered from snd_usb_caiaq_input_disconnect() but cdev->input_dev is cleared only later, in snd_usb_caiaq_input_free() from the card destructor. As the dispatch guard only tests cdev->input_dev for NULL, an EP1 reply that completes after input_unregister_device() but before cdev->ep1_in_urb is killed reports into an input device that has already been unregistered and, with no evdev client holding it open, freed. Normally the window is closed by the USB core: usb_unbind_interface() calls usb_disable_interface() before ->disconnect(), which flushes the EP1 URB as long as endpoint 0x81 belongs to the interface being unbound. But caiaq addresses EP1 through the device-wide pipe usb_rcvbulkpipe(usb_dev, 0x1) without checking which interface owns the endpoint. If a device declares it in another interface, the URB stays live across snd_disconnect() of the interface that owns the card. This needs a crafted device descriptor; a device that has EP1 in the interface caiaq is bound to is not affected. Kill cdev->ep1_in_urb (and the paired midi_out_urb) before the input and audio disconnect helpers, so no EP1 completion can run once the input device has been unregistered. Reproduced under KASAN with raw-gadget + dummy_hcd emulating an Audio Kontrol 1 (17cc:0815) with the EP1 bulk pair in interface 1: only interface 0 was bound to snd-usb-caiaq and then unbound through sysfs while the gadget flooded EP1 with EP1_CMD_READ_ERP replies. With no PCM stream running the window is very short and was only hit by stalling the unbinding CPU with a kgdb breakpoint at snd_usb_caiaq_audio_disconnect(). With the fix applied, the same test runs clean. BUG: KASAN: slab-use-after-free in input_event+0x3a/0xc0 Read of size 8 at addr ffff8880151a4028 by task sh/118 Call Trace: input_event+0x3a/0xc0 snd_usb_caiaq_input_dispatch+0xab2/0xf00 usb_ep1_command_reply_dispatch+0x1f3/0x580 __usb_hcd_giveback_urb+0x246/0x400 dummy_timer+0x1415/0x3380 __hrtimer_run_queues+0x39d/0x800 hrtimer_run_softirq+0x187/0x2d0 handle_softirqs+0x1ff/0x930 __irq_exit_rcu+0x15b/0x210 irq_exit_rcu+0xe/0x20 sysvec_apic_timer_interrupt+0x81/0xb0 asm_sysvec_apic_timer_interrupt+0x1a/0x20 RIP: 0010:snd_usb_caiaq_audio_disconnect+0x0/0x70 snd_disconnect+0x81/0x110 usb_unbind_interface+0x1a0/0x860 device_release_driver_internal+0x2c5/0x470 unbind_store+0xde/0x100 Allocated by task 80: input_allocate_device+0x47/0x340 snd_usb_caiaq_input_init+0x4c/0x1ac0 snd_probe+0xab3/0x1160 usb_probe_interface+0x2ea/0x810 Freed by task 118: kfree+0x1ea/0x5c0 input_dev_release+0xab/0xd0 device_release+0xcf/0x250 kobject_put+0x169/0x320 snd_disconnect+0x79/0x110 usb_unbind_interface+0x1a0/0x860 Fixes: b04dcbb7f7b1 ("ALSA: caiaq: Use snd_card_free_when_closed() at disconnection") Cc: stable@vger.kernel.org Signed-off-by: Sergei Nizovtsev Assisted-by: Claude:claude-opus-4-8 Link: https://patch.msgid.link/20261112094904.2430318-1-snizovtsev@cloudlinux.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 887b6c3399816961bfe75a92f4128a1ea76d2188 Author: Zhiqi Zhang Date: Wed Nov 4 15:37:41 2026 +0800 bootconfig: Allow keys with the maximum supported depth commit cab697164b47eecfa2f146024f5d661f99a1a1e7 upstream. xbc_verify_tree() accepts keys with XBC_DEPTH_MAX (16) components, but xbc_node_compose_key_after() returns -ERANGE immediately after storing the sixteenth component. It rejects the key before discovering that there are no more ancestors to collect. For example, a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p = value can be attached to an initrd successfully. However, bootconfig -l stops listing and prints "Failed to compose key -34". In the kernel, the same error propagates through copy_xbc_key_value_list() during its length probe, so proc_boot_config_init() returns before creating /proc/bootconfig. Check the array capacity before storing the next component. This lets exactly XBC_DEPTH_MAX components be composed while retaining the check before any out-of-bounds store. I found this issue while reviewing bootconfig's depth handling and used OpenAI Codex to verify the failure and develop the fix. I reviewed the change and wrote and ran the regression tests. Link: https://lore.kernel.org/all/20261104073742.21202-2-zhiqizhangg@gmail.com/ Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support") Cc: stable@vger.kernel.org Signed-off-by: Zhiqi Zhang Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit ce0cf1fedb99bbe3804d2b2522ff30bec633a475 Author: Yuansheng Yang <0xbeac@gmail.com> Date: Tue Nov 10 11:02:52 2026 +0800 KEYS: Protect pkey method checks against type removal commit bab48a1044475f62d6e910c6d7267ce4bae847f9 upstream. keyctl_pkey_query(), keyctl_pkey_e_d_s() and keyctl_pkey_verify() check that key->type has the ->asym_*() method they need and call it later, without holding key->sem. A reference keeps the key alive, but does not pin the module that provides its type. When that module is unloaded, unregister_key_type() waits for the key GC to process every remaining key of the type. For each such key, the GC takes key->sem for writing, switches key->type to key_type_dead, whose ->asym_*() methods are NULL, and destroys the payload. If that happens between the check and the call, the keyctl calls a NULL method; if it happens while the method runs, the method returns into freed module text. In-tree, turris-signing-key provides ->asym_query() and ->asym_eds_op() and can be built as a module. Take key->sem for reading around each method call, and check the method again under it, right before the call. While the lock is held the GC cannot switch the key to key_type_dead, so unregister_key_type() and the module unload cannot complete until the method returns. If the type is already gone, the check finds key_type_dead and the keyctl fails with -EOPNOTSUPP, as it does for any key type without the method. memdup_user() and copy_to_user() stay outside key->sem, as in keyctl_read_key(), so no page fault is taken with key->sem held. The in-tree ->asym_*() methods do not take key->sem themselves. Nothing else in the kernel calls these methods, so these four call sites are the full coverage: - keyctl_pkey_query(): ->asym_query() for KEYCTL_PKEY_QUERY - keyctl_pkey_params_get_2(): ->asym_query(), and the op-specific check for KEYCTL_PKEY_ENCRYPT, _DECRYPT, _SIGN and _VERIFY - keyctl_pkey_e_d_s(): ->asym_eds_op() for _ENCRYPT, _DECRYPT and _SIGN - keyctl_pkey_verify(): ->asym_verify_signature() for _VERIFY This problem was recently fixed for keyctl_read_key() by 925c84e3cc21 ("keys: Protect the read method check against type removal") and for key_update() by aef3a8a4f988 ("KEYS: Protect the update method check against type removal"). Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Cc: stable@vger.kernel.org Signed-off-by: Yuansheng Yang <0xbeac@gmail.com> Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261110030252.9979-1-0xbeac@gmail.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit f880f9e8f65a1df621dbf43eb552e37bf2ee27e1 Author: Jarkko Sakkinen Date: Tue Oct 20 20:43:21 2026 +0300 KEYS: Verify the key identity in __key_unlink_begin commit 7a7f70ff7b26519c98b339a3e0cd9ee3c8d17f77 upstream. When two keys have identical type and description, linking the second key replaces the first in a keyring. However, attempting to unlink the first key (no longer in the keyring) unlinks the second key. This happens because __key_unlink_begin() calls assoc_array_delete() with &key->index_key, matching only on type and description rather than the key's identity. Example: keyctl new_session >/dev/null keyctl newring ring_a @s keyctl newring ring_b @s A=$(keyctl add user A ss %:ring_a) B=$(keyctl add user A qq %:ring_b) keyctl newring R @s keyctl link $A %:R keyctl link $B %:R keyctl unlink $A %:R keyctl show Verify the key identity before unlinking, and return -ENOENT on mismatch, instead of unlinking the key with the wrong identity. Cc: stable@vger.kernel.org Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring") Reviewed-by: David Howells Reviewed-by: Eric Biggers Link: https://lore.kernel.org/r/20261020174325.2229448-4-jarkko@kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 08d250b1afb24098824bf815e1c8ee84c58c5593 Author: Jarkko Sakkinen Date: Tue Oct 20 20:43:20 2026 +0300 KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE commit 094c53d2994975e36d4cab7cf5d9f34c1b0f1916 upstream. KEY_MAX_DESC_SIZE includes the trailing NULL character. Descriptions generated from payloads and in-kernel paths bypass the userspace limit. Reject descriptions at or above KEY_MAX_DESC_SIZE with -EINVAL at the following sites: - key_alloc(): before quota calculation - __key_create_or_update(): before key_set_index_key() - keyring_search(): before match_preparse - request_key_and_link(): before match_preparse - request_key_rcu(): before check_cached_key() Cc: stable@vger.kernel.org Fixes: f771fde82051 ("keys: Simplify key description management") Reviewed-by: David Howells Reviewed-by: Eric Biggers Link: https://lore.kernel.org/r/20261020174325.2229448-3-jarkko@kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 35c37f5e1152e01b6b57e1ebfb631d2aa4b5abb5 Author: Jarkko Sakkinen Date: Tue Oct 20 20:43:19 2026 +0300 KEYS: Expand key->{datalen,quotalen} to unsigned int commit 4a65eaf146f0d10ebaa88cfaef9c3b24f93766d9 upstream. In key_alloc() and key_payload_reserve(), key->quotalen and key->datalen can receive values larger than USHRT_MAX. Example: keyctl new_session >/dev/null owner=$(keyctl newring owner @s) keeper=$(keyctl newring keeper @s) for ((i=0; i<16384; i++)); do key=$(keyctl add user "k$i" x "$keeper") keyctl link "$key" "$owner" done awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users keyctl clear "$owner" awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users Because key->datalen wraps around 65535, the quota refunded upon clearing is truncated, causing quota bytes to leak in /proc/key-users. Change the types of key->datalen and key->quotalen from unsigned short to unsigned int so that they can carry the full payload length without truncation. Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: David Howells Reviewed-by: Eric Biggers Link: https://lore.kernel.org/r/20261020174325.2229448-2-jarkko@kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 3e21eded63a5b9a2a9ce5c06ae2b8318d5450458 Author: David Carlier Date: Sat Nov 7 10:12:32 2026 +0000 tracing/eprobe: Install the trigger for every instance that enables the eprobe commit be94710b1f6ba1bea33e73129c110af80e999b2d upstream. The eprobe trigger lives in the instance of the enabling file, but it is only added when the eprobe is first enabled and only removed when the last file goes away. A second instance then records nothing, and the first instance's trigger is left behind once the eprobe is disabled there, so the eprobe can be deleted while that trigger still uses it. Add and remove the trigger for each file. The file is never NULL here, so warn if it is and drop the dead perf paths. Link: https://lore.kernel.org/all/20261107101233.151434-1-devnexen@gmail.com/ Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") Cc: stable@vger.kernel.org Signed-off-by: David Carlier Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Greg Kroah-Hartman commit 9e5c6137b76b6866666f2ad84d4854b606cbf25b Author: Ridong Chen Date: Thu Nov 12 11:19:31 2026 +0800 cpuset: generalize the validate_partition() interface [ Upstream commit e234ed1bb82c96a5643fd70784f16cf3d72eeed3 ] Refactor validate_partition() to take the parent partition, the new partition root state, the new effective exclusive CPUs and the CPUs to be deleted, instead of a trial cpuset. A NULL parent stands for a remote partition, whose CPUs come from top_cpuset. This makes the interface flexible enough to handle both local and remote partition validation. This also fixes a false PERR_NOCPUS error when expanding a remote partition. The no CPU left for tasks check in partition_cpus_change() is done against the cgroup parent, but the CPUs of a remote partition come from top_cpuset, not from its parent. For example, on a 4-CPU system: echo 2-3 > P/cpuset.cpus echo 2-3 > P/cpuset.cpus.exclusive echo 2-3 > P/C/cpuset.cpus echo 2 > P/C/cpuset.cpus.exclusive echo root > P/C/cpuset.cpus.partition (a task in P) echo 2-3 > P/C/cpuset.cpus.exclusive cat P/C/cpuset.cpus.partition root invalid (Parent is not a partition root) The effective_cpus of P is 3, a subset of the new exclusive CPUs 2-3 of C, and P has a task, so the expansion is rejected. However, P is not a partition root and does not give any CPU to C, and top_cpuset still has CPUs 0-1 for the task. Enabling C directly with exclusive CPUs 2-3 succeeds, as remote_partition_enable() checks top_cpuset instead. The no CPU left for tasks check now uses the given parent instead of parent_cs(cs), and top_cpuset for a remote partition, as that is where its CPUs are taken from. The housekeeping conflict check is folded into validate_partition(). It is skipped when the parent is not a valid partition root, as @cs can't be a valid local partition in that case. Use the new interface for local partition enablement in update_parent_effective_cpumask() and in partition_cpus_change(), replacing the open-coded checks there. The order of the checks is now the same for both paths: empty CPUs, housekeeping conflict, then no CPU left for tasks. Add a test case to test_cpuset_prs.sh for the remote partition expansion above. Fixes: 181c8e091aae ("cgroup/cpuset: Introduce remote partition") Signed-off-by: Ridong Chen Reviewed-by: Guopeng Zhang Reviewed-by: Waiman Long Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 8cf0bde5988c8a5550dbfaf2959cf60ddd4a2220 Author: Jan Beulich Date: Tue Nov 10 10:56:05 2026 +0100 Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() [ Upstream commit 2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9 ] Both decrease-reservation and populate-physmap can succeed partially. For the former this may be pretty unlikely, but clearly the latter can hit both out-of-memory conditions in the hypervisor or denial because of the allocation exceeding the domain's allowance (there's no interaction with the balloon driver here either). In gnttab_dma_free_pages() we simply can't give back to the system what hasn't been re-filled with backing memory. For gnttab_dma_alloc_pages() both parts of the overall region need dealing with differently. While no present caller of gnttab_dma_free_pages() checks its return value, also don't use -EFAULT there: It really is an out-of-memory condition. (In gnttab_dma_alloc_pages() -EFAULT doesn't look quite right either, but I couldn't think of a clearly better error code there.) Fixes: 9bdc7304f536 ("xen/grant-table: Allow allocating buffers suitable for DMA") Signed-off-by: Jan Beulich Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross Message-ID: <20261110095605.369848-3-jgross@suse.com> Signed-off-by: Sasha Levin commit 3123c8f50963d751cac34bb250432e52f708e505 Author: Jude Gyimah Date: Fri Nov 13 07:46:14 2026 +0100 ALSA: aw2-alsa: select SND_PCM [ Upstream commit bca568589ad118a9b0bac086760baee2a41976a5 ] Several stanzas in sound/pci/Kconfig select SND_PCM. SND_AW2 selects nothing at all. aw2-alsa calls snd_pcm_new, which sound/core/pcm.c provides under SND_PCM. aw2-alsa.c:(.text+0x554): undefined reference to `snd_pcm_new' 4 symbols are undefined in all. The driver can be built into vmlinux while SND_PCM is a module, in which case the symbols are not there at link time. Select rather than depend on: SND_PCM has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_AW2 unselectable. Reproduced on v7.3, arm64, with CONFIG_SND_AW2=y and CONFIG_SND_PCM=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: 98f2a97f207a ("[ALSA] Emagic Audiowerk 2 ALSA driver.") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261113064614.15045-1-jude.gyimah87@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit edfac1dd12b7bf24739ee44f7c5e1c6a2ca95527 Author: Guixiong Wei Date: Mon Nov 9 11:29:20 2026 +0800 KEYS: do not let an unmatched key decide the search result [ Upstream commit 143fe160178c73e43575bff4890d23f84e37146d ] With the dns_resolver key type available, put a key named "foo" in a fresh session keyring, revoke it, and search for "bar": keyctl new_session >/dev/null A=$(printf '127.0.0.1\0' | keyctl padd dns_resolver foo @s) keyctl revoke "$A" keyctl search @s dns_resolver bar Results: keyctl_search: Key has been revoked The search returns -EKEYREVOKED even though there is no key named "bar". It should return -ENOKEY. A dns_resolver search walks the keys in the keyring and uses dns_resolver_cmp() to compare their descriptions with the requested name. When keyring_search_iterator() sees the revoked "foo" key, it records -EKEYREVOKED in ctx->result and skips the key before comparing its description. The search continues, but without a match it returns the error recorded for "foo". Call the match callback before checking for invalidated, revoked or expired keys. A nonmatching key then leaves ctx->result alone. Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring") Reported-by: Jarkko Sakkinen Closes: https://lore.kernel.org/lkml/avDG8G-Jl1YsmfCs@kernel.org/ Signed-off-by: Guixiong Wei Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261109032931.80406-2-weiguixiong@bytedance.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin commit 71e3b6d795efe20f3d4d7bf64044e4382c784942 Author: Manuel Ebner Date: Thu Nov 12 09:55:11 2026 +0100 docs, kprobes: Fix bracket [ Upstream commit b91a5c16996d089cd07ceaf33b5a621cb94c2c2f ] Remove needless ')' Link: https://lore.kernel.org/all/20261112085511.690900-2-manuelebnerli@mailbox.org/ Fixes: a1dac767622c ("kprobes.txt: standardize document format") Signed-off-by: Manuel Ebner Acked-by: Randy Dunlap Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit 4c11f938f81c3aa1683b71da50ef0a4b8d82b709 Author: Wenwen Fu Date: Fri Nov 6 10:14:57 2026 +0800 tracing: skip boot kprobe setup when no events were requested [ Upstream commit 2388a673e9276de30c7e917fce50830e497d46cc ] setup_boot_kprobe_events() calls enable_boot_kprobe_events() even when the kprobe_event= boot parameter was not supplied. That call takes event_mutex without any command-line probes to enable. Asynchronous eval-map updates also hold event_mutex. A normal boot can therefore wait in init_kprobe_trace() for this background work despite having no boot probes to set up. Return early when the boot-event buffer is empty. Keep the mutex protection in trace_event_update_all() and retain setup for explicit kprobe_event= parameters. Bootconfig handles its own probe enablement, and the existing trace_eval_sync() still waits for background work before init memory is freed. Link: https://lore.kernel.org/all/20261106021457.2648231-1-wenwfu@qti.qualcomm.com/ Fixes: 970988e19eb0 ("tracing/kprobe: Add kprobe_event= boot parameter") Signed-off-by: Wenwen Fu Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit 766d400fa553a8cef0670e1cb0664d8b78fd3101 Author: Eric Dumazet Date: Thu Nov 12 11:20:00 2026 +0100 nsh: limit recursion in nsh_gso_segment() [ Upstream commit 3921fb102d78a6d7aa61b8d273e097a1a8026b90 ] nsh_gso_segment() calls skb_mac_gso_segment() for the inner packet, which calls nsh_gso_segment() again when the next protocol is NSH, either directly or behind an inner Ethernet header (ETH_P_TEB). Nothing limits the depth: a GSO packet made of stacked 8-byte NSH headers recurses once per header, and a 64KB packet can hold about 8000 of them, overflowing the kernel stack. Such a packet can be injected with a packet socket using PACKET_VNET_HDR, or with tun/tap or virtio_net, as nothing checks that a GSO packet with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the protocol it claims. It is then segmented in software if the output device does not support the GSO type: BUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000) Oops: stack guard page: 0000 [#1] SMP NOPTI CPU: 3 UID: 0 PID: 337 Comm: nsh_gso Tainted: G E 7.4.0-rc1+ #118 PREEMPT(lazy) RIP: 0010:lock_acquire (kernel/locking/lockdep.c:5902) Call Trace: skb_mac_gso_segment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50) nsh_gso_segment (net/nsh/nsh.c:110) nsh skb_mac_gso_segment (net/core/gso.c:53) nsh_gso_segment (net/nsh/nsh.c:110) nsh [...] skb_mac_gso_segment (net/core/gso.c:53) __skb_gso_segment (net/core/gso.c:129) validate_xmit_skb (net/core/dev.c:4238) __dev_queue_xmit (net/core/dev.c:5087) packet_sendmsg (net/packet/af_packet.c:3157 net/packet/af_packet.c:3189) __sys_sendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283) __x64_sys_sendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286) do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) Use gso_recursion_inc_test(), added in commit 006c8b834aed ("net: gso: limit recursive IP-in-IP segmentation"), with the same limit as IPv4 and IPv6. The counter is shared with them: a packet with four NSH headers in front of an IPv4 header is still segmented, one more NSH header and it is dropped. The NSH -> ETH_P_TEB -> NSH route is covered as well, as each round goes through nsh_gso_segment(). Fixes: c411ed854584 ("nsh: add GSO support") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179443691180.2199510.148246238688217560@kernel.org/ Cc: Jiri Benc Signed-off-by: Eric Dumazet Reviewed-by: Jiri Benc Link: https://patch.msgid.link/20261112102001.3744643-2-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 9a1a2ec67531541734eefbd634c712c5809f0610 Author: Chuck Lever Date: Wed Nov 11 10:55:20 2026 -0800 selftests: tls: Skip the zero_len tests when TLS is unavailable [ Upstream commit 77389a6d30a262fa94d427c03a393c05c013665c ] FIXTURE_SETUP(zero_len) returns early when ulp_sock_pair() reports that the TCP_ULP setsockopt failed, so on a kernel built without CONFIG_TLS the TLS_RX setsockopt never runs. TEST_F(zero_len, test) then sends its raw records over a plain TCP socket, which returns the ciphertext verbatim. All eight variants FAIL on a machine that lacks TLS, and those failures mask any real regression in the same run. Skip the test when the fixture recorded notls, as the other fixtures in this file do. Fixes: a61a3e961baf ("selftests: tls: add tests for zero-length records") Signed-off-by: Chuck Lever Link: https://patch.msgid.link/20261111185522.2859004-4-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit f2b0dd5b71952777fde1f63dbf1ee16764b492ba Author: Chuck Lever Date: Wed Nov 11 10:55:19 2026 -0800 tls: Consume empty data records in tls_sw_splice_read() [ Upstream commit db6a6c6863bd22b2543e313cb8e4807fdd33778b ] A zero-length application_data record decrypts to full_len == 0, so tls_sw_splice_read() splices zero bytes and returns zero. A zero return from a splice read means EOF, and the caller tears down a connection that is still live. Consume the record and fetch the next one, as tls_sw_read_sock() does. The cap on consecutive empty records bounds the loop. When an empty record precedes a close_notify, splice(2) now returns -EINVAL from the control-record test instead of a false EOF. A splice that reaches an alert record already reports -EINVAL. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Reported-by: Sabrina Dubroca Closes: https://lore.kernel.org/netdev/akaoXcfamBp8_mYe@krikkit/ Signed-off-by: Chuck Lever Link: https://patch.msgid.link/20261111185522.2859004-3-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit aeba2ad3ea054c28e6d5e4e3497aae10fb4b9234 Author: Jakub Kicinski Date: Wed Nov 11 10:55:18 2026 -0800 tls: Break the connection after a burst of empty data records [ Upstream commit 201f0531e413d6cdd9673a77bea340839e1713ae ] TLS permits zero-length application_data records, and RFC 8446 suggests them for generating cover traffic. Nothing bounds how many of them a reader processes back to back, though. They advance neither loop bound in tls_sw_recvmsg() and tls_sw_read_sock(), so a peer streaming them faster than the reader decrypts them keeps it in the kernel for as long as they arrive. recvmsg() does not check for signals while records are ready, and its peek and async paths queue every empty record on rx_list. read_sock consumers like nvme-tcp hold the socket lock throughout and never get control back. Break the connection once a reader decrypts more than 128 consecutive empty data records without sleeping or returning to its caller in between, treating the burst as a protocol violation like a malformed record header. A stream of empty records which the reader keeps up with costs no more than any other traffic, so the count starts over on every read and whenever the reader waits for the next record. The strparser is stopped before it parses the next record, so the reader gets the error from tls_rx_rec_wait() and no later record is delivered. Returning to the caller and keeping the connection alive would need a way to wake read_sock consumers which installed their own sk_data_ready after the handshake, a lot of code for a peer that is either broken or malicious. Consume empty records in recvmsg() rather than queuing them on rx_list, so that repeated MSG_PEEK cannot pile them up past the per-read count. Decrypt them synchronously, too. Once a recvmsg() call has decrypted a record asynchronously, recv_end replaces the error with the result of process_rx_list(), so a call that saw only empty records returns 0, a false EOF, instead of the error or -EAGAIN. Reported-by: sashiko-bot Closes: https://sashiko.dev/#/patchset/20260720-tcp-read-sock-v2-0-29545d034f3c@kernel.org?part=1 Closes: https://sashiko.dev/#/patchset/20260630191551.875664-1-cel@kernel.org?part=1 Link: https://lore.kernel.org/all/20261019-tls-follow-on-v6-0-ab01c4ecca0c@kernel.org/ Fixes: c46234ebb4d1 ("tls: RX path for ktls") Fixes: 3be28e2c9cd0 ("net/tls: Consume empty data records in tls_sw_read_sock()") Reviewed-by: Chuck Lever Link: https://patch.msgid.link/20261111185522.2859004-2-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 4692b717db80970a09eb1d61b17a001739a6afc6 Author: Iustin Stolniceanu Date: Wed Nov 11 12:00:53 2026 +0200 net: phy: c45: select BASE-T1 type for the forced speed [ Upstream commit df501db9b18fae4d3edd534b992675f4673a938e ] Commit 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced setup") made genphy_c45_pma_setup_forced() write the type selection field (bits 3:0) of the BASE-T1 PMA/PMD control register (1.2100) on every forced setup: 1000BASE-T1 for SPEED_1000, and 0 for everything else. 0 selects 100BASE-T1, so forcing a 10BASE-T1L PHY to 10 Mbit/s now also switches its PMA to 100BASE-T1, a mode it does not implement. Seen on an ADIN1110 (internal ADIN1100 PHY): after ethtool -s ethX autoneg off speed 10 master-slave forced-master 1.2100 reads 0xc000 instead of the 0xc002. Since the field is not restored by re-enabling autoneg, the PHY keeps the wrong type until the next forced setup or reset. Add a helper that returns the type selection value for the forced speed and the supported link modes: 100BASE-T1, 1000BASE-T1, and 10BASE-T1L or 10BASE-T1S for SPEED_10 depending on the supported 10 Mbit/s modes. Fail with -EINVAL when no type matches instead of writing 100BASE-T1. This also applies to forced 2.5G, 5G and 10G on BASE-T1 capable PHYs, for which there are no link modes yet. The field is called "type selection" in IEEE 802.3-2022 (45.2.1.214, Table 45-178). Keep the old STRAP names as aliases. Tested on EVAL-ADIN1110EBZ: with this change, forcing 10 Mbit/s writes 1.2100 = 0xc002 (10BASE-T1L) instead of the invalid 0xc000. Fixes: 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced setup") Signed-off-by: Iustin Stolniceanu Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20261111100053.345196-1-iustin.stolniceanu@analog.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 22520259b896bb72c1eefe7b3097dda3b91b21ca Author: Alexei Lazar Date: Wed Nov 11 10:21:42 2026 +0200 net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure [ Upstream commit 3962ded998c1df8a449fdf986f44f478e9c09675 ] mlx5e_attach_netdev() sets rx_mode_active before calling init_rx(), so any init_rx() failure after mlx5e_create_flow_steering() has succeeded makes mlx5e_destroy_flow_steering() trip WARN_ON_ONCE(fs->rx_mode_active) in mlx5e_del_vlan_rules(). Hit in internal regression testing, so kthread creation failed with -EINTR: WARNING: CPU: 3 PID: 170 at drivers/net/ethernet/mellanox/mlx5/core/en_fs.c:564 mlx5e_del_vlan_rules+0x295/0x2b0 [mlx5_core] mlx5e_destroy_flow_steering+0x34/0xc0 [mlx5_core] mlx5e_init_nic_rx+0x137/0x200 [mlx5_core] mlx5e_attach_netdev+0x105/0x360 [mlx5_core] Fix it by creating NIC flow steering with rx_mode_active cleared and setting it only after profile->init_rx() succeeds. This also lets the internal error paths of mlx5e_create_flow_steering() destroy partially created steering without warning. The flag is set in mlx5e_attach_netdev() rather than mlx5e_init_nic_rx() so that non-NIC profiles, such as representors, also get it set after a detach/attach cycle. Fixes: 8c7353b6f716 ("net/mlx5e: Fix VLAN cleanup flow") Signed-off-by: Alexei Lazar Signed-off-by: Gal Pressman Reviewed-by: Shahar Shitrit Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261111082142.3131746-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 31fb6f6140dd6e95e1dc057412018b9731325bf6 Author: Alexei Lazar Date: Sun Oct 11 12:31:00 2026 +0300 net/mlx5e: Rename state_destroy to rx_mode_active in flow steering [ Upstream commit cdcb648a97ebc247eea3a9a7d15916613f640527 ] This flag controls the enablement of RX mode handling (promisc, allmulti, broadcast, netdev addr sync). It acts as a safeguard that prevents new FS (flow steering) operations during device teardown. When the device is in destroying state it is set to false to indicate RX mode operations are not allowed. Its name is misleading, as it suggests a destroy-state flag rather than RX mode activity. Rename it for clarity. No functional change. Signed-off-by: Alexei Lazar Reviewed-by: Shahar Shitrit Signed-off-by: Tariq Toukan Reviewed-by: Joe Damato Link: https://patch.msgid.link/20261011093100.769149-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Stable-dep-of: 3962ded998c1 ("net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure") Signed-off-by: Sasha Levin commit 4460b0649112b59c320b790eb2d00343c99b29a0 Author: Cosmin Ratiu Date: Wed Nov 11 10:13:37 2026 +0200 net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX [ Upstream commit 5ed47bd79cebee8429d06c6640aac7ac7c4805ca ] The mentioned commit introduced support for upper protocol selectors (protocol & ports) to mlx5 IPsec offload. In crypto offload mode this causes offloaded TX SAs to stop matching traffic. In tx_add_rule(), setup_fte_upper_proto_match() is called for all offload types and programs a match on the upper protocol (TCP/UDP) and ports. For crypto offload, setup_fte_esp() is then called and sets ip_protocol to ESP. The resulting rule requires both ESP as the IP protocol and TCP/UDP ports, which no packet can satisfy, so TX crypto offload silently stops working for such SAs. In crypto offload mode the stack builds the ESP packet and the HW only encrypts it, so the SA rule should only match on the SPI. Move the setup_fte_upper_proto_match() call under the XFRM_DEV_OFFLOAD_PACKET case, where the rule matches the plaintext packet and upper protocol selectors apply. The other three callers are unaffected: rx_add_rule_sa_selector() is already only invoked for packet offload, and tx_add_policy() / rx_add_policy() are only reachable in packet offload mode, since xfrm policy offload is exclusively of type XFRM_DEV_OFFLOAD_PACKET. Fixes: a7385187a386 ("net/mlx5e: IPsec, support upper protocol selector field offload") Signed-off-by: Cosmin Ratiu Reviewed-by: Leon Romanovsky Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261111081337.3129580-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ea4a70ff13b0f53e674807fc24cafe3ec5d868e1 Author: Jiahao Xu Date: Wed Nov 11 12:41:56 2026 +0800 net: usb: cdc_ncm: don't underflow the NDP room check [ Upstream commit b507828c7b6135ff7a4b69eba6e33502b4839fb9 ] cdc_ncm_ndp16() and cdc_ncm_ndp32() verify that the new NDP and the datagram fit into the NTB with an unsigned subtraction: if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size) return NULL; Nothing guarantees that skb->len plus the reserve stays below tx_curr_size, and when it does not the subtraction wraps around to a huge value, the check passes, and the skb_put_zero() of max_ndp_size bytes that follows overruns the NTB: skbuff: skb_over_panic: text:ffff80000db33558 len:428 put:172 head:ffff0000c2c66100 tail:0x1ac end:0x140 kernel BUG at net/core/skbuff.c:200 skb_put_zero include/linux/skbuff.h:2595 [inline] cdc_ncm_ndp16 drivers/net/usb/cdc_ncm.c:1132 [inline] cdc_ncm_fill_tx_frame+0xdf0/0x30e0 drivers/net/usb/cdc_ncm.c:1309 Here tx_curr_size is 0x140 = 320, skb->len is already 256 and the skb_put_zero() wants another 172 bytes. Two device controlled settings make this reachable: - dwNtbOutMaxSize = 320 caps tx_max at 320. The lower bound computed in cdc_ncm_check_tx_max() is max_datagram_size + max_ndp_size + the NTH header, but cdc_ncm_setup() clamps tx_max before cdc_ncm_set_dgram_size() runs, so max_datagram_size is still 0 and the bound is only max_ndp_size + the NTH header. It does not reserve room for one datagram plus one NDP. - wNdpOutAlignment = 256 is accepted by cdc_ncm_fix_modulus() as long as it is smaller than tx_max, and cdc_ncm_align_tail() then pads the 12 byte NTH header up to 256 bytes right before this check. An NDP can also be added to an NTB that already holds datagrams through cdc_mbim_tx_fixup(), which uses a different signature per MBIM session. On plain cdc_ncm the chain lookup in cdc_ncm_ndp16() returns the existing NDP for the single signature, so there the create path is normally reached for the first datagram of each NTB. Rewrite the test as an addition, which cannot underflow and gives the same answer whenever the original subtraction did not wrap. Fixes: c78b7c586657 ("net: cdc_ncm: refactoring for tx multiplexing") Fixes: 0fa81b304a79 ("cdc_ncm: Implement the 32-bit version of NCM Transfer Block") Reported-by: syzbot+1994e2ecf323ed90f255@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1994e2ecf323ed90f255 Signed-off-by: Jiahao Xu Link: https://patch.msgid.link/20261111124156.637661-1-xujiahao@cmss.chinamobile.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 51084b31673222db871506211ab386c1acd12cfb Author: Wenbo Sun Date: Wed Nov 11 11:11:47 2026 +0800 amt: use ipv6_hdr() in amt_mldv1_leave_handler() [ Upstream commit 6730fe495c35f174a424ab58cf5fdf99ce4746e9 ] In amt_mldv1_leave_handler(), which handles IPv6 MLDv1 Done (ICMPV6_MGM_REDUCTION) messages, the source address is mistakenly extracted via ip_hdr(skb)->saddr into host.ip4 instead of copying the IPv6 source address from ipv6_hdr(skb)->saddr into host.ip6 as amt_mldv1_report_handler() does. Because amt_lookup_group() compares the full union amt_addr for v6 groups, looking up the group with a 32-bit IPv4 header slice fails to match the group entry created by amt_mldv1_report_handler(). As a result, amt_del_group() is not called when an MLDv1 listener leaves, and the AMT relay continues forwarding multicast traffic until the group timer expires. Use ipv6_hdr(skb) and copy ip6h->saddr into host.ip6 so that MLDv1 Done messages properly match and delete the corresponding IPv6 group. This issue was found via LLM-assisted code review, confirmed by reproducing the stale group forwarding in a User-Mode Linux (ARCH=um) environment, and verified in UML by testing that AMT relay multicast forwarding stops immediately after receiving an MLDv1 Done message. Fixes: b75f7095d4d4 ("amt: add mld report message handler") Signed-off-by: Wenbo Sun Link: https://patch.msgid.link/20261111031147.105834-1-sunwenbo@cmss.chinamobile.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0dd3de45f0a4a2f00320f0602b4360c2fa34e153 Author: Wenbo Sun Date: Wed Nov 11 10:32:22 2026 +0800 af_unix: Inherit SO_INQ in unix_stream_connect() [ Upstream commit 0359338fd8cf1a2dc001d0cd69c331c17decee88 ] When SO_INQ is enabled on a listening AF_UNIX SOCK_STREAM socket, accepted sockets created by unix_stream_connect() do not inherit u->recvmsg_inq from the listener, unlike TCP_INQ, AF_VSOCK SO_INQ, and AF_UNIX SO_RIGHTS_NOTRUNC. As a result, recvmsg() on the accepted socket never puts an SCM_INQ control message unless SO_INQ is set again after accept(). Copy otheru->recvmsg_inq to newu->recvmsg_inq in unix_stream_connect() using READ_ONCE() to pair with the lockless WRITE_ONCE() in unix_setsockopt(). Found during LLM-assisted code review of unix_stream_connect() while comparing option inheritance between SO_INQ and SO_RIGHTS_NOTRUNC. Confirmed on UML (x86_64) by enabling SO_INQ on a listening AF_UNIX SOCK_STREAM socket before listen() and accept(), sending data from a connected client, and observing that recvmsg() on the accepted socket returned no SCM_INQ control message. Tested on UML (x86_64) against the reproducer, verifying that recvmsg() on the accepted socket now returns the expected SCM_INQ control message, and ran the tools/testing/selftests/net/af_unix/scm_inq selftest (all 6 test cases passed). Fixes: df30285b3670 ("af_unix: Introduce SO_INQ.") Signed-off-by: Wenbo Sun Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261111023222.77227-1-sunwenbo@cmss.chinamobile.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 5ec3654c9192e5f5f568e9dea2bb050f0ca284a9 Author: Kuniyuki Iwashima Date: Wed Nov 11 02:03:00 2026 +0000 tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req(). [ Upstream commit a9782a6f2bbd0c444689725a710d8b21eab61bc5 ] When connection migration happens in tcp_v[46]_rcv(), a new listener is passed to tcp_check_req(). When either of the following is true, * the new listener queue is full and net.ipv4.tcp_abort_on_overflow is set * the packet has RST or (not stripped) SYN tcp_check_req() sends RST and calls inet_csk_reqsk_queue_drop(). Here, the new listener is passed, and its qlen is decremented wrongly while reqsk is tied to the old listener. Once qlen underflows, inet_csk_reqsk_queue_is_full() always return true, and the new listener stops serving. Without the patch, this script times out while waiting for SYN+ACK since the new listener drops SYN, but with the patch, 3WHS completes. 0 `sysctl -q net.ipv4.tcp_migrate_req=1` +0 `sysctl -q net.ipv4.tcp_syncookies=0` +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4 +0 setsockopt(4, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0 +0 bind(4, ..., ...) = 0 +0 listen(4, 128) = 0 +0 < S 0:0(0) win 32792 +0 > S. 0:0(0) ack 1 <...> +0 listen(3, 128) = 0 +0 close(4) = 0 +.01 < R 1:1(0) win 0 +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 5 +0 listen(5, 1) = 0 +.01 < S 0:0(0) win 32792 +0 > S. 0:0(0) ack 1 <...> +0 < . 1:1(0) ack 1 win 32792 +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 +0 accept(3, ..., ...) = 6 Let's pass req->rsk_listener instead. Fixes: d4f2c86b2b7e ("tcp: Migrate TCP_NEW_SYN_RECV requests at receiving the final ACK.") Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261111020304.1532064-2-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 658f1172a70ee6066281e7cf913f48a6c118a239 Author: Eric Dumazet Date: Tue Nov 10 22:36:26 2026 +0100 net: virtio: fix UDP tunnel GSO header of VLAN tagged packets [ Upstream commit 9e244f94128a4b89004f0564b66e039e58318a34 ] virtio_net_hdr_tnl_from_skb() builds a wrong header for VLAN tagged UDP tunnel GSO packets. 1) When the skb carries a hwaccel VLAN tag, tun_put_user() inserts the 802.1Q header in the frame it copies to user space or vhost-net, and passes vlan_hlen = VLAN_HLEN. virtio_net_hdr_from_skb() adds vlan_hlen to csum_start, but inner_nh_offset and outer_th_offset do not account for it, and are 4 bytes short of the real inner L3 and outer UDP headers in the emitted frame. tun advertises NETIF_F_HW_VLAN_CTAG_TX and NETIF_F_HW_VLAN_STAG_TX in hw_enc_features, and its vlan_features keep the UDP tunnel GSO features, so this happens for example with a VLAN filtering bridge with a tagged port, or with a vlan device on top of a tap. 2) The outer family comes from skb->protocol, which is ETH_P_8021Q or ETH_P_8021AD when the VLAN tag is in the packet data, so a packet with an outer IPv6 header is reported as VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4. This happens when __vlan_hwaccel_push_inside() inserted the tag because the device does not offload it: virtio_net never offloads VLAN insertion but keeps UDP tunnel GSO in its vlan_features, and tun does the same with VLAN TX offload disabled, or with QinQ (outer tag offloaded, inner tag in the data). The receiver sets inner_network_header and transport_header from these offsets, and checks them with the wrong outer family. A forwarded packet that gets segmented again uses the wrong inner headers, and a receiver checking the outer headers against the virtio header drops the packet. Add vlan_hlen to both offsets like csum_start, and take the outer family from vlan_get_protocol(), which skips VLAN tags in the data. Fixes: a2fb4bc4e2a6 ("net: implement virtio helpers to handle UDP GSO tunneling.") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179421814766.994134.3669228181251158303@kernel.org/ Closes: https://lore.kernel.org/netdev/179433950084.994134.15100186606737698605@kernel.org/ Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261110213628.3476051-2-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 1bd5c3faf594edd17b19bc634ca691abfe1ba739 Author: Uri Dar Date: Tue Nov 10 13:43:50 2026 +0200 net/mlx5: Lag, Return error when enabling MPESW without LAG support [ Upstream commit a532a7049ba23edeb2e16f7bb5929314f2e47ca0 ] When firmware reports a function as not LAG capable (lag_master=0 or num_lag_ports < 2), mlx5_lag_add_mdev() creates no LAG object for it. Enabling multiport E-Switch on such a device returns 0 from mlx5_lag_mpesw_queue_work(), so "devlink dev param set ... esw_multiport value true" reports success although nothing was enabled, and a following "devlink dev param show" still reports false. Return -EOPNOTSUPP instead. mlx5_lag_mpesw_disable() ignores the return value, so disabling keeps its current behavior. Fixes: a32327a3a02c ("net/mlx5: Lag, Control MultiPort E-Switch single FDB mode") Signed-off-by: Uri Dar Reviewed-by: Shay Drori Signed-off-by: Tariq Toukan Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261110114350.2639891-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit dbec64c3aac399e4c39a165007a423c7489311f3 Author: Antonio Quartulli Date: Tue Nov 10 12:33:06 2026 +0100 udp_tunnel: don't treat IPv4 sockets bound to an address as wildcard [ Upstream commit 612b8376e8112a6f9caaedc25fa48ac42e02826d ] With IPv6 enabled, sk_saddr_any() checks sk_v6_rcv_saddr also for AF_INET sockets, where it is always zero. An IPv4 tunnel socket bound to a specific address (e.g. fou or geneve with "local") ends up in the GRO lookup fast path, although another socket may bind the same port on a different address: GRO then hands that socket's packets to the tunnel's gro_receive. Check the IPv6 address only for AF_INET6 sockets. Fixes: a36283e2b683 ("udp_tunnel: create a fastpath GRO lookup.") Signed-off-by: Antonio Quartulli Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261110113306.3698438-1-antonio@mandelbit.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 968d316185ea83598cdff7bf7c6d3b9a90e1d508 Author: Xuanqiang Luo Date: Tue Nov 10 12:17:09 2026 +0200 net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload [ Upstream commit 343672bad64153e895d201ff6d3dfaf15c22682e ] Since commit abed42f9cd80 ("net/mlx5e: Conditionally create async ICOSQ"), the async ICOSQ is only created when an XDP program is attached or priv->ktls_rx_was_enabled is set. When TLS RX offload is enabled for the first time, mlx5e_ktls_set_feature_rx() sets the flag and reopens the channels so that they get the queue, but it ignores the return value of mlx5e_safe_reopen_channels(). If the reopen fails, mlx5e_safe_switch_params() keeps the old channels, which have no async ICOSQ, while NETIF_F_HW_TLS_RX is still reported as enabled. The next offloaded RX connection then dereferences the NULL c->async_icosq in post_rx_param_wqes(). Enabling the feature again does not help, as the flag is already set and the reopen is skipped. Propagate the error, clear the flag and destroy the accel TCP flow tables again, so that the feature stays disabled and the next attempt retries the reopen. Fixes: abed42f9cd80 ("net/mlx5e: Conditionally create async ICOSQ") Signed-off-by: Xuanqiang Luo Reviewed-by: Simon Horman Reviewed-by: Saeed Mahameed Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261110101709.2589088-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6e0da5035c4c9b9cbb46e0bce6b8e731c5656a84 Author: Ivan Vecera Date: Tue Nov 10 10:43:50 2026 +0100 ice: dpll: set the SyncE divider only for the port driving the output [ Upstream commit 164721e16b822c3b2f19526ff00deaa7b47fbf46 ] R10 holds one divider for each recovered clock output, shared by all ports. ice_ptp_link_change() sets it from the link speed of its own port even when another port drives the output, and checks the mux only to decide whether an error is worth reporting. With ports running at different speeds, a link change on one port leaves the output of another port with a wrong divider. Skip the outputs that the port does not drive, and check the mux under cgu_synce_lock, so that another PF cannot select its port in between. The check computes the mux value as port % ports_per_phy + 3, while ice_tspll_cfg_bypass_mux_e825c() and ice_dpll_rclk_update_e825c() use port + 3. With the skip, a port from ports_per_phy up would never update the divider, so use port + 3 as they do. Tested on GNR-D with dual complex E825. With the RCLK pin of one port connected, five down and up cycles of another port of the same complex called ice_tspll_cfg_synce_ethdiv_e825c() 20 times without this patch and never with it. Five cycles of the port driving the output still called it 10 times. Both ports ran at 25 Gb/s, so the divider value did not change on this setup. Fixes: ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery") Signed-off-by: Ivan Vecera Reviewed-by: Petr Oros Link: https://patch.msgid.link/20261110094350.184185-3-ivecera@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 5eefc6afa7d442fa5bdc37f88f61a65729bb430b Author: Ivan Vecera Date: Tue Nov 10 10:43:49 2026 +0100 ice: dpll: serialize changes of the SyncE CGU registers [ Upstream commit 0afbc079d87eb2ba86b396bb1be145ad679ec300 ] All E825C PFs share the CGU registers R10 and R11. On dual complex E825 the second complex reaches the CGU of complex 0 through cgu_peer. RCLK pin callbacks read, modify and write these registers under dpll_lock and the pf->dplls.lock of their PF. ice_ptp_link_change() rewrites R10 under the pf->dplls.lock of its PF only, so a link change on one PF can write back a stale R10 and undo an RCLK pin change made by another PF. Add a mutex to struct ice_adapter, which all E825C PFs share, and hold it around these sequences. Tested on GNR-D with dual complex E825, with a 2 to 4 ms delay after the read of R10 in the link change path to widen the window. Toggling the RCLK pin of one port while another port of the same complex went down and up 143 times lost 120 of 86814 updates of the mux in R10 without this patch, and none of 76992 with it. Fixes: ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery") Signed-off-by: Ivan Vecera Reviewed-by: Petr Oros Link: https://patch.msgid.link/20261110094350.184185-2-ivecera@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 5a55ec80c7696d694c49f3e189293bee6e8a0395 Author: Tao Cui Date: Thu Nov 12 21:09:29 2026 +0800 sched_ext: Reject DSQ iterator kfuncs in tracing programs [ Upstream commit 700a332c3fe33014bbd5ae852d71ba679fc29e0a ] bpf_iter_scx_dsq_next() and bpf_iter_scx_dsq_destroy() take the target user DSQ's raw spinlock, but they are in scx_kfunc_ids_any, which is also registered for BPF_PROG_TYPE_TRACING. For an active root scheduler without ops.sub_attach, the compatibility path in scx_prog_sched() lets an unassociated tracing program resolve to that scheduler. The tracing program can then call the iterator kfuncs while the target DSQ lock is already held. For example, a scheduler which mixes FIFO and priority-queue insertions into a user DSQ triggers scx_error() from scx_dispatch_enqueue() while holding that DSQ's lock. scx_claim_exit() emits sched_ext_exit before the lock is released: scx_dispatch_enqueue() raw_spin_lock(&dsq->lock) scx_error() scx_claim_exit() trace_sched_ext_exit() tracing BPF program bpf_iter_scx_dsq_new(dsq_id) bpf_for_each(scx_dsq, p, dsq_id, 0) bpf_iter_scx_dsq_next(it) raw_spin_lock_irqsave(&dsq->lock) The tracing program recursively acquires the same raw spinlock and locks up the CPU. Because the tracepoint runs before scx_finish_exit(), disable_irq_work is not queued and the scheduler cannot enter its normal disable path. Reject the two iterator kfuncs from tracing programs at verification time. The kfuncs remain available to SCX struct_ops and syscall programs. bpf_iter_scx_dsq_destroy() has no independent live reproduction: its cursor only links into the DSQ after at least one successful next(), which deadlocks in the same window first. It is included for symmetry. This extends the coverage of commit b07a7450f6ef ("sched_ext: Reject rq-lock-taking kfuncs in tracing programs") and commit 4c2e0751d5e6 ("sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs"). Fixes: 650ba21b131e ("sched_ext: Implement DSQ iterator") Signed-off-by: Tao Cui Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 604ff09cdf0c21abbbc9546cf92578d541395651 Author: Wei Wang Date: Fri Nov 6 18:20:06 2026 +0000 net: Make PSP skb extension survive packet scrubbing [ Upstream commit b22268fc3ddc1e634daf177e53b04e96fa58c330 ] skb_scrub_packet() drops all skb extensions unconditionally via skb_ext_reset(). It runs on tunnel encap/decap (ip_tunnel_rcv, vxlan_rcv, etc.) and virtual device forwarding/redirection (dev_forward_skb, netkit_xmit, skb_do_redirect). When a virtual device such as netkit is associated with a PSP device in another network namespace via PSP_CMD_DEV_ASSOC, incoming PSP packets decapsulated by psp_dev_rcv() lose their SKB_EXT_PSP extension when scrubbed during redirection into the peer netns. Without SKB_EXT_PSP, __psp_sk_rx_policy_check() rejects incoming TCP data segments at the socket layer with SKB_DROP_REASON_PSP_INPUT. Introduce a static skb_ext_scrub() helper in net/core/skbuff.c to preserve SKB_EXT_PSP across skb_scrub_packet() while dropping all other extensions. If SKB_EXT_PSP is not active, skb_ext_scrub() simply calls skb_ext_reset(). If SKB_EXT_PSP is the only extension in the skb_ext buffer, nothing needs to be scrubbed. Otherwise, save the PSP metadata, reset the extension block, and re-add a fresh SKB_EXT_PSP extension. Fixes: 06c2dce2d0f6 ("psp: add new netlink cmd for dev-assoc and dev-disassoc") Link: https://lore.kernel.org/r/20260910-bpf-meta-inside-skb-ext-v2-3-0b21e42180b0@cloudflare.com Reported-by: Daniel Zahka Closes: https://lore.kernel.org/netdev/DLODSKPY6ON6.1G6SP3CFFLCPJ@gmail.com/ Co-developed-by: Jakub Sitnicki Signed-off-by: Jakub Sitnicki Signed-off-by: Wei Wang Reviewed-by: Daniel Zahka Link: https://patch.msgid.link/20261106182007.374660-2-weiwan@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit da4a7cdfdcc9aae0ace97178a8a7993bdac99ee5 Author: Junyoung Jang Date: Mon Nov 9 21:53:11 2026 +0900 igmp: use the joined device when leaving a multicast group [ Upstream commit 19ec8416a76c08326fe5f814410a1b43046e63be ] When a socket joins a multicast group, the ifindex of the device is stored in the socket's membership entry. When leaving, ip_mc_leave_group() resolves the device again from the request. If the request only specifies an interface address and that address is not assigned to any device, no device is found. The membership is still matched by address and removed from the socket, but the group is not released on the device it was joined on. The group is then leaked on the device until the device is unregistered. An unprivileged user can trigger this by joining with an ifindex and a non-local address and leaving with the address only. It can also happen when a socket joins and leaves with the address only and the address is removed in between. Fix by resolving the device from the ifindex stored in the membership, like ip_mc_drop_socket() does. Fixes: 4eba7bb1d72d ("ipv4: igmp: Allow removing groups from a removed interface") Signed-off-by: Junyoung Jang Reviewed-by: Hangbin Liu Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261109125312.2208874-1-graypanda.inzag@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 32c14287bceef6e14c3c4d441ee4ee4d611ad1e6 Author: Fa-Iz Faadhillah Ibrahim Date: Thu Nov 12 00:21:08 2026 +0700 ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72 [ Upstream commit a2dac609bfcc395a8c2e87d3ba1fc26ac50811d0 ] The Acer Predator PHN16-72 (1025:1731) uses the ALC245 codec, but its mic-mute LED is not enabled by default. Replace the existing quirk with ALC245_FIXUP_ACER_MICMUTE_LED quirk to enable the mic-mute LED chain the existing ALC2XX_FIXUP_HEADSET_MIC quirk. Fixes: 34e08ad3a8da ("ALSA: hda/realtek: Add quirk for Acer Predator PHN16-72") Signed-off-by: Fa-Iz Faadhillah Ibrahim Link: https://patch.msgid.link/20261111172108.30011-1-faiz.faadhillah@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 6bf0b9b4321684a75866c7ee2b3ac6579c2909f9 Author: Kailang Yang Date: Thu Nov 12 15:32:16 2026 +0800 ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255 [ Upstream commit 1da5e525f0526a0b8e3b6c8c3208e6fad920f126 ] This unit don't support headphone MIC. The popping sound will disappear when you remove it. Fixes: 97272a5704bf ("ALSA: hda/realtek - Fixed Headphone noise issue for Dell QCM1255") Signed-off-by: Kailang Yang Link: https://lore.kernel.org/3c8129fbfa6d4ee2b464735f2f31dffa@realtek.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit d2f0a3889affaa2ea89478f1a520a5754701f6bb Author: Gustavo Sousa Date: Thu Nov 5 20:31:49 2026 -0300 drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule [ Upstream commit 557c7b4343781cae9725bf26122d29c26ea12f5d ] Wa_16023105232 was extended in xe_wa_oob.rules to match extra IP releases while the respective entry in xe_was[] was overlooked. Update the latter to be in sync with the former. Also add comments in the code so that we don't forget to update both places if new IP versions are added. Fixes: c96e0df4e9f5 ("drm/xe/xe3: Add support for media IP version 30.02") Fixes: 4fde66699f1c ("drm/xe/xe3: Add support for graphics IP versions 30.04 & 30.05") Cc: Dnyaneshwar Bhadane Cc: Matt Roper Cc: Shekhar Chauhan Reviewed-by: Matt Atwood Link: https://patch.msgid.link/20261105-wa_16031259911-v3-2-da6ec790aa29@intel.com Signed-off-by: Gustavo Sousa (cherry picked from commit 0cfb54f8f4d69efc847641738d25065049160aca) Signed-off-by: Matthew Brost Signed-off-by: Sasha Levin commit 7da66b0a1516d27a95533027ad6b765a55773ce5 Author: Satyanarayana K V P Date: Thu Nov 5 11:49:25 2026 +0000 drm/xe/pf: Program LMTT directory pointer from each GT's init path [ Upstream commit 3654a4d734df960d303d2494037606c72525c0a3 ] The LMTT directory pointer is configured on every GT of the tile only from the primary GT's init/reset flow. On new platforms, both primary and media GTs have their own forcewake. Primary GT's init holds only its own forcewake, so the media GT write can be lost. Program the LMTT directory pointer from each GT's own init and restart path, while that GT's forcewake is held. Also use MCR registers for primary GT and unicast registers for media GT. Fixes: ad69d62588cd ("drm/xe/pf: Program LMTT directory pointer on all GTs within a tile") Signed-off-by: Satyanarayana K V P Cc: Piotr Piórkowski Cc: Michał Winiarski Cc: Stuart Summers Cc: Matt Roper Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patch.msgid.link/20261105114923.880265-4-satyanarayana.k.v.p@intel.com (cherry picked from commit a8653bee6a0404e9962e80894eae0afab355cbd3) Signed-off-by: Matthew Brost Signed-off-by: Sasha Levin commit 4e5090a0c857d0569a7adfc96bb2e1012f34ea27 Author: Varun Gupta Date: Fri Nov 6 09:18:05 2026 +0530 drm/xe/guc: Demote uncorrectable local error log on CRI [ Upstream commit f831b84713b57cbd67f228a7f10147791e5ab13d ] The UNCORRECTABLE_LOCAL_ERROR notification sent by the GuC indicates a local, queue-level context termination rather than a global device or driver failure. On CRI, due to a hardware limitation, the platform cannot distinguish GT translation faults from true RAS conditions, meaning standard workloads routinely trigger this error. Printing this at ERROR level is too noisy and causes false-positive dmesg-warn failures in CI. Demote the log level to debug for CRI. v5: - Correct commmit message and comment (Tejas) v4: - Change to _dbg instead of _info. (Matt) v3: - Limit the demotion to CRI and add comment explaining the HW limitation (Rodrigo) v2: - Also ratelimit the GUC_ID_UNKNOWN to match the CAT error handler. (Himal) Fixes: 4e57574fa3a3 ("drm/xe/guc: Handle GuC local uncorrectable error notifications") Reviewed-by: Tejas Upadhyay Reviewed-by: Matt Roper Signed-off-by: Varun Gupta Link: https://patch.msgid.link/20261106034804.2005214-2-varun.gupta@intel.com Signed-off-by: Tejas Upadhyay (cherry picked from commit e305536554790e06876dd4e4f854c97d1353aa79) Signed-off-by: Matthew Brost Signed-off-by: Sasha Levin commit 624f9338c7580954844cc9c10dbe774006243c87 Author: Daniel Charles Date: Mon Nov 2 18:14:17 2026 -0800 drm/xe/pm: Apply tile workarounds after PCODE initialization [ Upstream commit a17c5ed0dc715d2e39d00e33372cb094209ac8ef ] Tile workarounds program SoC registers through MMIO. Wait for PCODE initialization to complete before applying them during system resume, since MMIO access may be blocked until SoC initialization completes. Also apply tile workarounds after PCODE initialization on D3cold runtime resume, so their register settings are restored after power loss. Keep both paths ordered before early GT resume. Fixes: 0d0534750f9d ("drm/xe/wa: Apply tile workarounds at probe/resume") Signed-off-by: Daniel Charles Reviewed-by: Matt Roper Link: https://patch.msgid.link/20261103021418.654723-2-daniel.charles@intel.com Signed-off-by: Matt Roper (cherry picked from commit 641ffb2132839242e49a158d2aea579a75fa2e8e) Signed-off-by: Matthew Brost Signed-off-by: Sasha Levin commit f534116da01c1dac9a5484df439b6ffabb02ae90 Author: Alexandre Cassen Date: Tue Nov 10 18:34:35 2026 +0100 net/mlx5: HWS, fix flow meter release on FTE update [ Upstream commit 145480b28ca82e9fae789427cc4569e596515a32 ] HWS has no duplicate match. When a flower filter is replaced in place, its new rule waits as the pending duplicate of the old FTE. Once the old rule goes, switch_to_pending_act_dests() copies the pending actions over the FTE before update_fte() releases the actions of the old rule. An HWS rule reads the base id of its meter action through a pointer to the exe_aso of the FTE. That release takes the meter action of the new rule instead. When the two meters sit in different ASO objects, the old meter action leaks. It keeps its ASO object referenced. The firmware then fails to destroy that object and to free the PD of the meters, and its STC is still in the pool when the context closes. The new meter action is destroyed one release early, while a rule still points to it, and the last release underflows its refcount: mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2641): DESTROY_GENERAL_OBJECT(0xa03) op_mod(0x24) failed, status bad resource(0x5), syndrome (0xeeda5c), err(-22) refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:96 at refcount_dec_not_one+0x3f/0x60, CPU#43: tc/2641 Call Trace: mlx5_fs_put_hws_action.part.0+0x1a/0xa0 [mlx5_core] mlx5_fs_destroy_fs_actions+0xa8/0x110 [mlx5_core] mlx5_cmd_hws_delete_fte+0x49/0x90 [mlx5_core] del_hw_fte+0x209/0x320 [mlx5_core] mlx5_del_flow_rules+0x10b/0x260 [mlx5_core] __mlx5_eswitch_del_rule+0x5c/0x1b0 [mlx5_core] mlx5_eswitch_del_offloaded_rule+0x10/0x20 [mlx5_core] mlx5e_tc_rule_unoffload+0x4b/0x100 [mlx5_core] mlx5e_tc_unoffload_fdb_rules+0x35/0x80 [mlx5_core] mlx5e_tc_del_fdb_flow+0x2ca/0x310 [mlx5_core] mlx5e_tc_del_flow+0x5d/0x2d0 [mlx5_core] mlx5e_flow_put+0x3a/0x80 [mlx5_core] mlx5e_delete_flower+0x291/0x460 [mlx5_core] mlx5e_setup_tc_block_cb+0xc4/0x110 [mlx5_core] tc_setup_cb_destroy+0xcc/0x1b0 fl_hw_destroy_filter+0xa1/0xe0 [cls_flower] __fl_delete+0x2d0/0x3d0 [cls_flower] fl_destroy+0xbd/0x160 [cls_flower] tcf_proto_destroy+0x3b/0x110 tcf_proto_put+0x3d/0x70 tc_del_tfilter+0x362/0x8f0 rtnetlink_rcv_msg+0x384/0x460 netlink_rcv_skb+0x61/0x120 rtnetlink_rcv+0x15/0x30 netlink_unicast+0x2a1/0x3d0 netlink_sendmsg+0x237/0x490 ____sys_sendmsg+0x33b/0x360 ___sys_sendmsg+0x99/0xf0 __sys_sendmsg+0x93/0x100 __x64_sys_sendmsg+0x1d/0x30 x64_sys_call+0x821/0x23d0 do_syscall_64+0xba/0x550 entry_SYSCALL_64_after_hwframe+0x76/0x7e mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2642): DEALLOC_PD(0x801) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0xef0c8a), err(-22) mlx5_core 0000:b1:00.1: mlx5hws_pool_destroy:386:(pid 2642): Attempting to destroy non-empty pool Keep the base id in the rule action, as the sampler id is. Discovered while stress testing a 5G UPF kernel code. Without this fix, the reproduction below gives the trace above on a ConnectX-7 with firmware 28.48.1000. It only uses tc and devlink, with no kernel change. 129 meters cannot fit in one ASO object. DEV is the uplink representor and PCI its devlink handle: r() { echo "filter $1 dev $DEV ingress prio 1 handle $2 protocol ip flower skip_sw dst_ip 10.0.0.$2 action police index $3 rate 1mbit burst 32k conform-exceed drop/pipe action drop"; } devlink dev param set $PCI name flow_steering_mode value hmfs cmode runtime devlink dev eswitch set $PCI mode switchdev tc qdisc add dev $DEV ingress for i in $(seq 129); do r add $i $i; done | tc -b - r replace 1 1000 | tc -b - tc filter del dev $DEV ingress prio 1 devlink dev eswitch set $PCI mode legacy With this fix, the reproduction runs clean on the same ConnectX-7. It was not tested against kernel selftests. Fixes: 82d3639ef7dc ("net/mlx5: fs, add support for flow meters HWS action") Signed-off-by: Alexandre Cassen Reviewed-by: Mark Bloch Link: https://patch.msgid.link/20261110173437.2471233-1-acassen@corp.free.fr Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ec18e53bb4f81eccdaa81744ddbb71b90bc0deb4 Author: Ofri Zangi Date: Sun Nov 8 21:12:57 2026 +0200 tls: fix async encryption race on weakly ordered architectures [ Upstream commit a2fd526d644233d6a892c28173f07c61e21e4c93 ] With async encryption, a record can be transmitted without its TLS header on weakly ordered architectures such as arm64, because the consumer may observe rec->tx_ready set while still seeing the old scatterlist entry. tls_encrypt_done() restores the TLS header in the scatterlist entry (sge->offset -= prot->prepend_size, sge->length += prot->prepend_size) and then publishes the record with smp_store_mb(rec->tx_ready, true). On another CPU, tls_tx_records() checks rec->tx_ready with READ_ONCE() and then reads the entry in tls_push_sg(). Nothing orders these accesses. The barrier in smp_store_mb() comes after the tx_ready store, so it does not order the earlier scatterlist update before it. On the reader side, READ_ONCE() does not order the later loads of sge->offset and sge->length. The reader can therefore see tx_ready set together with the old offset and length, and pushes the record without its header. Publish tx_ready with smp_store_release() in tls_encrypt_done() and read it with smp_load_acquire() in tls_tx_records(), so that observing tx_ready guarantees the restored scatterlist entry is visible. Keep the full barrier that smp_store_mb() provided as an explicit smp_mb(), as it is still needed to order the tx_ready store before the tx_list head check. The issue was discovered during development on an arm64 system. A curl download test over kTLS failed with: curl: (56) OpenSSL SSL_read: error:0A00010B:SSL routines::wrong version number, errno 0 Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance") Signed-off-by: Ofri Zangi Link: https://patch.msgid.link/20261108-tls-async-tx-ordering-v1-1-f9a1844ca88e@xsightlabs.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ff1b1793e879b5f91ffceb575346f5a4bac88118 Author: Kalpesh Solanki Date: Mon Nov 9 14:00:37 2026 +0530 tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK [ Upstream commit 968f2b94a5964b75d9c0da84523e42530c1891f0 ] A userspace application can set the link type of a TUN/TAP interface to ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, or ARPHRD_6LOWPAN via ioctl(fd, TUNSETLINK, arg) because tun_get_addr_len() explicitly recognized these types. However, TUN devices cannot function as genuine IEEE 802.15.4 or 6LoWPAN interfaces: 1. They lack wpan_phy, channels, PAN IDs, and MLME operations, and tun never initializes dev->ieee802154_ptr or dev->ml_priv. When an unprivileged user creates a TUN interface in a user+net namespace, changes its link type to ARPHRD_IEEE802154, and issues a netlink dump request (such as IEEE802154_LLSEC_LIST_KEY), ieee802154_llsec_dump_table() unconditionally dereferences dev->ieee802154_ptr / ieee802154_mlme_ops(dev), triggering a supervisor null-pointer dereference / general protection fault. Similar dereferences occur across net/ieee802154/nl-phy.c (ieee802154_del_iface) and net/ieee802154/socket.c. 2. Similarly, the 6LoWPAN subsystem assumes via lowpan_dev(dev) that netdev_priv(dev) is struct lowpan_dev. On a TUN device, netdev_priv(dev) is struct tun_struct. On netdev events (such as NETDEV_DOWN in net/6lowpan/core.c:lowpan_device_event), it clears bits in lowpan_dev(dev)->ctx.table flags, which corrupts private memory inside tun_struct. Rather than scattering checks across subsystems, fix the issue at the source: disallow setting ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, and ARPHRD_6LOWPAN via TUNSETLINK by returning -EINVAL. Cast arg to unsigned short in the comparison to prevent upper-bit truncation bypasses (e.g. arg = ARPHRD_IEEE802154 | 0x10000). Fixes: ff4cc3ac93e1 ("[TUNTAP]: Allow setting the linktype of the tap device from userspace") Reported-by: syzbot+9ea34da5ca6100593c90@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9ea34da5ca6100593c90 Signed-off-by: Kalpesh Solanki Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261109083037.22337-1-skalpesh942@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit f3c2f5d497b4f22db6f3afdb3f1489cf35c57042 Author: Avi Weiss Date: Mon Nov 9 16:13:44 2026 +0200 net: ena: avoid RX copybreak for multi-descriptor packets [ Upstream commit f3c790c34d228d46c4a05fe5d001d1bbea444e2b ] ena_rx_skb() selects the copybreak path based on the first RX descriptor's length without checking the number of descriptors. When a packet spans multiple descriptors, this copies only the first buffer into the skb and fails to recycle the remaining request IDs, while RX cleanup advances by the full descriptor count. Restrict copybreak to single-descriptor packets and apply the same restriction to the rx_copybreak_pkt statistic. Multi-descriptor packets then use the existing fragment-processing path. Discovered by comparing the in-tree ENA driver with Amazon's standalone ENA driver. Compiled with W=1 under x86_64 defconfig. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261109141343.920187-2-thnkslprpt@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 2601df068c0d845ea22d1ca98863dc4ce94e0621 Author: Breno Leitao Date: Mon Nov 9 09:14:29 2026 -0800 net: ena: Keep the RX buffer mapped if skb allocation fails [ Upstream commit 3e8e22a1007a6337ba2400b3ea87077947005c20 ] We are seeing the following issue in production on arm64 EC2 hosts (m8g.metal-24xl, 64K pages, SMMUv3 in strict mode, 6.18 based kernel). Right after a global OOM, the SMMU reports F_TRANSLATION write faults from the ENA device, followed by a burst of: WARNING: CPU: 48 PID: 1656834 at drivers/iommu/dma-iommu.c:1242 iommu_dma_unmap_phys+0xf4/0x108 Call trace: iommu_dma_unmap_phys+0xf4/0x108 (P) dma_unmap_phys+0x194/0x2a8 dma_unmap_page_attrs+0x1c/0x38 ena_io_poll+0x7bc/0x1790 [ena] __napi_poll+0x54/0x220 net_rx_action+0x250/0x520 ena_rx_skb() unmaps the RX buffer, or takes an extra page reference to reuse it, before napi_build_skb() allocates the skb. If the allocation fails, it returns NULL with rx_info->page still set. ena_clean_rx_irq() then puts the req_id back on the free list, and ena_alloc_rx_buffer() treats the buffer as still mapped and posts its old DMA address to the device again. With the IOMMU in strict mode, the device then writes to an unmapped IOVA, and the next completion of that buffer unmaps it a second time. If the IOVA was handed to a new mapping in between, the device can write into that buffer instead. On the reuse path, the extra page reference is never dropped. Allocate the skb before touching rx_info, so that a failed allocation leaves the buffer mapped and unchanged for the refill. Fixes: 9e5269a915a8 ("net: ena: use build_skb() in RX path") Fixes: f7d625adeb7b ("net: ena: Add dynamic recycling mechanism for rx buffers") Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20261109-ena-rx-skb-alloc-fail-v1-1-aee2927cb51f@debian.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit cd0ec1f06a0e30959ba347116aec6415ef6d7107 Author: Omar Ramadan Date: Thu Nov 5 23:23:02 2026 +0000 amt: tear down every amt device on an unregistering lower [ Upstream commit 7262e999ebec0a10ecc97ba4739f12255b7c6da8 ] amt_device_event() acts only on the amt device that amt_lookup_upper_dev() returns, which is the first amt device bound to the event's lower. Several amt devices can share one lower, for example two gateways. On NETDEV_UNREGISTER, only the first device is unlinked and unregistered. The others stay upper-linked to the lower, and unregister_netdevice_many_notify() warns, because the notifier chain must detach every upper device. They also still hold a reference on the lower, so each is torn down only when netdev_wait_allrefs_any(), called from netdev_run_todo(), rebroadcasts NETDEV_UNREGISTER. By then the lower's sysfs directory is gone, so unlinking it trips a kernfs WARN, and unregistering it from inside the rebroadcast trips the WARN in __rtnl_unlock(). On NETDEV_CHANGEMTU, only the first device is resized. Walk every amt device in the lower's netns and act on each one bound to the lower. On NETDEV_UNREGISTER, queue them all and unregister them in one batch. amt_dellink() unlinks each device but leaves it on the netns device list until unregister_netdevice_many(), so the walk stays valid under RTNL. To reproduce: ip link add lower0 type dummy ip link add amtg1 type amt mode gateway local 192.0.2.1 \ discovery 192.0.2.2 dev lower0 ip link add amtg2 type amt mode gateway local 192.0.2.1 \ discovery 192.0.2.2 dev lower0 ip link del lower0 Without this patch, the last command logs: WARNING: net/core/dev.c:12773 at unregister_netdevice_many_notify+0x13e5/0x1940, CPU#3: ip/216 kernfs: can not remove 'upper_amtg2', no directory WARNING: fs/kernfs/dir.c:1784 at kernfs_remove_by_name_ns+0xc9/0xd0, CPU#0: ip/216 WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216 WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216 With it, the commands log nothing and remove both amt devices, and tools/testing/selftests/net/amt.sh passes on a KASAN and lockdep kernel. Found by a selftest for our upcoming AMT offload RFC, which deletes a lower carrying two amt gateways, on our 6.18-based driver. The commands above reproduce it on net. Fixes: b9022b53adad ("amt: add control plane of amt interface") Signed-off-by: Omar Ramadan Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261105232302.494171-1-omar@blockcast.net Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ff1dfbb8fd2ba5bdbed637947c52adc5e7208421 Author: Chris Mason Date: Sat Nov 7 23:56:09 2026 +0000 tcp: Drop any segments if DEFER_CONNECT is set. [ Upstream commit 44809e49177992b15708a150437d9aebc5beea9c ] TCP Fast Open lets a client send data in its SYN. With TCP_FASTOPEN_CONNECT and a cached Fast Open cookie, which the server sent in the SYN-ACK of an earlier connection, the connection is set up in two steps: - connect() sends nothing, so that the SYN can carry the data of the first write(). It only sets DEFER_CONNECT and inserts the socket into the hash table in SYN_SENT. - The first write() calls tcp_connect(), which runs tcp_connect_init() and sends the SYN. A socket must not accept any segment before it has sent its SYN. But nothing on the receive path checks DEFER_CONNECT. So until the write(), the half-initialised socket processes segments like any socket in SYN_SENT, and a forged SYN is accepted. Similarly, ICMP with seq matching ISN is accepted in the state. Before commit 57889a8f6d49 ("tcp: initialize send sequence numbers before deferring TFO"), even seq 0 message was accepted. Drop any segments if DEFER_CONNECT is set. Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support") Signed-off-by: Chris Mason [kuniyu: revised DEFER_CONNECT tests and the commit message] Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261107235720.3129212-3-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 822c2f6996328b0245eafd18a6e1cc1df66fcab8 Author: Kuniyuki Iwashima Date: Sat Nov 7 23:56:08 2026 +0000 tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort(). [ Upstream commit 93723db43e5185404e7d637357d07ffbb38e8b65 ] When TFO is enabled, tcp_v[46]_connect() sets sk->sk_state to TCP_SYN_SENT and puts the socket into ehash without calling tcp_connect(). Then, tcp_fastopen_defer_connect() sets DEFER_CONNECT, and the first write()/sendmsg() will call tcp_connect() and send SYN with data if possible. If tcp_abort() kills a socket before the first write()/sendmsg(), the unhashed socket can still call it and send SYN in TCP_CLOSE. Also, DEFER_CONNECT is cleared after __inet_stream_connect(). So, blocking write()/sendmsg() can release lock_sock() in inet_wait_for_connect() while DEFER_CONNECT is set, and tcp_poll() could set EPOLLOUT even after SYN is sent. Let's clear DEFER_CONNECT in tcp_abort() and right before tcp_connect() in tcp_sendmsg_fastopen(). Note that the last argument of __inet_stream_connect() is changed from is_sendmsg to defer_connect as DEFER_CONNECT is already cleared when __inet_stream_connect() is called. This change is also needed for the next patch. Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support") Signed-off-by: Kuniyuki Iwashima Acked-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20261107235720.3129212-2-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit fb69f73f5897a95bde6a0a67c7c99ed5a5e2303b Author: Zhan Xusheng Date: Wed Nov 11 22:15:29 2026 +0800 erofs: reset buf->off in erofs_init_metabuf() [ Upstream commit 8b4ddd28ec5bdec14cefc57f8bf792cb4764d724 ] erofs_init_metabuf() sets buf->off only for the block device and keeps the old value when it switches to the metabox or the managed cache. erofs_bread() adds buf->off to every offset, so the result depends on how the buffer was last initialized. getxattr and listxattr init the same buffer twice, for the inline and the shared xattrs, with in_metabox taken from different places. On a block device mount with fsoffset=, if the inode is outside the metabox and COMPAT_SHARED_EA_IN_METABOX is set, the shared xattrs are read at their metabox offset plus fsoffset. The same image mounted file-backed returns the right values. Reset buf->off on every init. Fixes: 414091322c63 ("erofs: implement metadata compression") Signed-off-by: Zhan Xusheng Reviewed-by: Gao Xiang Signed-off-by: Gao Xiang (Docker) Signed-off-by: Sasha Levin commit d4e7b1afea616eb8cc5afcfe7a433270bcf4d00b Author: LiangCheng Wang Date: Wed Nov 11 14:00:14 2026 +0800 ASoC: max98090: keep the MIC boost across mic input power-up [ Upstream commit 58d51fa6ff1d21e79c3c340bfb3155dfa3025ca3 ] PA1EN/PA2EN select both the MIC1/MIC2 preamp enable and its gain (0 = off, 1 = 0 dB, 2 = +20 dB, 3 = +30 dB). "MICn Boost Volume" keeps the selected gain in max98090->pa1en/pa2en while the input is off, and max98090_micinput_event() writes it to the field when the "MICn Input" widget powers up. The event handler also reads the field back to keep the stored gain in sync ("Update for volatile"), but it does so on POST_PMU and POST_PMD. The widget drives PA1EN/PA2EN as a single enable bit, the low bit of the field, so at both points DAPM has just rewritten it: - POST_PMU: DAPM has set the field to 1, so the read-back stores 0 dB and the handler then restores 0 dB. - POST_PMD: DAPM has cleared the low bit, so a +30 dB (3) gain reads back as +20 dB (2). As a result every capture starts at 0 dB: a boost set while the input is powered down, e.g. restored by alsactl or an audio HAL at boot, never takes effect, and one changed during capture is lost at the next power-up. Read the field back on PRE_PMD instead, while it still holds the active gain, and only restore the stored gain on POST_PMU. Tested on i.MX95 with a MAX98090 headset mic on MIC1, running NXP's 6.18.38 vendor kernel (max98090_micinput_event() is the same as in mainline): with MIC1 Boost Volume set to 2 (+30 dB) before capture, register 0x10 reads 0x20 (0 dB) during capture without this change and 0x60 (+30 dB) with it, and a boost changed during capture is kept for the next capture. Fixes: 685e42154dcf ("ASoC: Replace max98090 Device Driver") Signed-off-by: LiangCheng Wang Link: https://patch.msgid.link/20261111-max98090-mic-boost-v1-1-20b9bd8816db@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit ed7285187eba1ed8004eea48a65b0cf9925fd617 Author: Kavitha Daula Date: Wed Nov 4 19:01:37 2026 -0500 xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() [ Upstream commit 704f812cdab8bbf30987653c1c76c0d2c1e135e7 ] Both callers of gnttab_unmap_refs_sync(), free_persistent_gnts() and xen_blkbk_unmap_purged_grants() in blkback, keep their struct gntab_unmap_queue_data on the stack. gnttab_unmap_refs_async() sets up the delayed work inside it with INIT_DELAYED_WORK(), so with CONFIG_DEBUG_OBJECTS_WORK and CONFIG_DEBUG_OBJECTS_TIMERS every persistent grant teardown warns twice, once for the work and once for its timer: [ 104.366085] ODEBUG: object ffffc9004020fad8 is on stack ffffc9004020c000, but NOT annotated. [ 104.371551] WARNING: CPU: 1 PID: 48 at lib/debugobjects.c:672 lookup_object_or_alloc.part.0+0x12b/0x1f0 Call Trace: __debug_object_init+0xfe/0x1a0 debug_object_init+0x38/0x50 __init_work+0x28/0x30 gnttab_unmap_refs_async+0x18/0xa0 gnttab_unmap_refs_sync+0x61/0x90 free_persistent_gnts+0x179/0x280 xen_blkbk_free_caches+0x16/0x30 xen_blkif_disconnect+0xfa/0x2d0 frontend_changed+0x90/0x680 xenbus_otherend_changed+0x80/0xb0 frontend_changed+0x14/0x20 xenwatch_thread+0x96/0x1a0 kthread+0x11d/0x250 ret_from_fork+0x29f/0x2d0 ret_from_fork_asm+0x1a/0x30 gnttab_unmap_refs_sync() waits for the unmap to complete before it returns, so the work never outlives the caller's frame. Initialise it with INIT_DELAYED_WORK_ONSTACK() when the item is on the stack and destroy it before returning. The function is exported, so an item that is not on the stack keeps INIT_DELAYED_WORK(). Fixes: b44166cd46e2 ("xen/grant: introduce func gnttab_unmap_refs_sync()") Signed-off-by: Kavitha Daula Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Message-ID: <20261105000137.82224-1-kavithadaula@Kavithas-MacBook-Pro.local> Signed-off-by: Sasha Levin commit 97ebb6ef498d3db41972a10dcf5cb290cddd26e1 Author: Pengpeng Hou Date: Sun Sep 20 11:48:33 2026 +0800 drm/bridge: sii902x: validate I2S data lane values [ Upstream commit 444b7116e7ef1fdb5f7db3bc1f74b20098d062d4 ] The sil,i2s-data-lanes property reader bounds the number of entries, but does not bound each entry's value. Those values index the four-entry i2s_lane_id table when the audio FIFO sequence is built. Reject unsupported lane values before indexing that table. Report the property name and invalid value with dev_err_probe() so the diagnostic identifies the faulty configuration. The issue was found by our static-analysis tool. Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") Assisted-by: gpt 5 Signed-off-by: Pengpeng Hou Reviewed-by: Luca Ceresoli Link: https://patch.msgid.link/20260920034833.18874-1-hppiscas@163.com Signed-off-by: Luca Ceresoli Signed-off-by: Sasha Levin commit 187e7dffab7e42dedad1793f57bd7e4bed364062 Author: Kyle Zeng Date: Fri Nov 6 15:17:27 2026 +0100 udp: check frag_list IP family before using skb_segment_list() [ Upstream commit 22b7cb932c6a0f7566d41072be6956cb6c8af4e1 ] UDP fraglist GRO uses SKB_GSO_UDP_L4 for both IPv4 and IPv6. __udp_gso_segment() reuses the frag_list skbs when the geometry of the head skb was not modified. skb_segment_list() keeps the network header of each frag_list skb as it was at GRO time and only adjusts the transport header offset. Nothing guarantees that the head skb still has the IP family of the frag_list skbs: helpers like skb_mpls_pop() let the caller choose the new protocol. In that case __udpv6_gso_segment_list_csum() handles the 20 byte IPv4 header of each frag_list skb as a struct ipv6hdr, and can write IPv6 addresses beyond its linear part. Check the IP version of the first frag_list skb. All skbs in the list belong to the same flow, so they share the same IP family. Use the skb_segment() fallback on a mismatch. Regular fraglist GRO traffic keeps the fast path. Fixes: b936a9b8d4a5 ("net: ipv6: fix UDPv6 GSO segmentation with NAT") Fixes: c3df39ac9b0e ("udp: ipv4: manipulate network header of NATed UDP GRO fraglist") Signed-off-by: Kyle Zeng [edumazet: simplified the fix, rewrote the comment and the changelog] Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit 7a92ac833d11f3a2e81bce74b1cf8e1d1d371888 Author: Jouni Högander Date: Mon Nov 2 12:00:48 2026 +0200 drm/i915/psr: Flush on cursor update also when not using Selective Fetch [ Upstream commit 6b3ea5a07eac0514623da3d0709b34c8c70f2827 ] Currently we are not doing flush on cursor update if Selective Fetch is not in use. This does not cause problems in PSR cases as enabling VBI is triggering PSR exit which triggers sending update to panel. In case of Panel Replay this does not happen. This causes legacy cursor update not working if using Panel Replay without Selective Updates. Dc3co is currently not enabled. Anyways there is no reason to differentiate calling psr2_dc3co_flush_locked on cursor update depending on selective fetch being enabled. So remove this dependency. v2: - Keep DC3CO handling for cursor updates. Fixes: 129a4da11707 ("drm/i915/psr: Use TRANS_PUSH to trigger frame change event") Cc: Ankit Nautiyal Signed-off-by: Jouni Högander Reviewed-by: Mika Kahola Link: https://patch.msgid.link/20261102100051.272137-2-jouni.hogander@intel.com (cherry picked from commit 043ab39fe2daad32f15fe77cf787a759f3f73512) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin commit 958e77ce222a282e45e8d48a539ce0c8e546bd03 Author: Janne Grunau Date: Tue Nov 10 17:46:46 2026 +0100 ASoC: apple: mca: Fix clock selection for clock consumer FEs [ Upstream commit d9bcb20e403908415809c37b96db4c9d651298cc ] In commit 00309bfb1f54 ("ASoC: apple: mca: Support FEs being clock consumers") the syncgen clock selection was misunderstood resulting in selecting a random clock. In the capture on multiple BEs for IV sense data use case the configuration worked partially by sheer luck. On Macbook Pro's with 6 speakers it could result in desync IV sense data triggered likely by sample rate changes. When the FE is a clock consumer select the clock of first used BE as SYNCGEN_MCLK. Add function like macros to determine the clock index based on the FE or BE number. This is functionally equivalent to the state sent in v2 of "ASoC: apple: mca: support simultaneous I2S capture on the frontend" in [1]. Link: https://lore.kernel.org/all/20260628-apple-audio-redux-v2-4-6328269c9652@gmail.com/ [1] Fixes: 00309bfb1f54 ("ASoC: apple: mca: Support FEs being clock consumers") Fixes: 108a14b20f95 ("ASoC: apple: mca: Support capture on multiples BEs") Signed-off-by: Janne Grunau Link: https://patch.msgid.link/20261110-snd-soc-apple-mca-capture-multiple-be-v1-1-d9569a8374c5@jannau.net Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit c023e476098ff5b5c27cd2674728310146e04517 Author: Anandu Padinhare Date: Fri Nov 6 06:12:51 2026 +0000 net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path [ Upstream commit 070411c1590c8172eb4d86f045d99c372f22fe23 ] In the AF_XDP zero-copy RX path, frames that the XDP program passes to the stack are handed over by stmmac_dispatch_skb_zc(). That function increments rx_pkt_n instead of rx_packets since commit 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary"). stmmac_rx_zc() already adds every processed frame to rx_pkt_n, so each XDP_PASS frame is counted twice there, and rx_packets, which ndo_get_stats64() reports, never counts them: on a zero-copy queue rx_bytes grows with the passed frames while rx_packets stays still. Count the frame in rx_packets, as the regular RX path and the code before that commit did. Found while testing AF_XDP zero-copy on an ADSP-SC598 (adi-dwmac, 100 Mbit/s link): rx_pkt_n grew almost twice as fast as the frames the MAC delivered, while "ip -s link" counted almost none. Tested on that board with a 6.18-based kernel, whose zero-copy RX accounting matches net. An AF_XDP zero-copy socket on queue 0 received frames of one EtherType while UDP traffic was passed to the stack. In a run with 60 s of traffic before the change, rx_pkt_n was 1.88 times the frames that reached the driver (MAC frames minus RX FIFO overflows) and "ip -s link" counted 55 RX packets. In the same test with the change, rx_pkt_n equals the frames that reached the driver and rx_packets equals the frames passed to the stack. Fixes: 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary") Signed-off-by: Anandu Padinhare Reviewed-by: Lorenzo Bianconi Link: https://patch.msgid.link/PNYPR01MB11444552E41C2B17A992492C0FD762@PNYPR01MB11444.INDPRD01.PROD.OUTLOOK.COM Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 7e2659b28af6b6b644cc2d861fb89e662c6cf8dd Author: Eric Dumazet Date: Mon Nov 9 17:45:40 2026 +0100 net: gro: compare skb->protocol in gro_list_prepare() [ Upstream commit 511582022bfd07475d0daa209e6e6aa5a940740d ] gro_list_prepare() checks whether a held packet may belong to the same flow as the incoming one by comparing the device, VLAN tag, metadata and the link-layer header, using dev->hard_header_len as its length. On devices without a link-layer header (hard_header_len == 0), such as L3 GRE tunnels, no compared byte carries the outer protocol: skb->protocol comes from the tunnel header. Packets of different protocols can then stay eligible, and the GRO handler selected from the incoming skb->protocol parses the held packet with the wrong layout. For example, take an IPv4/UDP packet held by UDP GRO and a VLAN/IPv4/TCP packet received on the same ipgre device. vlan_gro_receive() reads the first four bytes of the held IPv4 header as a VLAN header. With crafted values, the held packet survives up to tcp_gro_receive(), which uses its UDP header as a TCP header. With a short linear part, the FIN/PSH update of the held packet's TCP flags can then write into skb_shared_info. The VLAN, GRE, IPv4 and IPv6 GRO handlers compare the next-protocol field of their own header, so once the outer protocol matches, the inner layers are checked too. Only the outermost protocol was not compared. Compare skb->protocol too. On Ethernet devices this is redundant with compare_ether_header(), but it is cheap. GUE direct IP encapsulation has a similar issue, but there both packets have the same outer protocol, so it is fixed separately in gue_gro_receive(). Fixes: 60769a5dcd87 ("ipv4: gre: add GRO capability") Reported-by: Kyle Zeng Reviewed-by: Willem de Bruijn Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261109164540.3104392-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 62c831858402dca6db4da78e1afc6e507cfdcdcb Author: Eric Dumazet Date: Fri Nov 6 12:01:35 2026 +0100 udp: do not use a cross-family sk_rx_dst in early demux [ Upstream commit 5636e67320563be743d47706ef4914078c27edb2 ] A dual-stack UDP socket connected to a v4-mapped address can receive both IPv4 packets and IPv6 packets using v4-mapped addresses: ip6_rcv_core() no longer rejects a v4-mapped source since commit dcc32f4f183a ("ipv6: weaken the v4mapped source check"), which kept that check only in tcp_v6_conn_request(). ipv6_portaddr_hash() hashes v4-mapped addresses like IPv4 ones, so both early demux handlers find the socket, and both __udp4_lib_rcv() and __udp6_lib_rcv() store their input dst in the same sk->sk_rx_dst. udp_v6_early_demux() validates the cached dst with dst_check(), but ipv4_dst_check() ignores the cookie, so an IPv4 dst gets attached to an IPv6 skb. ip6_rcv_finish_core() then skips the route lookup and ip_local_deliver() parses the IPv6 header as an IPv4 one: the IPv6 next header and hop limit are read as a fragment offset, and the IPv4 protocol is taken from a source address byte. The reverse direction looks possible too: per-cpu dsts of IPv6 routes using nexthop objects have rt->sernum set, and ip6_dst_check() then ignores the cookie, so udp_v4_early_demux() can attach an IPv6 dst to an IPv4 skb. Kyle Zeng reported that such a packet can reach XFRM input still holding the prefetched, non refcounted, socket set by early demux, which can then outlive its RCU grace period. Only use the cached dst if its family matches the packet. Otherwise fall back to a regular route lookup. TCP does not have the same problem: sk_ehashfn() hashes a v4-mapped socket with inet_ehashfn(), while IPv6 lookups use inet6_ehashfn(), so IPv6 packets do not normally find a v4-mapped TCP socket. Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast") Fixes: c9f2c1ae123a ("udp6: fix socket leak on early demux") Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261106110135.2161204-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 040f915bd4e4d6f328eae4ea80ebac7c19ea25fd Author: Eric Dumazet Date: Fri Nov 6 09:42:59 2026 +0100 tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF [ Upstream commit 8c011697f76abf3b2302718a7a1c50e36d849f28 ] After listen() + shutdown(), a TCP socket is moved to the closed section of its reuseport group, while TCP_NEW_SYN_RECV requests can still reference it as rsk_listener. If SO_ATTACH_REUSEPORT_[CE]BPF is then used on this socket, reuseport_attach_prog() calls reuseport_alloc(), which resurrects it into the listening section of a new group, even though the socket is still in TCP_CLOSE. After close(), the socket stays in that group and the pending requests keep it allocated. When the final ACK arrives, reuseport_migrate_sock() can select this dead socket and inet_csk_clone_lock() clones it. With a ULP like espintcp installed while in TCP_CLOSE, the child inherits icsk_ulp_data and sk_destruct after tcp_cleanup_ulp() cleared icsk_ulp_ops, leading to a use-after-free in espintcp_destruct(). As done in commit 8cc3aef0cb19 ("tcp: Do not allow buggy transitions between ehash and lhash2."), deny this transition instead of adding checks to the fast path. Only an unhashed former listener is affected. Applications can still attach a reuseport prog to a socket that never listened, or to a listener (including one that called listen() again after shutdown()). Fixes: 333bb73f620e ("tcp: Keep TCP_CLOSE sockets in the reuseport group.") Reported-by: Kyle Zeng Signed-off-by: Eric Dumazet Reviewed-by: Jiayuan Chen Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261106084300.2029567-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0b29f696c06a21f8bce84345d57ffbe82a11e11b Author: Kuniyuki Iwashima Date: Fri Sep 4 03:35:28 2026 +0000 tcp: Do not allow buggy transitions between ehash and lhash2. [ Upstream commit 8cc3aef0cb198049805ecc061a2cc7b79b0ae43e ] The following state transitions have long been a playground for syzbot, and recently AI joined in, reporting a lot more bugs. * listen() + shutdown() + connect() * connect() + connect(AF_UNSPEC) + listen() All the fix attempts would add more code to the fast path, which is not worth it. Instead of playing whack-a-mole with these edge-case bugs, let's disallow these transitions. Note that unhashed_state is placed in the 4-byte hole after icsk_pmtu_cookie. $ pahole -C inet_connection_sock vmlinux struct inet_connection_sock { ... __u32 icsk_pmtu_cookie; /* 1208 4 */ unsigned char unhashed_state; /* 1212 1 */ /* XXX 3 bytes hole, try to pack */ Reported-by: Kyle Zeng Closes: https://lore.kernel.org/netdev/20260731140512.566464-1-david.lee@trailofbits.com/ Reported-by: Michal Luczaj Closes: https://lore.kernel.org/netdev/20260803-sockmap-lookup-tcp-leak-v2-0-306e025bfe66@rbox.co/ Reported-by: Hyunwoo Kim Closes: https://lore.kernel.org/netdev/20260824033331.1084971-1-imv4bel@gmail.com/ Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260904033543.2635540-2-kuniyu@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: 8c011697f76a ("tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF") Signed-off-by: Sasha Levin commit e8791eb5afb40edd31dc79eb934ed650e79b25c0 Author: Eric Dumazet Date: Fri Nov 6 20:56:15 2026 +0100 fou: gue: check IP version of held packets for direct IP encapsulation [ Upstream commit c59f004734a2a7c0e427011db13aca524e781498 ] For GUE version 0, gue_gro_receive() compares the base GUE header and its optional fields with every held packet. For GUE version 1 (direct IP encapsulation), it skips this comparison and selects the next GRO handler only from the IP version of the incoming packet. A held version 0 GUE packet from the same outer flow therefore stays eligible. For example, a GUE/IPv4/UDP packet can be aggregated with a direct IPv4/TCP packet, and inet_gro_receive() then parses the held packet's GUE header as an IPv4 header. Clear same_flow for held packets whose first nibble does not match the incoming IP version. A valid version 0 GUE header always has a first nibble between 0 and 3, so this also separates the two GUE formats. The reverse case is already handled: the version 0 path compares the whole base GUE header, including the version bits. Fixes: c1e48af7960e ("gue: Implement direction IP encapsulation") Reported-by: Kyle Zeng Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261106195615.2498766-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 61e06bd0966efa76c47a0431a01279b866fd4f4a Author: Kuniyuki Iwashima Date: Thu Nov 5 21:29:00 2026 +0000 net: Fix memory_allocated leak in __sk_mem_raise_allocated(). [ Upstream commit 8012eec76b7e6c0d9fb338fe8e3db6ca1b419da4 ] __sk_mem_raise_allocated() calls sk_memory_allocated_add() and reuses the return value to check if it was called. However, sk_memory_allocated_{add,sub}() cache a value in per-cpu counter, sk->sk_prot->per_cpu_fw_alloc, up to sysctl_mem_pcpu_rsv before reflecting it to sk->sk_prot->memory_allocated. Thus, sk->sk_prot->memory_allocated could have a negative value, and proto_memory_allocated() returns 0 in such a case. Then, if mem_cgroup_sk_charge() succeeds, sk_prot_mem_limits() checks are bypassed, and if mem_cgroup_sk_charge() fails, sk_memory_allocated_sub() is not called, leaking counters. Let's use sk->sk_bypass_prot_mem instead of allocated. Fixes: 7c268eaeec63 ("net: Allow opt-out from global protocol memory accounting.") Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261105212905.3122712-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ec128c76ead4a66750bfc879458e3ccbec7b0a0a Author: Cosmin Ratiu Date: Thu Nov 5 23:16:36 2026 +0200 net/mlx5e: Serialize TC and IPsec offload exclusion counters [ Upstream commit 717dec565a5e7feab544da5aa77db9da71bc93fe ] The counters enforcing TC and IPsec packet offload mutual exclusion are not consistently serialized. IPsec admission conditionally takes mode_lock for writing, while TC admission holds it only for read. Neither release path takes the lock, and devices without an eswitch cannot rely on it at all. These are per-core-device counters, separate from the eswitch mode and encapsulation reservations protected by mode_lock. Move them into mdev->offload_block and protect their checks, increments and decrements with a dedicated spinlock that is available even without an eswitch. A spinlock is used because some of these functions are called from atomic context and is a good fit because the critical sections are and will stay really short. IPsec admission then no longer needs mode_lock to update these counters. Add warnings for unbalanced releases. Keep mlx5_esw_lock() for eswitch operation admission and temporary mode/encapsulation reservations. This was found by upstream Sashiko during review of [1], and spun-off into a fix from the larger patch. [1] https://lore.kernel.org/netdev/178907726586.219967.4695695146458742597@kernel.org/ Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-9-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit fc72f3fd9d15a083330c626562201ab9a504c470 Author: Cosmin Ratiu Date: Thu Nov 5 23:16:35 2026 +0200 net/mlx5e: Block E-Switch mode changes during IPsec state creation [ Upstream commit 0d09de8e4f11391e8468219dbbc7af027e39e9b8 ] mlx5e_xfrm_add_state() reads priv->ipsec before blocking eswitch mode changes. A concurrent profile change can free the saved IPsec context and cause use-after-free. The temporary mode reservation was added in commit 22239eb258bc ("net/mlx5e: Prevent tunnel reformat when tunnel mode not allowed") after saving priv->ipsec but the race was actually enabled by the "Fixes" commit. Extend the reservation to cover obtaining the context as well. Use mlx5_eswitch_block_mode(mdev, false) for the temporary reservation, as policy creation does, to check operation ownership under mode_lock without rejecting existing eswitch users. This allows reusing existing IPsec tables while TC rules exist on VF representors. Check the context only after taking the mode reservation, so a concurrent mode change consistently returns -EBUSY and a missing context returns -EOPNOTSUPP, preserving software fallback for crypto offload. Keep the atomic acquire-placeholder path exempt, since it creates no hardware state and cannot take sleeping locks. This was found by Sashiko, during review of the last patch in the series. No reproduction attempted, as it seems quite a tricky race to successfully trigger. Fixes: 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode") Signed-off-by: Cosmin Ratiu Reviewed-by: Dragos Tatulea Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-8-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 36a2ab7fe7622f3411c5aa376e868a0e03b9b805 Author: Cosmin Ratiu Date: Thu Nov 5 23:16:34 2026 +0200 net/mlx5e: Block E-Switch mode changes during IPsec policy creation [ Upstream commit d9e4ac08ea892da54c5aa7ae4a368f2d09db589c ] Eswitch mode changes can tear down the IPsec context while policy creation is accessing it. The mode-blocking reference acquired when creating a flow table comes too late: the table lookup already accesses the IPsec context before taking that reference. Take a temporary mode-blocking reference before checking the IPsec context and validating the policy. This gets dropped after successful setup, when the flow table holds its own reference. The temporary reservation must allow reuse of existing IPsec tables. For example: 1. An offloaded inbound IPsec policy is added on the uplink. 2. A TC flower rule is added on a VF representor. 3. Another uplink policy is added using the same RX tables. The third policy reuses the first policy's tables, so it must not be rejected merely because esw->user_count is nonzero. Add a check_users argument to mlx5_eswitch_block_mode(). Pass false for temporary policy reservations and true when creating the first table (rx_get()/tx_get()). Temporary reservations take mode_lock and check operation ownership without requiring eswitch user_count to be zero. mlx5e_xfrm_add_state() needs the same early mode reservation and is handled in the next patch. This was found by Sashiko, during review of the last patch in the series. No reproduction attempted, as it seems quite a tricky race to successfully trigger. Fixes: a5b8ca9471d3 ("net/mlx5e: Add XFRM policy offload logic") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-7-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6e7d7afe3bed503f92d6f0ed87ce1fe0ae63a38b Author: Cosmin Ratiu Date: Thu Nov 5 23:16:33 2026 +0200 net/mlx5e: Fix ipsec core device access during profile changes [ Upstream commit 5b310ae1eff7531030b123bfcb192b0176d73075 ] Devlink E-Switch mode changes replace the netdev profile without unregistering the netdev. XFRM state and policy creation can therefore run while mlx5e_priv_cleanup() clears priv with memset() or mlx5e_priv_init() initializes it again. Accesses to priv->mdev can observe NULL or a torn pointer, and repeated loads may return different values. Read priv->mdev once in each add callback and use the saved pointer throughout the callback, including error unwinding. The core device survives the in-place profile change, so a saved non-NULL pointer remains valid even if priv is cleared in the meantime. A NULL priv->mdev means a profile change is in progress, which only happens during an eswitch mode change. Return -EBUSY in that case, as mlx5_eswitch_block_mode() does for the same mode change. -EOPNOTSUPP would make xfrm_dev_state_add() silently fall back to software for a crypto offload SA for its whole lifetime. Use WRITE_ONCE() when initializing priv->mdev and when clearing it before memset(). This makes the transition to NULL atomic; the subsequent bulk clear only writes zero bytes over an already NULL pointer. Annotate the READ_ONCE() snapshots with data_race() to allow that harmless overlap with the unmarked memset() without suppressing checks for the rest of priv. This fixes the core-device pointer accesses. Protecting the IPsec context itself during state and policy creation is handled separately. This was found by Sashiko, during review of the next patches in the series. No attempt was made at reproducing this race, the chances seem vanishingly small. Fixes: 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-6-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit a73906f469f85a1147d5b5d31ca57e2d8443327f Author: Cosmin Ratiu Date: Thu Nov 5 23:16:32 2026 +0200 net/mlx5e: Fix E-Switch races in uplink unbind [ Upstream commit 5eaf9931c8af41b1f0de6dc0589efa698784157c ] Unbinding the uplink Ethernet auxiliary driver in switchdev mode with offloaded IPsec policies deadlocks on the esw->mode_lock semaphore: mlx5_eswitch_safe_aux_devs_remove() mlx5_esw_hold() down_read_trylock(&esw->mode_lock) (*) mlx5_core_reps_aux_devs_remove() ... mlx5e_vport_uplink_rep_unload() unregister_netdev() xfrm_dev_unregister() xfrm_dev_policy_flush() xfrm_policy_kill() xfrm_dev_policy_delete() mlx5e_xfrm_del_policy() mlx5e_accel_ipsec_fs_del_pol() rx_ft_put_policy() rx_put() mlx5_eswitch_unblock_mode() down_write(&esw->mode_lock) (BOOM) Another deadlock with IPsec states: mlx5_eswitch_safe_aux_devs_remove() mlx5_esw_hold() down_read_trylock(&esw->mode_lock) (*) mlx5_core_reps_aux_devs_remove() ... mlx5e_vport_uplink_rep_unload() unregister_netdev() xfrm_dev_unregister() xfrm_dev_state_flush() xfrm_dev_state_free() mlx5e_xfrm_free_state() mlx5e_accel_ipsec_fs_del_rule() rx_ft_put() rx_put() rx_destroy() mlx5_eswitch_unblock_encap() down_write(&esw->mode_lock) (BOOM) To fix these, first refactor initiators of eswitch operations so they no longer step on each other's toes. The active/inactive toggle and setting the inline/encap mode now use the new mlx5_esw_lock_wait(), which waits for an operation in progress to finish. They all hold devl_lock, so the only operation they can find in progress is an uplink unbind, which doesn't need devl_lock. Setting the esw mode keeps using mlx5_esw_try_lock(), which also rejects the change while eswitch users exist and bails out with -EBUSY. mlx5_eswitch_safe_aux_devs_remove() now also waits for an operation in progress with the same mlx5_esw_lock_wait() before initiating one, dropping mode_lock and then removing representors. The deadlocks are avoided. Finishing an operation in progress now requires mlx5_esw_unlock() to wake up any waiters instead of plain up_write(&mode_lock). As a side effect, the timeout in mlx5_eswitch_safe_aux_devs_remove() is gone, which fixes another scary corner case, of representor devs not being removed on timeout but leaked instead. The timeout hid the SD deadlock fixed in the previous patch. Now that that's gone, no reason for the timeout to stay. This was found by internal testing and reproduced on HW. It was independently found by Sashiko during analysis of another patch in this series. Fixes: 2ae8c7edea87 ("net/mlx5: Fix Unbinding uplink-netdev in switchdev mode") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-5-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit fc7f7e20199343f69ed161aa61d5ea1f6d4f5684 Author: Cosmin Ratiu Date: Thu Nov 5 23:16:31 2026 +0200 net/mlx5e: Take HCA devcom lock before esw->mode_lock [ Upstream commit b7e98883eeb72b736dbdeb443e1f43e45f8e5dc1 ] Uplink ETH driver removal waits for any eswitch operation in progress before removing REPs. Removal through mlx5_unregister_device() or mlx5_detach_device() does this while holding the HCA devcom lock, which is used by peer devices in the same group. An E-Switch mode change can therefore race with a Socket Direct secondary device removal: T1: primary mode set T2: SD secondary dev removal mlx5_devlink_eswitch_mode_set() sets operation in progress mlx5_unregister_device() mlx5_devcom_comp_lock(hca) ... mlx5e_remove() mlx5_sd_get_adev() -> T1 dev mlx5_eswitch_safe_aux_devs_remove() waits for T1's operation esw_offloads_start() esw_mode_change() mlx5_devcom_comp_lock(hca) waits for T2's lock The timeout in mlx5_eswitch_safe_aux_devs_remove() makes this not a deadlock, but representor removal is skipped in that case which is incorrect. This bug was found by Sashiko inspecting the next patch in the series, which removes the timeout. It wasn't reproduced but the scenario seems plausible, albeit unlikely. This was undetectable by lockdep because the down_read_trylock() in mlx5_esw_hold() doesn't register as a lock edge, and also because it can't see the wait on the flag as a lock edge. Fix the lock order so the HCA devcom lock is taken in mlx5_devlink_eswitch_mode_set() before esw->mode_lock and held for the duration of the mode change. Expanding the HCA devcom lock critical section implies new lock edges being added, but this is safe: - mlx5_devlink_netdev_netns_immutable_set() adds HCA devcom -> RTNL, but there's already a HCA devcom -> RTNL dependency in mlx5_register_device() -..-> register_netdev() - esw_offloads_disable/enable() -> esw devcom cleanup/init: adds HCA devcom -> esw devcom. Nothing takes the HCA devcom lock while holding the esw devcom lock. Fixes: 2ae8c7edea87 ("net/mlx5: Fix Unbinding uplink-netdev in switchdev mode") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-4-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 9c530fef7f43244a058b4958ee2bbea751fd4ad2 Author: Cosmin Ratiu Date: Thu Nov 5 23:16:30 2026 +0200 net/mlx5e: Serialize ipsec encap reservations with eswitch operations [ Upstream commit b102f927c69e2d7cf849bcfb7f7b0cd6e52fc1b0 ] mlx5_eswitch_block_encap() takes mode_lock but ignores eswitch_operation_in_progress. mlx5_devlink_eswitch_encap_mode_set() claims the operation and drops mode_lock while rebuilding the FDB and updating offloads.encap, so a reservation can read a stale or rolled-back encap value. In diagram form: T1: first IPsec SA (NIC table) T2: encap none -> basic mlx5_devlink_eswitch_encap_mode_set() down_write(&esw->mode_lock) sees num_block_encap == 0 eswitch_operation_in_progress = true up_write(&esw->mode_lock) esw_destroy_offloads_fdb_tables() mlx5e_xfrm_add_state() mlx5e_ipsec_fs_tunnel_allowed() mlx5_eswitch_block_encap() down_write(&esw->mode_lock) reads encap == NONE num_block_encap++ up_write(&esw->mode_lock) esw->offloads.encap = BASIC esw_create_offloads_fdb_tables() The race happens therefore because offloads.encap is not consistently accessed under mode_lock. There are other variations of the above race (e.g. in rollback, or in tx_create()). Use mlx5_esw_lock() to reject a reservation while an operation is in progress. This implies changing mlx5e_ipsec_fs_tunnel_allowed() to propagate the error. Note that these are not new failure modes as it seems on first glance, because if the eswitch_operation_in_progress flag is set, rx_get()/tx_get()->mlx5_eswitch_block_mode() already fails with -EBUSY. The new code simply protects against an operation initiated in the short window after mlx5_eswitch_block_mode(). This race was found by Sashiko during inspection of another patch of this series. No attempt has been made to trigger it, as it requires very precise timing. Fixes: baac8351f74c ("net/mlx5e: Reduce eswitch mode_lock protection context") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit bc470bc693d6506bc6eb4c58755a358504df0de8 Author: Cosmin Ratiu Date: Thu Nov 5 23:16:29 2026 +0200 net/mlx5e: Release IPsec root table reference on RX setup failure [ Upstream commit e8303b58108519ff103241442c0a7602fa106af5 ] Switchdev RX setup takes a root-chain table reference before creating its flow tables. If creation fails, rx_get() returns without incrementing the RX reference count, so rx_destroy() never releases the chain reference. Extract the cleanup logic in a counter-partner to the function acquiring the root table ref, and call it on error to properly release everything. Also call it from the normal destroy path to reduce code duplication. mlx5_esw_ipsec_rx_status_pass_dest_get() ignored chain table acquisition errors, returning success with an error pointer as the destination. The new unwind could then release a reference that was never taken. Propagate the error so cleanup only runs after a successful get. Discovered by Sashiko. Not triggered as it's an unlikely error path. Fixes: 1762f132d542 ("net/mlx5e: Support IPsec packet offload for RX in switchdev mode") Signed-off-by: Cosmin Ratiu Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261105211637.1083978-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit bf6e0dc4b9774b586ab250b75cc16308421a1def Author: Chris Mason Date: Thu Nov 5 17:35:06 2026 -0500 net: skbuff: uncharge trimmed zerocopy frags on error [ Upstream commit 8b67debdfbf6b370312ebec5c9e0a1c39b5c7733 ] __zerocopy_sg_from_iter() accounts for the frags that it adds even when it returns an error: it adds the growth of skb->truesize to sk_wmem_queued and, unless the skb is pure zerocopy, charges it to the socket. On error, skb_zerocopy_iter_stream() cannot free the skb, as it may hold data from an earlier send. It trims the new frags, but leaves skb->truesize and their accounting in place. Repeated failed sends to the same skb accumulate this stale accounting. This can inflate TCP memory accounting past tcp_mem, and can wrap skb->truesize, leading to a use-after-free of the socket. Undo the accounting after the trim. If the trim fails, the frags and their accounting remain. The trim only fails if the skb is cloned, which is not expected for the unsent skb at the TCP write queue tail. The issue was found by an LLM. Fixes: 52267790ef52 ("sock: add MSG_ZEROCOPY") Reported-by: Kyle Zeng Signed-off-by: Chris Mason [willemb: revised commit message] Signed-off-by: Willem de Bruijn Link: https://patch.msgid.link/20261105223512.3647504-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d6cf2ad9172ced724bfcf12ff965573f60e43ecb Author: Yuho Choi Date: Thu Nov 5 11:43:08 2026 -0500 ptp: kvm: x86: Leak clock_pair page if changing its encryption fails [ Upstream commit 6a01fb125ba6474cb97f14b68fe5435d3cdd08e5 ] In a confidential guest, kvm_arch_ptp_init() shares the clock_pair page with the host using set_memory_decrypted(), and kvm_arch_ptp_exit() makes it private again with set_memory_encrypted() before freeing it. The untrusted host can make either call fail and leave the page shared. Both paths still free the page: the init error path with __free_page(), and kvm_arch_ptp_exit() after only a WARN_ON(). The page allocator can then hand a page the host can still access to an unrelated user. Leak the page in both cases instead, as was done for the same situation in commit b9fa16949d18 ("dma-direct: Leak pages on dma_set_decrypted() failure") and commit 03f5a999adba ("Drivers: hv: vmbus: Leak pages if set_memory_encrypted() fails"). Fixes: 6365ba64b4dbe ("ptp: kvm: Use decrypted memory in confidential guest on x86") Signed-off-by: Yuho Choi Link: https://patch.msgid.link/20261105164324.23501-2-oss.patchbox@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0592c2308d9f13f03adc3a8405b81d36e44562ee Author: Chase Hiltz Date: Thu Nov 5 14:26:40 2026 -0400 ipv4: route: don't blackhole in-use routes when retiring fnhe routes [ Upstream commit ae89f2724db1afa96a1f1b661174fc41ae1e88fa ] When a route cached in a nexthop exception (fnhe) is replaced or flushed, rt_bind_exception() and fnhe_flush_routes() call dst_dev_put() on it. That sets dst->dev to blackhole_netdev and dst->input/output to dst_discard*(), but other CPUs can still be using the route, e.g. as a noref dst taken from the fnhe under RCU. Packets that reach dst_input() or dst_output() after that are dropped. If dst_dev_put() runs after a forwarded packet has entered ip_output(), ip_skb_dst_mtu() in __ip_finish_output() can return the MTU of blackhole_netdev (68), and ip_fragment() can then drop a DF packet and send ICMP_FRAG_NEEDED with mtu 68 to its source. Commit 5018c59607a5 ("ipv4: fix race condition between route lookup and invalidation") fixed the same race in rt_cache_route() by putting the old route on the uncached list instead of calling dst_dev_put(). Do the same for routes retired from an fnhe. rt_flush_dev() still moves them to blackhole_netdev when their device is unregistered. fnhe routes are also retired on fnhe expiry (ip_del_fnhe()) and eviction (fnhe_remove_oldest()). Those paths don't bump rt_genid, so without the obsolete marking ipv4_dst_check() could still accept the route. Keep marking retired routes DST_OBSOLETE_DEAD, as dst_dev_put() did, so that users that cached them, such as sockets, look up again. In a netns reproducer that forwards IPv4 traffic over an ip6tnl device, with an fnhe for the destination, while the FIB keeps changing, this patch stops the mtu 68 ICMPs and the drops. Fixes: 95c47f9cf5e0 ("ipv4: call dst_dev_put() properly") Reviewed-by: Eric Dumazet Signed-off-by: Chase Hiltz Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261105182640.2999521-1-me@chasehil.tz Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 114feba9ba956e63aa5253017da58560f2ef1ac5 Author: Ivan Vecera Date: Thu Nov 5 14:11:44 2026 +0100 dpll: notify about a reference sync pair only if it was added [ Upstream commit 7a3837929d049dac1f931620f30b100993ce2594 ] dpll_pin_ref_sync_pair_add() sends a pin change notification even when xa_insert() fails and nothing has changed. zl3073x gets -EBUSY when another channel has already added the same pair and ignores it, so user space is notified about a change that did not happen. Send the notification only after a successful insert. Found by code review. Reproduced on a ZL30732A board with kprobes on dpll_pin_ref_sync_pair_add() and __dpll_pin_change_ntf(): loading the driver adds one pair twice and the add failing with -EBUSY sends a notification. With this patch it does not, and the successful add still does. A test module adding one pair twice shows the same on the monitor group. Fixes: 58256a26bfb3 ("dpll: add reference sync get/set") Signed-off-by: Ivan Vecera Reviewed-by: Vadim Fedorenko Reviewed-by: Petr Oros Link: https://patch.msgid.link/20261105131145.1010406-2-ivecera@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit c9270b5b9b2a1958aa1049c3a9f4ba52b88aa3b0 Author: Changyul Lee Date: Wed Nov 4 19:34:19 2026 -0500 net/mlx5: macsec: Don't remove fs_id when adding a rule fails [ Upstream commit 5175da73dd128520ad6d704d7fe54926ee5f658b ] macsec_fs_tx_add_rule() and macsec_fs_rx_add_rule() clean up a failed rule with macsec_fs_{tx,rx}_del_rule(), which also calls macsec_fs_id_del(). The fs_id is never in the xarray at that point: macsec_fs_id_add() is the last step of adding a rule and removes its own entry when it fails. macsec_fs_id_del() then dereferences NULL, through macsec_device for the first SA of a MACsec netdev and through fs_id_found otherwise. On RX, the SAs of one SC share an fs_id, so a failure while adding another SA drops the reference that an existing SA holds. Split the rule teardown from the fs_id removal and do only the teardown on the error paths. Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering") Signed-off-by: Changyul Lee Reviewed-by: Tariq Toukan Link: https://patch.msgid.link/20261105003419.4016283-1-lcy8047@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 7fd3c8f025224d695acd479e4d1861884b8e78ff Author: Shay Drory Date: Wed Nov 4 20:47:56 2026 +0200 net/mlx5: E-switch, Restore host PF enable for ECPF that isn't E-switch manager [ Upstream commit 4777203cc9af51db5ae647920c14ee9451e783d7 ] The cited commit breaks host PF enable_hca when the ECPF isn't E-switch manager. For example, when the link layer is infiniband, the ECPF isn't E-switch manager, so after the cited commit enable_hca is never issued for the host PF, it stays in initializing state and fails to probe. Fix it by checking esw_allowed() only for vport bookkeeping Fixes: 0e6c95c98829 ("net/mlx5: Support devlink port state for host PF") Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Mark Bloch Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261104184756.773910-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit cc5198b83dd6a65b0c2ca53666d1d797b5f995ec Author: Tim Menninger Date: Fri Nov 6 23:28:43 2026 +0000 NFSv4/flexfiles: limit transport disconnects when cancelling I/O [ Upstream commit 788c4f628565897e7090cdf5bb2e049e74aeca96 ] ff_layout_cancel_io() cancels RPC tasks associated with a recalled or revoked layout segment. If any matching tasks are found, it then calls rpc_clnt_disconnect(). rpc_clnt_disconnect() disconnects every transport attached to the RPC client. A data server client can have multiple transports, while the cancelled requests may have used only a subset of them. Cancelling I/O for one layout segment can therefore disrupt unrelated I/O using other transports belonging to the same data server client. This is particularly disruptive with RPC/RDMA during data server recovery, where unnecessary transport disconnects can result in repeated reconnect activity on otherwise unaffected connections. Use rpc_cancel_tasks_and_disconnect() instead. Matching tasks are still cancelled, but only matching requests belonging to that client that remain on the transport transmit or receive queues are marked for disconnect. When such a request is released, SUNRPC conditionally disconnects the connection generation on which that request was sent. This preserves cancellation and draining of I/O associated with the layout segment without disconnecting unrelated transports attached to the same RPC client. Fixes: b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked") Signed-off-by: Tim Menninger Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 73fd1a148d1d74502c79261041c107992da30079 Author: Tim Menninger Date: Fri Nov 6 23:28:42 2026 +0000 SUNRPC: add request-scoped disconnects when cancelling tasks [ Upstream commit 9d84719d34cb98a2f584e38679f95216c1a15d0e ] rpc_cancel_tasks() allows callers to cancel a selected set of RPC tasks, but callers that also need to tear down the connection currently have to disconnect at the rpc_clnt level. That is broader than necessary for clients with multiple transports. A cancelled request is associated with a specific rpc_xprt and records the connection generation on which it was transmitted in rq_connect_cookie. Add rpc_cancel_tasks_and_disconnect() to cancel matching tasks and mark matching requests that remain on the transport transmit or receive queues for conditional transport disconnect when the request is released. Store the disconnect indication in struct rpc_rqst rather than struct rpc_task. An RPC task can release one request and later acquire another, so task-scoped state could otherwise be consumed by a successor request and disconnect the wrong transport generation. After cancelling matching tasks, walk the client's transports and mark matching requests belonging to that client that remain on the transmit or receive queues. An rpc_xprt may be shared by multiple rpc_clnt instances, so requests belonging to other clients are not marked. When a marked request is released, consume the marker under the existing transport_lock critical section. If the request was transmitted, call xprt_conditional_disconnect_locked() with its rq_connect_cookie. The disconnect is skipped if that cookie no longer matches the transport's current connection generation. This adds no lock acquisition to the normal request-release path. Requests that were never transmitted do not trigger this additional disconnect. Signed-off-by: Tim Menninger Signed-off-by: Anna Schumaker Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O") Signed-off-by: Sasha Levin commit 02c09934777a540e07e401ce7b7dfb78450ba302 Author: Benjamin Coddington Date: Tue Sep 15 08:22:13 2026 -0400 NFSv4/flexfiles: Make the pinned device node pointer RCU-managed [ Upstream commit b14c22e01c5c4f8dfe9c7165c801796e1ec6ebae ] Annotate mirror->dss[dss_id].mirror_ds as __rcu and convert the remaining readers, completing the preparation for re-pointing the pinned node while I/O is in flight: - ff_layout_get_mirror_ds() takes its reference under rcu_read_lock() with atomic_inc_not_zero(), retrying if it races a reset. The resolve path takes the caller's reference before publishing the node with cmpxchg(), so a concurrent reset cannot drop the last reference under the caller: one reference is held for the installed pointer and one for the caller, and the pointer's reference is released elsewhere by xchg + put. - The availability scans hold rcu_read_lock() across the walk; they only test flags on the RCU-freed node. - ff_layout_cancel_io() holds a reference across the cancel and disconnect calls. Both of its callers hold i_lock and nothing on that path sleeps, so the reference is not about blocking: it is what keeps the node alive between the RCU-protected read and the use of mirror_ds->ds. The final put is never reached here, because the mirror's own pin outlives the loop -- which matters, since that put ends in nfs_put_client() and cannot run under a spinlock. - ff_layout_mirror_prepare_stats() reads the pointer with rcu_dereference() under rcu_read_lock(). i_lock, which both callers hold, is what excludes the re-pointing walk added later in this series; it does not exclude the resolve path's cmpxchg(), which runs from I/O submission, so the read cannot claim i_lock as its update- side lock. A non-NULL pointer read there is stable regardless: the resolve path only ever installs over NULL. - ff_layout_free_mirror() tears down the last reference; no concurrency. The pointer is still only ever set once per mirror lifetime, so there is no behavior change; this commit makes the subsequent in-place re-resolve on CB_NOTIFY_DEVICEID CHANGE safe to introduce. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O") Signed-off-by: Sasha Levin commit 6c1ee62fc9b9e0625d385cda1db9666b4d97bb6a Author: Benjamin Coddington Date: Tue Sep 15 08:22:12 2026 -0400 NFSv4/flexfiles: Hold a device node reference for layoutstats encoding [ Upstream commit dbde656f2f7a8dced33413c83a0cb6b634bfb26e ] ff_layout_mirror_prepare_stats() records a stripe's device under i_lock, but the layoutstats/layoutreturn XDR encode runs later and dereferences the mirror's pinned device node (for the DS netaddr) with no reference of its own. Once a CHANGE notification can re-point the pinned node, that read becomes use-after-free. Take a node reference at prepare time and carry it with the stripe in a per-devinfo nfs4_ff_layoutstat_priv, released in ff_layout_free_layoutstats(). The priv entries live alongside the devinfo array: co-allocated for LAYOUTSTATS, an additional member of nfs4_flexfile_layoutreturn_args for LAYOUTRETURN. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O") Signed-off-by: Sasha Levin commit c063bc5bcc688d8080e61a8fcc3dec94d5aa4872 Author: Benjamin Coddington Date: Tue Sep 15 08:22:10 2026 -0400 NFSv4/flexfiles: Reference the device node across DS setup [ Upstream commit e85acae4cda89c075bc94520fdcf5901595fffae ] The flexfiles I/O setup paths read the mirror's pinned per-stripe device node (mirror->dss[dss_id].mirror_ds) repeatedly and locklessly, relying on the mirror's lifetime pin. To prepare for re-resolving that pointer in place on CB_NOTIFY_DEVICEID CHANGE, readers must hold their own reference on the node they are using rather than trusting the pin. Replace ff_layout_init_mirror_ds() with ff_layout_get_mirror_ds(), which resolves on first use as before but returns the node with its own reference held. Thread the referenced node through nfs4_ff_layout_prepare_ds() and the DS selection helpers so each setup path snapshots the node once, and drop the reference when setup is done. No functional change: the pointer is still resolved once and pinned for the life of the mirror. Each reference this adds is released on every exit from the path that took it, error paths included. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O") Signed-off-by: Sasha Levin commit 9e8d1ca8f0e9e9bdf935bf67d83d2a1f2b78f612 Author: Alexander Duyck Date: Tue Nov 3 09:09:36 2026 -0800 net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist [ Upstream commit fdca4b030c78fa2773a94fda3a6dc3ce5558a727 ] The netif_needs_gso function lets a GSO skb reach the device unsegmented when it is CHECKSUM_PARTIAL or CHECKSUM_UNNECESSARY. The second case was added for FCoE, whose transmit path marked CRC offload that way at the time. Commit 253aab0597d9 ("fcoe: Use CHECKSUM_PARTIAL to indicate CRC offload") moved FCoE back to CHECKSUM_PARTIAL but left the exemption in place, with nothing left that needed it. Fraglist GSO, added later, is its only user today, as its segments already carry valid checksums. A TCP GSO skb can still arrive as CHECKSUM_UNNECESSARY without being fraglist. Hardware LRO builds its aggregates that way, for example mlx5 sets SKB_GSO_TCPV4 or SKB_GSO_TCPV6 and CHECKSUM_UNNECESSARY, without SKB_GSO_DODGY. IP forwarding and bridging turn LRO off, but a tc mirred redirect does not, so such an skb can be sent out another device. It has no csum_start and its TCP checksum field is whatever the aggregate left there. Drivers that only set up TSO for CHECKSUM_PARTIAL, such as fbnic, i40e and ice, then send the whole skb as one oversized frame with a bad checksum. Have the validate_xmit_skb function mark any CHECKSUM_UNNECESSARY GSO skb other than fraglist as CHECKSUM_NONE, which means the same on transmit but is not exempt in the netif_needs_gso function. The __skb_gso_segment function then unshares the header and the TCP GSO code sets the skb up as CHECKSUM_PARTIAL, so a device with TSO segments it in hardware. Without TSO, and for UDP, it is segmented in software. The callers of the netif_needs_gso function that decide on segmentation for themselves, such as tap, are left as they are. Found by code inspection. In QEMU with an emulated fbnic, TCPv4 and TCPv6 GSO skbs built this way each went out as a single 11 KB frame with a bad TCP checksum. With this change they are segmented into MSS-sized frames with valid checksums. Fixes: 253aab0597d9 ("fcoe: Use CHECKSUM_PARTIAL to indicate CRC offload") Signed-off-by: Alexander Duyck Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/179372577673.49909.11253315483074546903.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6afaa0a688d5af3497dcee6096472bf095f405a5 Author: Alexander Duyck Date: Wed Nov 4 09:59:33 2026 -0800 fbnic: Wait for the outbound flush to complete on mailbox teardown [ Upstream commit c5820a8cf59b03d59f2f5f9b3754ad27a6014a41 ] The fbnic_mbx_reset_desc_ring function drops bus mastering and arms the outbound flush for its ring: the write flush for the Rx ring and the read flush for the Tx ring. Nothing waits for that flush to finish. The fbnic_mbx_clean_desc_ring function goes straight on to unmap and free the ring's buffers, so a device read of a Tx buffer, or a write to an Rx buffer, can still be outstanding after the buffer is gone. With an IOMMU it can also target an IOVA that has been unmapped or reused. The PUL link reset status register reports when each direction's flush has drained. Poll the done bit for the ring's direction after arming the flush and before freeing its buffers. The flush only has to retire what the outbound path already holds; the 1ms cap keeps a wedged device from spinning. Every caller of the fbnic_mbx_clean function runs with the datapath already down, which matters because the read flush covers all outstanding reads, not just the mailbox ones. A device that has lost its link reads back as all ones, so the done bit appears set and the poll ends on the first pass. Fixes: 3b12f00ddd08 ("fbnic: Gate AXI read/write enabling on FW mailbox") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179381517319.9644.1165591016149104577.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit b60a7d4bd86559c376993f571fd79b4f6fcaf1e0 Author: Alexander Duyck Date: Wed Nov 4 09:59:26 2026 -0800 fbnic: Suspend phylink after taking the datapath down in ndo_stop [ Upstream commit b45b9c6b83e7a5ac440d36b46ed9b466788b3e5c ] The fbnic_stop function calls the phylink_suspend function before the fbnic_down function. With no BMC present that stops phylink, and the fbnic_phylink_mac_link_down function disables the MAC and holds its Tx and Rx clocks and FIFOs in reset. Only then does the fbnic_down function stop the queues and wait for the Tx path to go idle, so anything still in flight has to drain into a MAC that is no longer passing traffic, and the fbnic_wait_all_queues_idle function can be left to time out and force a flush. With a BMC present phylink leaves the link up but turns the carrier off, which the phylink_suspend function notes assumes all packets have already been sent. It is also the reverse of how the interface comes up: the __fbnic_open function resumes phylink last, and the fbnic_up function then enables the queues and installs the host Rx filters. Call the fbnic_down function first. The Tx path then drains with the link still up, and Rx is still stopped first, as the fbnic_clear_rx_mode and fbnic_clear_rules functions remove the host as a destination for its MAC addresses in the RPC before the queues are disabled. The MAC IRQ is still freed before phylink is suspended, so no link interrupt runs while the link is taken down. The PM suspend path goes through ndo_stop and picks up the same order. Fixes: 6ede14a2c636 ("fbnic: Move phylink resume out of service_task and into open/close") Signed-off-by: Alexander Duyck Fixes: 69684376eed5 ("eth: fbnic: Add link detection") Link: https://patch.msgid.link/179381516644.9644.9042901965231900737.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 22f72cff074e3a2d14249efb8fa8cdd9e16d7e7f Author: Alexander Duyck Date: Wed Nov 4 09:59:19 2026 -0800 fbnic: Disable PTP completions during the Tx force-flush [ Upstream commit 7d4568edce74ac72794cdd42767cc116bf1ca9b4 ] When the Tx queues fail to go idle, fbnic_wait_all_queues_idle() falls back to fbnic_tx_flush(), which sets FBNIC_TMI_DROP_CTRL_EN. That bit only drops packets at the Tx MAC Interface start of packet protection FIFO. The PTP completion path is governed by a separate bit in the same register. With only the drop enable set, a timestamped frame has its packet discarded while the matching completion is still forwarded to the host. fbnic_clean_tsq() then walks the ring with no packet left to match it against and reports "Tx timestamp without matching packet". The drop does not retire the completion either, as the completion FIFO is only drained when the completion disable is set. Set FBNIC_TMI_DROP_CTRL_CMPL_DIS together with the drop enable so the completions are drained rather than leaked to the host, and clear both bits again when the flush is turned off. Fixes: ad3d9f8bc66c ("eth: fbnic: add TX packets timestamping support") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179381515954.9644.10831265959574467679.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit e5c820c4e9aef170766a6f7d05aa08c96c8ebffa Author: Alexander Duyck Date: Wed Nov 4 09:59:12 2026 -0800 fbnic: Fix service task races with ndo_stop and PM suspend [ Upstream commit 05ec5504ff69dac8867292c0e778fe79c3dde83c ] The service task can run after the datapath has been torn down underneath it. ndo_stop stops the task with the cancel_delayed_work function, which does not wait for a pass already executing. It cannot use the cancel_delayed_work_sync function, as ndo_stop holds RTNL and the task takes RTNL itself, so a pass blocked on RTNL while ndo_stop runs carries on once ndo_stop returns. By then the fbnic_down function has demoted the host MACDA and action entries to UPDATE and disabled the host queues, and ndo_stop has handed ownership back to firmware, which clears fw_heartbeat_enabled. The late pass's health check reports a firmware crash that did not happen, and the fbnic_fw_config_after_crash function reclaims ownership and writes the host rules back to hardware. If the BMC raised FBNIC_FW_CAP_F_BMC_TCAM_REINIT in that window, the fbnic_bmc_rpc_check function does the same through the __fbnic_set_rx_mode function. Either way host traffic is steered at queues that are no longer running until the next open and close. The fbnic_pm_suspend function, which also serves shutdown and PCIe error recovery, has the same problem and a worse one. It calls ndo_stop directly with the device detached but __LINK_STATE_START still set, so a late pass there sees the interface running, restores the host state, and keeps re-arming itself every second after the mailbox, IRQs and MMIO are gone. Only run the health and BMC checks, and only re-arm, while the interface is running and the device is present. The __dev_close_many function clears __LINK_STATE_START under RTNL before it calls ndo_stop, and the suspend path detaches the device under RTNL, so a late pass now leaves the host state alone and stops. The BMC flags stay raised, and the __fbnic_open function reclaims ownership, restarts the heartbeat and rebuilds the BMC rules on the next open. The fbnic_pm_suspend function also cancels the task synchronously once it has dropped RTNL, so a pass already running cannot overlap the mailbox and IRQ teardown. On resume the __fbnic_pm_attach function called the fbnic_up function, which schedules the next pass, before attaching the device, all without RTNL. A pass that ran in between would now see the device detached and stop for good. Check for an init failure first, then hold RTNL and the instance lock across the stats reset, the fbnic_up call and the attach, as the suspend path does, so the pass blocks until the device is present. This also gives the fbnic_up function the instance lock it expects for the napi_enable_locked calls and the rx mode rewrite. A device that detaches itself on a failed register read likewise stops re-arming the task until recovery attaches it. The issue was found by code review. The change was tested on fbnic hardware with firmware 26.09.14-017_h7ab84d2ef68f by cycling the interface through DPC/AER recoveries for a day. Fixes: 04a230b27d8f ("fbnic: Add logic to repopulate RPC TCAM if BMC enables channel") Fixes: 6ae7da8e9e06 ("eth: fbnic: reprogram TCAMs after FW crash") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179381515284.9644.1846335740085170889.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 63ff1acfa6022de47df7029fa81639a0f4d0cf86 Author: Umang Pokhriyal Date: Wed Nov 4 23:12:40 2026 +0530 tun: delete the flow entries of the moved queue on detach [ Upstream commit 4cc0a3f897074cea28dae38f1cd9bb230dae5d86 ] When a queue is detached, __tun_detach() moves the last queue into the freed slot and decrements tun->numqueues. The flow entries that point at the old index of the moved queue, now tun->numqueues, are meant to be deleted, but the call passes tun->numqueues + 1, an index that never exists, so nothing is deleted. Until those entries are refreshed by a write on their flow or age out, tun_automq_select_queue() returns an index past the last queue, and netdev_core_pick_tx() sends every such flow to queue 0 and warns: tapq0 selects TX queue 3, but real number of TX queues is 3 Found with an LLM while testing how a VMM detaches tap queues when a guest lowers its virtio-net queue pairs. With four queues, 30 flows learned on queue 3 and queue 1 detached, all 30 went to queue 0 with the warning; with this patch they are spread by hash and no warning is printed (3 runs each, in a guest booted on net). Pass tun->numqueues. Fixes: 96442e42429e ("tuntap: choose the txq based on rxq") Signed-off-by: Umang Pokhriyal Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261104174240.138491-1-umangpokhriyall@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit c535b19226faf569f91b7f9cc33a44084e2e488c Author: Olga Kornievskaia Date: Fri Nov 6 22:12:32 2026 -0500 NFSv4: remember that the server may send CB_NOTIFY_LOCK [ Upstream commit 4fdc29eb6730207b4a6f63f81575c7aa5c2a4ff1 ] Two processes contending for a POSIX lock on one file see occasional acquisitions of almost exactly 1, 3 or 7 seconds when the client holds a delegation, although the holder releases within microseconds. nfs4_retry_setlk() only parks a waiter on clp->cl_lock_waitq when NFS_STATE_MAY_NOTIFY_LOCK is set. Otherwise it uses nfs4_retry_setlk_simple(), which has no waitqueue at all and sleeps on a bare timeout starting at NFS4_LOCK_MINTIMEOUT and doubling, so a waiter that loses one poll waits a second, then two, then four. NFS_STATE_MAY_NOTIFY_LOCK is set in _nfs4_open_and_get_state() from the OPEN reply rflags. It describes the server, but is recorded per nfs4_state and can only be learned from a reply. Once a delegation is held, further opens are satisfied from it with no OPEN on the wire, so o_res.rflags is zero and the new state starts out believing no callback can arrive, even though the open that obtained the delegation was told otherwise. Record the capability on the nfs_client the first time an OPEN reply carries it, and apply it to every state built for that client. nfs_client is the right scope: the flag describes one server, CB_NOTIFY_LOCK arrives on that client's backchannel, and cl_lock_waitq is per nfs_client. This also covers a case the per-state flag misses. After the delegation is recalled the state has neither NFS_DELEGATED_STATE nor NFS_STATE_MAY_NOTIFY_LOCK, so locks go to the server and the server does send CB_NOTIFY_LOCK, but the client is in the backoff loop and ignores it. Fixes: a8ce377a5db8 ("nfs: track whether server sets MAY_NOTIFY_LOCK flag") Assisted-by: Claude Opus 5 Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit ccad8db9305cddaf0db94d2976fd377d07087e5e Author: Jeff Layton Date: Mon Nov 9 15:44:49 2026 -0500 NFS: stamp after the server's ctime following a CLONE [ Upstream commit 23b9cf773211d536147aa53ade68a88d457838ac ] nfs42_copy_dest_done() stamps the client's own c/mtime when it holds delegated timestamps. A server that stamps c/mtime on CLONE (as nfsd did before "nfsd: mark the delegation written on COPY/CLONE instead of stamping c/mtime", and as btrfs did before "btrfs: honor FMODE_NOCMTIME when cloning") can end up with a ctime newer than the client's coarse stamp, which it won't move back when the holder returns its times. The stamp didn't survive anyway: nfs_post_op_update_inode() then marks ctime invalid, so nfs_fattr_fixup_delegated() keeps the reply's ctime and nfs_update_inode() writes it over the stamp. Against a server that no longer stamps on CLONE, the client's ctime goes back to its old value until DELEGRETURN. - Pass the CLONE reply's attributes to nfs42_copy_dest_done() and raise the cached ctime to the server's before stamping. COPY returns no attributes, so it passes NULL. - Stamp before dropping i_lock, so a concurrent refresh can't take the server's times while ctime and mtime are marked invalid. - Under delegated timestamps, apply the reply with nfs_refresh_inode(), which doesn't mark ctime invalid. Fixes: 6e7daa3dad29 ("NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes") Signed-off-by: Jeff Layton Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 9da5b55903371e9fa6f454c13a19d92618213ada Author: Jeff Layton Date: Mon Nov 9 15:44:48 2026 -0500 NFS: stamp after the server's ctime when truncating under delegated times [ Upstream commit f13110f9cfb95a09d286eee561adc96c6a02664f ] A size-changing SETATTR always has the server stamp c/mtime (__nfsd_setattr(), per RFC 5661 section 18.30.4). With delegated timestamps the client discards the reply's ctime and stamps its own in nfs_vmtruncate(), clamped only against its cached ctime. A coarse client stamp can still land before the server's, which then won't move ctime back when the holder returns its times, so ctime changes after DELEGRETURN. - Raise the cached ctime to the reply's before nfs_vmtruncate() stamps, so the delegated stamp lands after the server's. - Stamp before nfs_vmtruncate() drops i_lock for truncate_pagecache(), not after. A delegation return starting in that window made the stamp a no-op, and DELEGRETURN sent the pre-truncate mtime, which the server could apply over its own truncate stamp. Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes") Signed-off-by: Jeff Layton Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 33a227920c07a05b98f8fc0a91019609fa7204b3 Author: Jeff Layton Date: Mon Nov 9 15:44:47 2026 -0500 NFS: don't let delegated c/mtime stamps go backward [ Upstream commit 427d4cd8048c8e18e7d0c7d0637e7fbec9fba078 ] With a timestamp delegation the client stamps c/mtime from its own coarse clock. That can land before the server's fine-grained ctime the client cached from the OPEN or SETATTR reply, e.g. on a WRITE right after an exclusive create. The server then either rejects the times (they don't pass dl_ctime) or can't apply the ctime, since inode_set_ctime_deleg() never moves ctime backward. Either way the c/mtime the client reported while holding the delegation changes after DELEGRETURN; git t1092 over NFSv4.2 sees a stat-dirty file. When a delegated stamp isn't after the cached ctime, use the cached ctime + 1ns instead. Compute the stamp before storing it, so lockless readers (getattr, CB_GETATTR) never see the trailing coarse time. Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes") Signed-off-by: Jeff Layton Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 40792ad5322edf2b3327bf5ef3a10fa9dd8a9df1 Author: Waiman Long Date: Mon Nov 9 14:09:54 2026 -0500 cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork() [ Upstream commit a25cc4c75fdd8921f160bc3950665889eba7374b ] Reading mems_allowed of the current task outside of cpuset_mutex critical section should be protected by using mems_allowed_seq seqlock as the nodemask can be updated concurrently leading to a torn read. Such protection is currently not implemented in cpuset_fork() for the !CLONE_INTO_CGROUP case. As a result, the child task may inherit an empty or corrupted mems_allowed nodemask. This violates NUMA memory policy constraints and causes subsequent page allocations to unconditionally fail, potentially leading to crashes or spurious OOM killer invocations for the child task. Fix that by using a read_mems_allowed_begin/read_mems_allowed_retry() loop to protect the mems_allowed read. Fixes: 06f4e9489891 ("cpuset: make sure new tasks conform to the current config of the cpuset") Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-601100b4-fa77-45fd-99f9-bfbd4385201f Signed-off-by: Waiman Long Reviewed-by: Ridong Chen Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 1851975acc26ef4c1ff251a8cf514b1352132f05 Author: Zhang Qiao Date: Tue Nov 10 17:10:42 2026 +0800 sched_ext: Fix partial-SMT core counting in calc_shard_layout() [ Upstream commit 3b1ce3e0ccba4aadbf6330a5ed8bda78f0c9353a ] calc_shard_layout() counts the cores of an LLC to spread them evenly across shards. A core is counted when its cpu is the first cpu of topology_sibling_cpumask(), but the cores scx_cid_init() builds are the siblings intersected with @llc_cpus. The sibling mask may contain cpus outside @llc_cpus - siblings which landed in another node or LLC unit, or offlined siblings on archs that keep them in the mask (mips, sparc64). A core whose first sibling is such a cpu is never counted, so cores_per_shard and nr_large come out too small and the shards end up uneven. Count a core at its first sibling in @llc_cpus, matching the cores the build loop constructs. Fixes: e2c841b91bf9 ("sched_ext: Add CID sharding") Signed-off-by: Zhang Qiao Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 85acbbcaca9edf5e9776163abf3fc764c617c7e3 Author: Eric Dumazet Date: Wed Nov 4 10:28:51 2026 +0100 bonding: fix slave_cnt leak on XDP enslave failure [ Upstream commit a978095699641d4f83a32b499a981c419c94abca ] bond_enslave() increments bond->slave_cnt before setting up XDP on the new slave. If that setup fails (slave has no XDP support, already has an XDP program, or dev_xdp_propagate() fails), the error path jumps to err_sysfs_del, which never decrements slave_cnt. Each failed enslave therefore leaves slave_cnt one too high: - SIOCBONDINFOQUERY reports a wrong num_slaves, - balance-rr picks slave ids beyond the end of the slave list, so bond_get_slave_by_id() falls back to the first usable slave and transmit is skewed toward it. Reproducer: ip link add bond0 type bond mode balance-rr ip link set bond0 xdpdrv obj xdp_dummy.bpf.o sec xdp for i in 0 1 2; do ip link add d$i type dummy ip link set d$i master bond0 # fails: Slave does not support XDP done num_slaves read via SIOCBONDINFOQUERY is 3 before this patch, 0 after. Add an err_dec_slave_cnt label ahead of err_sysfs_del and use it from the three XDP failure paths, which are the only failures after the increment. Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver") Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261104092851.688361-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 720f35b64fc736c70343407e00318874f32ef0e3 Author: Orgad Shaneh Date: Mon Nov 2 06:43:24 2026 +0000 net: mana: fix XDP_REDIRECT of pre-allocated RX buffers [ Upstream commit 67869597fab06abaa5b977cb7004532269fc960b ] mana_pre_alloc_rxbufs() fills the RX rings with plain pages from dev_alloc_pages() (from_pool == false), but the rxq is registered with MEM_TYPE_PAGE_POOL and mana_run_xdp() builds every xdp_buff with that rxq info. mana_rx_skb() frees a !from_pool buffer correctly on XDP_PASS, XDP_TX and XDP_DROP, but a redirected buffer is freed through its memory model: __xdp_return() hands the plain page to page_pool_put_full_netmem(). This triggers the WARN in include/net/page_pool/helpers.h, breaks the page refcount, RX refills fail and the queue stops receiving. The pre-allocated buffers fill the whole ring of every rxq created by an MTU change, by ethtool -L / -G and, since commit 730ff06d3f5c ("net: mana: Use page pool fragments for RX buffers instead of full pages to improve memory efficiency."), by every XDP attach and detach. So on current kernels the first ring of redirected packets after attaching an XDP program always hits this. Reproduced on 7.2.11, and on 6.12.113 after ethtool -L, on an Azure MANA VF: an XDP program that redirects UDP to an XSKMAP with an AF_XDP socket in copy mode gives WARNINGs at __xdp_return+0x249 (stack __xsk_map_redirect, xdp_do_redirect, mana_run_xdp, mana_poll), then the queue stops. Give each rxq a second xdp_rxq_info registered with MEM_TYPE_PAGE_SHARED, the model these buffers had before the page pool was added, and use it for buffers that are not from the pool. Those buffers are already DMA-unmapped by mana_refill_rx_oob() before XDP runs, and page_frag_free() frees them whatever their order. Allocating the pre-allocated buffers from the page pool instead would need the pools to exist before the rxqs and to outlive them, a much larger change. Found, fixed and tested with an AI coding assistant (Claude Code). Fixes: b1d13f7a3b53 ("net: mana: Add page pool for RX buffers") Signed-off-by: Orgad Shaneh Link: https://patch.msgid.link/20261102064324.806414-1-orgads@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit cb3501473d594e4e73e6978e3aa773f63a976804 Author: Denis V. Lunev Date: Fri Nov 6 19:14:59 2026 +0100 ovl: release the upperdir/workdir in-use locks before the umount sync [ Upstream commit cb6c084182d4c69b7eeff0bd519dd7e018749602 ] The in-use locks on upperdir and workdir are released by ovl_free_fs() from ->put_super(). generic_shutdown_super() calls sync_filesystem() before that, and ovl_sync_fs() syncs the whole upper filesystem, so the locks stay held across a journal commit and a cache flush of the upper fs after the overlay is gone. With index=on a new overlay that uses the same upperdir, or uses it as a lowerdir, fails to mount in that window: overlayfs: upperdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection. Userspace hits this when the last reference is not dropped by umount(2) itself. Docker with the containerd snapshotter mounts a snapshot on a thread with a private mount namespace for docker cp and for buildkit, and the superblock dies when that thread exits, after the reply to the client has gone out. The next request then gets EBUSY. The window grows with the flush latency of the upper fs and is there even if nothing was written through the overlay, as the mount itself dirties the upper. ->kill_sb() is called once s_active drops to zero, with no mount and no open file left. Release the locks there, before generic_shutdown_super() runs. What the dying superblock still does to the upper fs, the sync and dropping its references to upper dentries and inodes, does not touch the contents of upperdir or workdir. ovl_free_fs() still releases the locks for a failed mount, so clear the *_locked flags to keep it from unlocking a second time and dropping the lock of a newer mount. This takes the sync out of the window but does not close it: the final mntput of a dying mount namespace runs from task_work, after the exiting thread may have reported completion. Userspace that needs the directories free should umount(2) before saying the job is done. Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs") Cc: Miklos Szeredi Cc: Amir Goldstein Cc: Pavel Tikhomirov Signed-off-by: Denis V. Lunev Signed-off-by: Amir Goldstein Signed-off-by: Sasha Levin commit 98ef41482363a4be954ebfa3df0c9268a4556461 Author: Tianyi Gao Date: Tue Nov 3 20:00:36 2026 +0000 net: fix mac_len of skbs copied by generic XDP [ Upstream commit 71578e43b8a6723025579a08a707f4975a3cd567 ] skb_pp_cow_data() copies the header fields of the old skb with skb_copy_header(). skb_copy_header() does not copy mac_len. Generic XDP uses skb_pp_cow_data() for programs with frags support. After such a program, the skb can have mac_len 0. cpu_map_generic_redirect() and tc ingress then get the position of the Ethernet header wrong. Copy mac_len in skb_pp_cow_data(), as dev_map_generic_redirect() does after skb_copy(). Fixes: e6d5dbdd20aa ("xdp: add multi-buff support for xdp running in generic mode") Signed-off-by: Tianyi Gao Reviewed-by: Toke Høiland-Jørgensen Link: https://patch.msgid.link/20261103200036.65764-3-tianyi@cloudflare.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit d8d0d0a726332272a4c6ce025635c603365f5265 Author: Mehmet Fide Date: Sun Oct 25 20:36:15 2026 +0100 wifi: mac80211: abort chanswitch when leaving an IBSS [ Upstream commit 12f97c692dcbce088554a5530c79c55174ccee1a ] ieee80211_ibss_disconnect() leaves CSA active, as ieee80211_stop_mesh() did until commit ac7472a24bd4 ("wifi: mac80211: abort chanswitch when leaving a mesh"). An IBSS left during its countdown and joined again refuses every new channel switch with -EBUSY. Abort the channel switch the same way. Fixes: cd7760e62c2a ("mac80211: add support for CSA in IBSS mode") Reported-by: Luka Gejak Closes: https://lore.kernel.org/linux-wireless/796598480d47c5bf474d11828769e864b8209558@linux.dev/ Signed-off-by: Mehmet Fide Reviewed-by: Luka Gejak Link: https://patch.msgid.link/20261025193615.1123718-1-mehmet.fide@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin commit 40bc4b25f779ae13e2dd681a93c1861c3a559a38 Author: Johannes Berg Date: Tue Nov 10 10:10:38 2026 +0100 wifi: mac80211: mesh: don't linearize SKBs unnecessarily [ Upstream commit 6a6db144d96352967623f38692dfc4b4fb814518 ] If mesh fast-xmit cannot be used due to aggregation not being fully set up yet, there's no need to linearize the SKB. Avoid that, which addresses a stale pointer issue in the caller. Change-Id: I6b93e6c7587faf8749f8366ed574ee2b79fd47a5 Fixes: 8b0f5cb6bc7c ("wifi: mac80211: use mesh header cache to speed up mesh forwarding") Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin commit 01c0c3e9f37afa757d903d7594ea165c95f6f471 Author: Loïc Kassel Date: Fri Oct 23 19:21:54 2026 +0200 wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer [ Upstream commit 0da2be70425b21acf6e11bcf02f8a10fd55e85b0 ] The simulated TSF is based on boottime, and the beacon timer is re-armed with an absolute expiry derived from the TSF through mac80211_hwsim_tsf_to_boottime(). The timer itself is however still set up with CLOCK_MONOTONIC. Boottime keeps running while the system is suspended, monotonic does not. After the host has been suspended once, every beacon is therefore scheduled too late by the total time spent in suspend, and APs practically stop sending beacons. Set the beacon timer up with CLOCK_BOOTTIME so that it is consistent with the TSF. Fixes: 933f5bec98a1 ("wifi: mac80211_hwsim: register beacon timer by calculating TBTT") Closes: https://lore.kernel.org/linux-wireless/CAAzpgGdksHZjx4jc20zqnAG_PQ2e1ggANQjt2eiycUiWc+vPHg@mail.gmail.com/ Signed-off-by: Loïc Kassel Link: https://patch.msgid.link/20261023-hwsim-beacon-clock-v1-1-9b3f3ffc099b@gmail.com [remove useless commit message fluff] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin commit 53abd5697ec283cfb108ccbbdc9cbea4cdef004b Author: Kyle Zeng Date: Wed Nov 4 12:35:30 2026 +0100 ipvlan: make outbound skb headers writable [ Upstream commit a45dbf182137275f44ad7c8bc8acd23f7af6b2cf ] In L3 and L3S modes, ipvlan_process_v4_outbound() and ipvlan_process_v6_outbound() hand the skb to ip_local_out() and ip6_local_out(). The IP output path assumes it owns the network header: __ip_local_out() rewrites tot_len and the header checksum, and transport-mode XFRM can memmove the network header into the headroom when xfrm_skb_check_space() finds enough room, without copying. The skb reaching ipvlan can have its header shared with another skb, for example after an AF_PACKET tap on the ipvlan device or a tc mirred mirror action. pskb_network_may_pull() only makes the header linear; it does not unshare an already linear head. The writes above then modify the other skb. If that skb is on the receive path and its IPv4 header was already validated, IPv4 option processing can use the modified header, write past the linear data, and corrupt skb_shared_info. Use skb_cow_head() before taking header pointers and entering the local IP output path, like ip_forward() does with skb_cow() before it touches the header. Only checking skb_header_cloned() is enough here: skbs that TCP transmits are clones of the write-queue skb, whose header area has been released with __skb_header_release(). Their headers are private, so they are not copied, which avoids a reallocation for every TCP segment sent through an ipvlan slave. If the allocation fails, the existing error accounting and drop paths are used. L2 mode is unaffected. [edumazet: use skb_cow_head() instead of skb_unclone() to avoid copying every TCP segment, reword changelog] Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Kyle Zeng Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261104113530.986664-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 54a0b6c82bc5e01565f14de0add0bababb57e449 Author: Kyle Zeng Date: Wed Nov 4 14:29:00 2026 +0100 net: require a full socket in sock_confirm_neigh() [ Upstream commit c78b47704934e44442f4e48bfdcc99039e3b85a5 ] An skb can retain dst_pending_confirm after its original output and socket owner have changed. For example, a raw MSG_CONFIRM packet can cross veth, have a TCP request socket assigned by TPROXY, and be bridged into gretap. Neighbor output for the outer packet then calls sock_confirm_neigh() with the request socket in skb->sk. The helper unconditionally treats a non-NULL skb->sk as a full socket when accessing sk_dst_pending_confirm. TCP request and TIME_WAIT sockets do not contain that field. This produces an out-of-bounds four-byte read and, if the word is nonzero, an out-of-bounds four-byte zero write. A KASAN-enabled kernel reports: BUG: KASAN: slab-out-of-bounds in ip_finish_output2+0xc9f/0xd60 Read of size 4 at addr ffff8880bdc3d880 by task tproxy_dst_conf/1771 Require sk_fullsock() before accessing the socket field, moving the existing helper earlier in the header to make it available here. Keep neigh_confirm() independent of the socket type so the skb's neighbor confirmation still works, including for socketless packets. This also covers the IPv6, VRF, and BPF neighbor-output callers. Fixes: 4ff0620354f2 ("net: add dst_pending_confirm flag to skbuff") Signed-off-by: Kyle Zeng Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261104132900.1071940-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 3181e2e6f7c586cd000683511490eec867a406b0 Author: Kyle Zeng Date: Wed Nov 4 14:17:44 2026 +0100 net: protect negative destination advice with RCU [ Upstream commit 4b77d2792c3e482afa108c08f224ea6fa396d80b ] SO_CNX_ADVICE calls __dst_negative_advice() while holding the socket lock. Connected UDP sends can still invalidate or replace sk_dst_cache without that lock. A concurrent sk_dst_check() can drop the final destination reference and allow an RCU callback to destroy it while __dst_negative_advice() retains only a borrowed pointer. This can cause a use-after-free while accessing dst->ops or running the negative_advice callback. The writer-side ordering fixed by commit 92f1655aa2b2 ("net: fix __dst_negative_advice() race") does not protect this reader from an independent cache replacement. Hold an RCU read-side critical section across the lookup and callback. This follows the datagram release callbacks and covers IPv4, IPv6, and XFRM advice without changing cache-reset or reference-ownership rules. Fixes: a87cb3e48ee8 ("net: Facility to report route quality of connected sockets") Signed-off-by: Kyle Zeng Signed-off-by: Eric Dumazet Reviewed-by: Jiayuan Chen Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261104131744.1056562-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 95b15b334a57d43f53fce45bfce14d7963b70b21 Author: Mark Bloch Date: Wed Nov 4 20:39:47 2026 +0200 net/mlx5: Lag, free steering resources on LAG destroy failure [ Upstream commit deceb70d1303105e4368a19b251a6fd94428eb11 ] When firmware fails to destroy LAG, driver returns before releasing the steering resources, leaking the associated software objects. The bond is no longer eligible for offload, and the driver cannot prevent its teardown. Release the steering resources even if LAG destruction fails. Preserve the error logging and return the original error after cleanup. Fixes: da6b0bb0fc73 ("net/mlx5: Lag, use steering to select the affinity port in LAG") Signed-off-by: Mark Bloch Reviewed-by: Shay Drori Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261104183947.772195-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6f92d58bd65564a83c87721eb2873234eb49ad17 Author: Carolina Jubran Date: Wed Nov 4 20:31:58 2026 +0200 net/mlx5: Use only loaded devices for PTP clock operations [ Upstream commit 908561cc4b4db4510465f02f5323e98f2dc00fad ] The PTP periodic worker and PTP operations access PCI registers through the function backing the PTP clock. The PTP clock remains registered when a PCI function is suspended, so these paths can still access the function after it has been unloaded. To fix that, serialize clock hardware access with the clock mutex for all clocks and fail callbacks with -EAGAIN when there is no loaded function to service the clock. Additionally, tie the worker's lifetime to load/unload and use the devcom lock to synchronize with peer loads/unloads. Since the periodic worker is stopped during unload, the free running counter may wrap without being sampled. Reinitialize the timecounter on load using the hardware real time clock in real time mode, or the saved PHC time plus elapsed CLOCK_BOOTTIME in free running mode. This provides best effort PHC continuity across unload/load. In free running mode, elapsed time while unloaded is estimated using CLOCK_BOOTTIME rather than the PHC's adjusted frequency. Fixes: 8fc3e29be924 ("net/mlx5: Fix crash upon suspend/resume") Signed-off-by: Carolina Jubran Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261104183158.758314-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6e5f98b653a2430f15f949428117d594a3dd0526 Author: Arnd Bergmann Date: Thu Nov 5 17:19:13 2026 +0100 net: octeontx2: fix building without DEBUGFS [ Upstream commit 2007f7e37142ebdb341949dca8098f898cc871f7 ] This error came up on my randconfig tests this week: drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c: In function 'npc_cn20k_debugfs_init': drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c:392:55: error: 'struct rvu' has no member named 'rvu_dbg'; did you mean 'rvu_dl'? 392 | debugfs_create_file("mcam_layout", 0444, rvu->rvu_dbg.npc, The problem here is that the rvu_dbg member is hidden in an #ifdef block, but the reference to it is not. Remove the #ifdef and waste a few bytes in the structure in this config. Note that the debugfs_create_file() call end up ignoring the arguments, so the actual debugfs implementation is still ignored here. Fixes: 528530dff56b ("octeontx2-af: npc: cn20k: add debugfs support") Signed-off-by: Arnd Bergmann Acked-by: Ratheesh Kannoth Link: https://patch.msgid.link/20261105161945.1658464-1-arnd@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit de93ba920905460596d2c10fb808dfdc6784cdcd Author: Li RongQing Date: Wed Nov 4 09:52:17 2026 +0800 team: fix promisc/allmulti leak in team_port_add error path [ Upstream commit ff618cb00a645f1e3f89068c5fbda3f3a7f4ae63 ] team_port_add() increments the port's promiscuity and allmulti counts before calling team_dev_type_check_change(). If the latter fails, the error path does not undo these increments, leaving the port in promiscuous and allmulti mode even though it was not successfully added to the team. Undo the promiscuity increment under err_set_slave_allmulti and the allmulti increment under err_set_dev_type, so each error label only reverts what was successfully applied, matching the cleanup performed by team_port_del(). With the promiscuity rollback now living under err_set_slave_allmulti, the inline dev_set_promiscuity(port_dev, -1) in the dev_set_allmulti() failure branch becomes redundant: that branch already jumps to err_set_slave_allmulti, which undoes the promiscuity increment. Drop the inline call to avoid doing it twice. Found by source code audit. Fixes: 0ae9cfc454ea ("team: Move team device type change at the end of team_port_add") Signed-off-by: Li RongQing Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20261104015217.2222-1-lirongqing@baidu.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 8f0d548d0c88b401a36449fb832556f2834585e1 Author: Yaroslav Dudkov Date: Wed Nov 4 19:56:54 2026 +0000 ipv6: ignore link state in gateway check [ Upstream commit b76bcf3fff9332076d92de47a80d12fd3d5268e2 ] IPv6 route cannot be added in table when all following conditions are true: - gateway is not link-local address - ignore_routes_with_linkdown=1 on device - nexthop has no carrier - gateway is not present or covered by any route in table already Also multipath routes addition is invalidated by kernel even if only one of added nexthops satisfies all above conditions. Reproducer: ip netns add t ip -n t link add va type veth peer name vb ip -n t link set va up ip -n t addr add fd00::1/64 dev va nodad ip netns exec t sysctl -w \ net.ipv6.conf.va.ignore_routes_with_linkdown=1 ip -n t -6 route add 2001:db8::/64 via fd00::2 dev va # added ip -n t -6 route add 2001:db8::/64 table 100 via fd00::2 dev va # RTNETLINK answers: No route to host ip -n t -6 route show table all ip netns del t Route should be added because: - RT6_LOOKUP_F_IGNORE_LINKSTATE in commit d5d32e4b7668 ("net: ipv6: Do not consider link state for nexthop validation") was added for this - the same route is valid in main table (when no specifying table id while adding route) - fib6_nh_init() initializes nexthops with no carrier - IPv4 already does this (fib_check_nh_v4_gw() ignores link state using the FIB_LOOKUP_IGNORE_LINKSTATE flag) Before commit b2c709cce682 ("ipv6: Convert gateway validation to use fib6_info") rt6_lookup() was used for checking if nexthop is valid, rt6_lookup called rt6_device_match() which does not check the link state. After change rt6_lookup() to fib6_lookup() find_match() under fib6_lookup() started to invalidate linkdown devices, because RT6_LOOKUP_F_IGNORE_LINKSTATE is not passed to it. Adding RT6_LOOKUP_F_IGNORE_LINKSTATE to flags for ip6_route_check_nh() solves the problem. RT6_LOOKUP_F_IGNORE_LINKSTATE is already used inside the first search ip6_nh_lookup_table() and fixes the bug in second search fib6_lookup(). Also RT6_LOOKUP_F_IGNORE_LINKSTATE isn't read inside fib6_select_path(). Fixes: b2c709cce682 ("ipv6: Convert gateway validation to use fib6_info") Signed-off-by: Yaroslav Dudkov Reviewed-by: Hangbin Liu Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261104195655.1406837-2-aroslavdudkov622@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 510421d14d78a741c22616cc444703e4618f2b6a Author: Gal Pressman Date: Wed Nov 4 20:37:15 2026 +0200 net/mlx5: Bridge, fix bogus MDB offload errors [ Upstream commit c714f324eac17b2df03419b5cd5368687efd8e27 ] MDB add operations are queued on the switchdev deferred queue (SWITCHDEV_F_DEFER), while vlan object deletions are handled synchronously. A 'bridge vlan del' can overtake an MDB add that is still queued, and the vlan is already gone by the time the driver is called. The two operations are independent in practice: in my test, the MDB add is triggered by assigning the VF an IPv6 address (hence joining a solicited-node multicast group), while another process deletes the vlan from its representor. Racing 'bridge mdb add' against concurrent 'bridge vlan del' could result in: [ 5390.967651] mlx5_core 0000:08:00.0: E-Switch: Failed to lookup bridge port vlan metadata (vport=1) [ 5390.969120] mlx5_core 0000:08:00.1: E-Switch: Failed to lookup bridge port vlan metadata to create MDB (MAC=33:33:ff:12:00:05,vid=2204,vport=1) [ 5390.971676] mlx5_core 0000:08:00.1 eth4: Failed to add Port Multicast Database entry (object id=2) with error: -EINVAL (-22). Failure in updating the port's Multicast Database could lead to multicast forwarding issues. The error cannot reach anyone that could do anything with it, switchdev returned success to the bridge as soon as the MDB object was queued, and the errno only flags the entry as offload failed. The end result is correct either way, if the MDB has been offloaded before the vlan was deleted, mlx5_esw_bridge_port_mdb_vlan_flush() would have removed it. The FDB path already treats this as a harmless race, mlx5_esw_bridge_port_vlan_lookup() reports it on 'info' logging level and skips the offload. mlxsw did the same in [1]. Skip the MDB offload, report on 'info' logging level and return -EOPNOTSUPP: switchdev_port_obj_add_deferred() does not log it, and br_switchdev_mdb_complete() skips the port group flag update. [1] Commit 17b334a876fe ("mlxsw: spectrum_switchdev: Don't warn about valid situations") Fixes: 70f0302b3f20 ("net/mlx5: Bridge, implement mdb offload") Signed-off-by: Gal Pressman Signed-off-by: Jianbo Liu Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261104183715.771390-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6f91634cb38a76be8464bb3ebdf16b0a7b496706 Author: Kuniyuki Iwashima Date: Wed Nov 4 16:27:56 2026 +0000 af_unix: Remove gc_in_progress check in unix_peek_fpl(). [ Upstream commit 0edbc945eb9edd0086f25b151a79cfe4adc0dfa8 ] unix_vertex_dead() and unix_peek_fpl() are synchronised with unix_peek_seq to prevent GC from purging a live socket's recvq. unix_peek_fpl() skips the synchronisation if gc_in_progress is false. However, on weakly ordered arch, GC might have already started working while the write to gc_in_progress is buffered. This does not occur on x86. This is an unlikely path that happens only when AF_UNIX fd is peeked so not worth complicating. Instead of adding memory barriers in unix_gc() and unix_peek_fpl(), let's simply remove the broken short-circuit. Fixes: e5b31d988a41 ("af_unix: Give up GC if MSG_PEEK intervened.") Reported-by: Qihang Tang Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261104162858.991930-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit a7ae91388510d6e3bedda522a4c695740c3dd73b Author: Kuniyuki Iwashima Date: Wed Nov 4 08:20:55 2026 +0000 af_unix: Convert unsigned long to u64 for GC. [ Upstream commit d5f898d4c47217ce42506698a3a98741393217b7 ] Lim Chanyoun reported that unix_vertex_max_scc_index could wrap around on 32-bit kernels, which confuses GC into purging a live socket receive queue. I apparently designed GC with u64 in mind to avoid wraparound. [0] Let's make it true on 32-bit kernels. Note that unix_vertex.{out_degree,index} are converted for consistency; they are bounded by the number of allocated objects and do not exceed UINT_MAX on 32-bit kernels. Fixes: 4090fa373f0e ("af_unix: Replace garbage collection algorithm.") Link: https://lore.kernel.org/netdev/20240228030508.31297-1-kuniyu@amazon.com/ #[0] Reported-by: Lim Chanyoun Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261104082058.452188-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0f453d221d53bbe5ce00c2f80c9948f5570cb55d Author: Francesco Valla Date: Sun Nov 8 18:41:17 2026 +0100 spi: virtio: move teardown to .remove() [ Upstream commit 9060f5ba658c9b0a7332be55b3d8abfc2b08618b ] The .remove() callback is not marked as optional for a virtio_driver, and thus a missing one is a bug. Moreover, the virtio framework expects a driver to reset the device it controls during teardown and explicitly checks for this reading the device status and WARNing in case it is still running. Any devm cleanup action gets however called after that check, leading to the WARN_ON condition to always be true for spi-virtio; thus, an empty remove() is not an option. Move the cleanup actions to the .remove() callback of the driver and adapt the surrounding code to the new behavior. Fixes: f98cabe3f6cf ("SPI: Add virtio SPI driver") Signed-off-by: Francesco Valla Link: https://patch.msgid.link/20261108-spi_virtio_remove-v1-1-fda5f0996290@valla.it Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 943450de8fc7679859dbdaa201b46b2f7ebfb019 Author: Jiayuan Chen Date: Wed Nov 4 19:57:26 2026 +0800 net: raw: fix ICMP unreachable sent when receive queue is full [ Upstream commit 45441a94d50200f1478c52857725e6df624bf2ad ] It's found in a raw socket application. When the application doesn't read packets in time, the client receives ICMP Protocol Unreachable, which makes the client abort the session. The reason is that the server hits the sk_rcvbuf limit, and raw_v4_input() skips the socket before setting 'delivered', so it returns 0. Then ip_protocol_deliver_rcu() sees 'raw' is 0, thinks no one handles this protocol and calls icmp_send() to send ICMP Protocol Unreachable. IPv6 has the same issue, ip6_protocol_deliver_rcu() sends ICMPv6 Parameter Problem instead. Also, we'd better run icmp_filter() and ip_mc_sf_allow() (icmpv6_filter() for IPv6) before we check sk_rcvbuf, otherwise packets rejected by ICMP_FILTER/ICMPV6_FILTER or the multicast filter are counted in sk_drops. So move the check right before skb_clone(). Fixes: d721812aa875 ("ipv4: raw: check sk->sk_rcvbuf earlier") Fixes: 026763ece881 ("ipv6: raw: check sk->sk_rcvbuf earlier") Signed-off-by: Jiayuan Chen Link: https://patch.msgid.link/20261104115732.322151-1-jiayuan.chen@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 4630cac24f1e7b7218a7ff2cb091f38365c609e7 Author: Stefano Munari Date: Tue Nov 3 00:51:33 2026 +0100 net: usb: lan78xx: resume phylink on non-reset USB resume [ Upstream commit be9587c47db16faaca5415f533637755c65a4eb0 ] lan78xx_suspend() calls phylink_suspend(dev->phylink, false) on an open interface, which always stops phylink and halts the PHY. The matching phylink_resume() is only called from lan78xx_reset_resume(). When the USB device stays powered across system sleep (e.g. s2idle) and the USB core calls .resume instead, the link stays down until the interface is brought down and up by hand. The ifdown triggers: WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0x44/0xc8 called from state HALTED Move phylink_resume() to the end of lan78xx_resume(), which both resume paths go through, and call it only if the resume succeeded and the interface was open, mirroring lan78xx_suspend(). As a side effect, lan78xx_reset_resume() no longer starts phylink on a closed interface. Tested on a Raspberry Pi 3B+ (LAN7515) with s2idle: the link now comes back up on its own after resume and ifdown no longer warns. Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management") Signed-off-by: Stefano Munari Tested-by: Oleksij Rempel Link: https://patch.msgid.link/20261102235133.23011-1-stefanomunari.sm@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 97202111a509c4db521b79710c386b730b4b3d6c Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:50 2026 +0100 idpf: free stashed XSk Rx frame when releasing the queue [ Upstream commit 3cbee39da8251098e2631a106fafcaebc7c8e66b ] idpf_xskrq_poll() stashes a partially received multi-buffer frame in rxq->xsk, with its frags on pool->xskb_list. Nothing frees or clears rxq->xsk on queue release, as idpf_rx_desc_rel() only returns the page stash sharing its storage for non-XSk queues. On ifdown, the buffers are lost to user space and, as the pool outlives the queue, the stale frags are taken as frags of the next frame. If the pool is disabled on a running interface, the queue restarts in page mode with rxq->xdp.data still pointing to an xskb of the pool, which is freed later. The page path then takes it for a partial frame, writes frag info through it and returns it to a page pool. Free the stashed frame and clear the pointer when the XSk state of the queue is cleared, while the pool is still attached. Fixes: 9705d6552f58 ("idpf: implement Rx path for AF_XDP") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-10-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 63140d3a351079f6dc2b257f89a0fe68c8b9626d Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:49 2026 +0100 ice: xsk: free stashed Rx frame when cleaning the ring [ Upstream commit d5e7a86b7cd6c38a628635baace7eb2fdce14a43 ] ice_clean_rx_irq_zc() stashes a partially received multi-buffer frame in rx_ring->xsk, with its frags on pool->xskb_list. next_to_clean is already past its buffers, so ice_xsk_clean_rx_ring(), which walks next_to_clean..next_to_use, misses the frame, and ice_vsi_cfg_rxq() later clears the pointer via ring->xdp.data. The buffers are lost to user space and, as the pool outlives the ring across ifdown/ifup or a reset, the stale frags are taken as frags of the next frame. Before commit 93f53db9f9dc ("ice: switch to Page Pool"), the frame was tracked by rx_ring->first_desc and leaked the same way. Free the stashed frame when cleaning the ring. Fixes: 1bbc04de607b ("ice: xsk: add RX multi-buffer support") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-9-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d954e0713731d71bdec8fec416bcf2e27ef98038 Author: Chenguang Zhao Date: Mon Nov 2 13:49:48 2026 +0100 i40e: xsk: fix multi-buffer XDP_PASS skb construction [ Upstream commit 76b41e83e69ae4ab23cc3535e36b780ea17e76c2 ] When AF_XDP ZC receives a multi-buffer frame and the XDP program returns XDP_PASS, i40e_construct_skb_zc() copies frags into a new skb. The copy used skb_frag_page() as the memcpy source (page metadata instead of packet data) and passed a virtual address to __skb_fill_page_desc_noacc(), which expects a struct page *. Use skb_frag_address() for the copy, attach frags with skb_add_rx_frag() so len/data_len/truesize are updated, and on dev_alloc_page() failure free the skb via the shared out path so xsk_buff_free() still runs and previously attached pages are released by kfree_skb. Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support") Signed-off-by: Chenguang Zhao Reviewed-by: Aleksandr Loktionov Reviewed-by: Jason Xing Acked-by: Maciej Fijalkowski Tested-by: Patryk Holda Signed-off-by: Tony Nguyen Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-8-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit b3849806c7975e3d8c064674607719ca6b21f181 Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:46 2026 +0100 libeth: xsk: do not free in-flight frags on XDP_TX completion [ Upstream commit 90e5d84086d95ac45197028b98ad9059b245fc1c ] libeth_xsk_tx_queue_bulk() takes the frags of a multi-buffer frame off pool->xskb_list but leaves XDP_FLAGS_HAS_FRAGS set on the head. When the head completes, libeth_xsk_buff_free_slow() frees whatever is on the list at that point. The XDPSQ can be completed by a bulk flush while the frags of a frame are being queued, or by its cleanup timer while a partial Rx frame is stashed. Those frags are then freed while in use, and the frame being queued is sent truncated. Clear the flag on the head once all of its frags are queued. Fixes: b3ad8450b4dc ("libeth: xsk: add XSk XDP_TX sending helpers") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-6-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d6ab1051176da32103a61a444788bb3c175ee9ca Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:45 2026 +0100 ice: xsk: do not free in-flight frags on XDP_TX completion [ Upstream commit 5a9b5e315e101dfa02af5d8d3b27d893ba3e5566 ] ice_xmit_xdp_tx_zc() takes the frags of a multi-buffer frame off pool->xskb_list but leaves XDP_FLAGS_HAS_FRAGS set on the head. When the head completes, xsk_buff_free() frees whatever is on the list at that point, which are the frags of a frame still being received. If ice_xmit_xdp_tx_zc() completes such a head while cleaning the ring before sending another frame, xsk_buff_get_frag() returns NULL and xsk_buff_xdp_get_dma() dereferences it. Clear the flag on the head once its frags are on the ring. As xdp_get_buff_len() then covers only the head, count Rx bytes before running the XDP program, like libeth does. Fixes: eeb2b5381038 ("ice: xsk: Tx multi-buffer support") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-5-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d28040c946d5d976759edbb9bc332fa903f46590 Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:44 2026 +0100 ice: xsk: fix leaking Rx buffers in multi-buffer path [ Upstream commit 8b7bd01b9c56c0d1f65d0e2ad304b775e0d709e3 ] ice_clean_rx_irq_zc() consumes a descriptor without freeing its buffer when a frag has zero length or when xsk_buff_add_frag() fails, which happens if the frags array is full or the fill ring has duplicates. Such buffers are lost to user space until the socket is closed. Free the buffer in both cases. xp_free() skips a duplicate already freed with the frame. Fixes: 1bbc04de607b ("ice: xsk: add RX multi-buffer support") Fixes: 93f53db9f9dc ("ice: switch to Page Pool") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-4-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 8156557a45183a47309b6606d07c5aad5df4a0a1 Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:43 2026 +0100 i40e: xsk: fix xsk_buff_add_frag() error handling in Rx [ Upstream commit a259b7ec09efec032d5521dc2eb751a959c11d15 ] When xsk_buff_add_frag() fails, i40e_clean_rx_irq_zc() frees the frame but stays on the current descriptor, so the next poll restarts from the freed head. If the frags array was full, the retry passes on a frame missing the freed frags, with its head already on the free list. If the buffer is a duplicate, every poll fails the same way and the queue stalls. Free the current buffer along with the frame and move on to the next descriptor, as ice does. The rest of the dropped frame is received as a new frame. xp_free() skips a duplicate already freed with the frame. Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support") Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-3-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 084974e4c6b226b772758eff64b06e4e99f7e8d3 Author: Maciej Fijalkowski Date: Mon Nov 2 13:49:42 2026 +0100 xsk: fix list corruption in xsk_buff_add_frag() [ Upstream commit 94ae1259175f566ed5a33f37b09b6f32a1b2d8af ] In aligned mode, a fill ring address maps straight to its pool->heads[] entry. If user space posts the same address twice, a driver can pass xsk_buff_add_frag() a buffer that is the head of the frame or is already on pool->xskb_list or pool->free_list. Re-adding a linked node corrupts the list. With buffers A, B, C, B, xsk_rcv_zc() emits two descriptors instead of four and leaves the list head pointing at a self-linked B. When the Rx ring later has no room for a frame, the xsk_buff_free() cleanup follows B into pool->free_list and passes the list head to xp_free(): BUG: kernel NULL pointer dereference, address: 00000000000000c0 RIP: 0010:xp_free+0x1a/0x50 Call Trace: xsk_rcv_zc+0xca/0x200 The head is not on any list and needs a separate check. Adding it as its own frag lets bpf_xdp_adjust_tail() free the in-use head and wrap sinfo->nr_frags to 255. Reject such buffers before adding them to the frags array, as commit e37b2abca804 ("xsk: fix NULL pointer dereference in __xsk_rcv()") does in the copy path. Callers already drop the frame on failure. Unaligned mode is not affected, as each fill ring entry gets its own xskb from pool->free_heads[]. Reproduced with a KUnit test feeding synthetic buffers to xsk_rcv_zc(), by Nagato Shiratana. Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX") Reported-by: Nagato Shiratana Signed-off-by: Maciej Fijalkowski Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261102124950.958345-2-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 48b5f549f30d8769f3db7c976d9c4a65d3a39357 Author: Kyle Zeng Date: Thu Oct 29 21:23:29 2026 -0700 net: skbuff: preserve fclone lifetime when freeing stolen heads [ Upstream commit 86706ffa990ecd46a4326f8eecbccbbd60a6cb8d ] skb_morph() can give an skb from skbuff_fclone_cache a page-fragment head without changing its fclone tag. IPv4 reassembly can produce such an skb, which can subsequently reach the GRO stolen-head path. napi_skb_free_stolen_head() puts the shell into the ordinary NAPI skb cache without dropping its fclone_ref. If the embedded companion is still live, KASAN poisons it along with the original, and later cache reuse or eviction can overwrite or free the allocation underneath it. A mirrored batman-adv DAT packet retained in a plug qdisc reproduces a KASAN use-after-free in plug_dequeue(). Use kfree_skbmem() for fclones in napi_skb_free_stolen_head(), retaining NAPI caching for ordinary skb heads. Also use kfree_skbmem() in kfree_skb_partial(), whose stolen-head branch has the same assumption about the allocation cache. This releases the shell according to its allocation kind and preserves any live companion without freeing the data that has been transferred to the receiving skb. Fixes: f450d539c05a ("skbuff: introduce {,__}napi_build_skb() which reuses NAPI cache heads") Signed-off-by: Kyle Zeng Link: https://patch.msgid.link/20261030042329.74461-1-kylebot@openai.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 6c96e3284dfcfbc64fdd8ff37fe0c7bfb1060261 Author: Mark Korenberg Date: Thu Nov 5 00:25:05 2026 +0500 ublk: publish a new device by its id only once it is set up [ Upstream commit e5c463e5074a940c644d54d8fc29aba06709aab0 ] ADD_DEV stores the device in ublk_index_idr when it allocates the id, and control commands find it there as soon as ublk_add_chdev() has initialized its struct device, before the char device is added. If dev_set_name() or cdev_device_add() then fails, ublk_add_chdev() drops the initial reference to free the device. A DEL_DEV that found the device meanwhile waits for ublk_ctl_mutex, then calls ublk_remove(): cdev_device_del() of a device that was never added, and a second put of the initial reference, which frees the device under the callers still holding references. Reserve the id with a NULL entry, which idr_find() and the idr iterators skip, and store the device once ublk_add_chdev() succeeded. Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Mark Korenberg Reviewed-by: Ming Lei Link: https://patch.msgid.link/20261105-ublk-del-gendisk-hang-v1-1-913a91a4314d@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit b0bc2e54c58b6497fe0c678bb4919adf8af7f659 Author: Mike Snitzer Date: Mon Nov 2 16:52:18 2026 -0500 NFS/localio: hold the client across an asynchronous LOCALIO probe [ Upstream commit 000a87910213562ff09f5bc38cd366ce34fccf71 ] nfs_local_probe_async() queues the client's own cl_local_probe_work without a reference on the client, and nfs_free_client() does not cancel it. The work takes a reference only once it runs. If the last nfs_put_client() comes first, for example at umount after an NFSv3 I/O queued a throttled probe, the client is freed with its work queued, and the work then runs on freed memory. Take the reference when the work is queued, and drop it when the work has run. If the work is already queued, it already holds a reference, and the one just taken is dropped. Fixes: 76d4cb6345da ("nfs: probe for LOCALIO when v4 client reconnects to server") Signed-off-by: Mike Snitzer Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit e16806810350d83ba27c1e03479212691ceba0ef Author: Avi Weiss Date: Tue Oct 27 06:56:43 2026 +0200 SUNRPC: Balance queue accounting when relocating a task [ Upstream commit f14b157168ac106cfac6d577e08726488b1b886c ] When rpc_task_set_transport() relocates a movable task from an offline transport, it releases the request and drops the transport reference without decrementing the old transport's queuelen or the switch's xps_queuelen. Releasing the task later only accounts for the replacement transport. The stale counts affect transport selection and can prevent xprt_delete_locked() from removing an otherwise idle transport. Use rpc_task_release_xprt() to balance the previous assignment before selecting a replacement. Pass clnt explicitly because rpc_task_set_client() can assign a transport before tk_client is initialized. Fixes: 82ee41b85cef ("SUNRPC don't resend a task on an offlined transport") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 0cb560f5614bc2db6e2fa08e78e4e50901a1e316 Author: Avi Weiss Date: Sun Oct 25 14:59:24 2026 +0200 SUNRPC: Balance switch queue length on transport removal [ Upstream commit 8acd94f02a960c8936df25a7af9c02c8ea87064d ] When call_connect_status() moves a task off a transport marked for removal, it decrements xprt->queuelen but leaves the switch's xps_queuelen unchanged. The stale count persists after the task finishes and skews multipath transport selection. Decrement xps_queuelen alongside xprt->queuelen, matching the normal transport release path. Fixes: 6f081693e7b2 ("sunrpc: remove an offlined xprt using sysfs") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit da7232ef437043c21497db0ce11fee503a84a283 Author: Avi Weiss Date: Thu Oct 22 21:43:17 2026 +0300 SUNRPC: preserve transport security policy when cloning clients [ Upstream commit 7783534ce5fee57adf1b9025745c9af2e1ce2ccd ] RPC client cloning does not copy the parent's transport security policy into the new client. Clones consequently lose their TLS policy and certificate/key serials, even though the shared transport remains protected. When NFSv4 migration replaces a cloned client's TLS transport, the missing security policy causes xs_setup_tcp_tls() to return -EACCES. Copy the parent's cl_xprtsec into the clone arguments before creating the new client. Fixes: 500053191297 ("SUNRPC: Plumb an API for setting transport layer security") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 19047049c9190df79c644d719ffa49e47c8cd3b0 Author: Avi Weiss Date: Thu Oct 22 21:43:16 2026 +0300 SUNRPC: preserve timeout policy when cloning clients [ Upstream commit 5b0ac1f82201c2ab2d9c31ed568cc782bac6a399 ] rpc_clone_client() and rpc_clone_client_set_auth() leave the timeout argument unset, causing rpc_new_client() to use the transport defaults instead of the parent's configured timeout. This also affects pNFS data-server clients and changes their request timeout and initial RTT calculations. Use the parent's cl_timeout when no timeout is specified. Preserve explicitly supplied timeout overrides. Fixes: 1b63a75180c6 ("SUNRPC: Refactor rpc_clone_client()") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 47986b331153e8b67b304117920371db60c48a88 Author: Avi Weiss Date: Thu Oct 22 19:55:14 2026 +0300 SUNRPC: preserve fatal network errors during RPC binding [ Upstream commit 30150b94c70eff4bf916d7d367ecf75de25d5337 ] call_bind_status() initializes status to -EIO. When an unbound transport's port lookup fails with -ENETDOWN or -ENETUNREACH and RPC_TASK_NETUNREACH_FATAL is set, the function exits the switch without updating status. The RPC task then reports -EIO instead of the network error. This can occur during NFSv3 port discovery with nconnect, when an additional transport has not yet bound. Preserve task->tk_status in the fatal branch. Leave the nonfatal retry handling unchanged. Fixes: 9827144bfb2b ("NFS: Treat ENETUNREACH errors as fatal in containers") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 54a81bb9f4eaa117cde62031e58b770d08104930 Author: Avi Weiss Date: Mon Oct 19 13:11:17 2026 +0300 sunrpc: instantiate rpc_pipefs dentry before publishing it [ Upstream commit 0cd6e563938a5b2f88ce0008eda32f9617c9d81f ] rpc_mkpipe_dentry() publishes pipe->dentry before d_make_persistent() attaches its inode. A concurrent rpc_queue_upcall() or rpc_timeout_upcall_queue() can conceivably dereference the dentry while d_inode() is NULL. Attach the inode before publishing the dentry, restoring the ordering used before the rpc_pipefs conversion refactor. Fixes: 946e2256775e ("convert rpc_pipefs") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 341c8bdc0dfe731474e40b1f5374bc7f4db7d667 Author: Avi Weiss Date: Tue Oct 20 10:14:55 2026 +0300 SUNRPC: wake poll waiters when an empty pipe is unlinked [ Upstream commit 702d55edc017632a0c39c1d4bdd579bdbadfd730 ] When an empty rpc_pipefs pipe is unlinked, rpc_purge_list() returns without waking the pipe wait queue. An existing epoll waiter can remain blocked even though rpc_pipe_poll() reports EPOLLHUP and EPOLLERR for the disconnected pipe. Wake the wait queue after clearing RPC_I(inode)->pipe so existing poll waiters are notified regardless of whether messages were purged. Fixes: 9842ef3557ab ("SUNRPC: rpc_timeout_upcall_queue should not sleep") Signed-off-by: Avi Weiss Reviewed-by: Jeff Layton Reviewed-by: NeilBrown Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 7899c2556e196e4f4e43f26eefb7f8ea879c3b63 Author: Avi Weiss Date: Mon Oct 19 15:26:30 2026 +0300 NFS: restore directory index when resuming readdir [ Upstream commit 89b91409b2342e7629b1271eba315a0f06495247 ] nfs_readdir() restores the cached folio index and cookie when resuming directory iteration, but leaves current_index at zero. In 32-bit index mode, nfs_readdir_search_for_cookie() then reports a folio-relative offset instead of the absolute entry position. Restore current_index from the saved logical folio index before searching the cache. This solution relies on the current behavior of nfs_readdir_seek_next_array(), where folio_index advances by one and current_index advances by nfs_readdir_array_maxentries() for each full, nonterminal folio. Fixes: f648022faa68e ("NFS: Convert readdir page cache to use a cookie based index") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit cc7329a3a542356c10e4fe28fbb68b4f4de1e792 Author: Avi Weiss Date: Sun Oct 18 21:30:42 2026 +0300 NFS: Fix inverted cross-directory rename check [ Upstream commit b9d518902ff1969f93d2b4787951d98e50ab0181 ] nfs_rename_is_unsafe_cross_dir() returns false for cross-directory renames, causing nfs_rename() to skip nfs_sync_inode() even when filehandles may expire on rename. Same-directory renames may instead trigger unnecessary synchronization. Current condition directly contradicts the function name/comments. Return false for same-directory renames so cross-directory renames reach the existing filehandle-volatility check. Keep the conservative fallback unchanged.. Fixes: dcd21b609d4ab ("NFS: Avoid flushing data while holding directory locks in nfs_rename()") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 80b1402861c667d8c28297aedd5dd343fde36530 Author: Avi Weiss Date: Sun Oct 18 17:15:28 2026 +0300 NFS: update ctime for atime-only UTIME_NOW requests [ Upstream commit a38d7cc8c90f0d093550487c2905b51db0be1522 ] When an NFS client holds a timestamp delegation, utimensat() with atime set to UTIME_NOW and mtime set to UTIME_OMIT reaches nfs_setattr() with ATTR_TIMES_SET but without ATTR_ATIME_SET. There may be other paths that can reach here as well. The delegated-atime fast path treats this as an implicit atime update, clears ATTR_ATIME and returns success without updating ctime. Add check for ATTR_TIMES_SET along with ATTR_ATIME_SET (OR) so explicit timestamp requests use the normal SETATTR path while incidental atime updates can keep using the local shortcut. Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit c204a1f2c8e5d72f0ddf6f17893088e35d555981 Author: Avi Weiss Date: Sun Oct 18 15:38:41 2026 +0300 NFS: honor UTIME_NOW atime with explicit mtime [ Upstream commit 2ffcf17d26dabef5793aeadf75a23c595a72be08 ] When utimensat() requests UTIME_NOW for atime and an explicit mtime, the VFS sets ATTR_ATIME but not ATTR_ATIME_SET (as it should). The delegated explicit-mtime path calls nfs_set_timestamps_to_ts(), which skips atime, but nfs_setattr() then clears ATTR_ATIME, allowing the syscall to succeed without updating atime. The delegated explicit-mtime path already updates ctime locally. The VFS also supplies the requested atime value in ia_atime, even when ATTR_ATIME_SET is absent. Check ATTR_ATIME instead of ATTR_ATIME_SET to also apply the UTIME_NOW atime value supplied by the VFS. Fixes: aba41e90aade ("NFSv4.2: fix setattr caching of TIME_[MODIFY|ACCESS]_SET when timestamps are delegated") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit a92c7fcb582d243ef1b2382cd5ca7efd75ebbeaa Author: Avi Weiss Date: Fri Oct 16 18:22:10 2026 +0300 NFSv4.1: retain MDS I/O until both thresholds are met [ Upstream commit eab627dcd18a18a44a2cbee47df3058d3637ba0d ] When both size and I/O thresholds are configured, pnfs_within_mdsthreshold() uses size && io to decide whether to keep I/O on the MDS. Both variables indicate an unmet threshold, so reaching only one threshold returns false and may trigger pNFS layout acquisition while the other threshold remains unmet. Use logical OR instead of AND to stay with MDS I/O until both thresholds are met, as recommended by RFC 8881 Section 5.12.6. The new RFC contains the same threshold selection rule as RFC 5661 which is referenced in function comment. Fixes: d23d61c8d351 ("NFSv4.1 test the mdsthreshold hint parameters") Signed-off-by: Avi Weiss Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit c9315b178ab7f073e385bd7061cafd11a0859e0c Author: Zachary Huang Date: Sat Nov 7 00:08:17 2026 +0800 ASoC: es9356: fix the capture gain dB scale [ Upstream commit 412a061ebf8ce0d4d49fc7352dba8d641257b3a6 ] The two capture gain controls are declared with a TLV step of 3 (FU33, analog mic) and 6 (FU11, DMIC). The TLV step is expressed in 0.01 dB units, so this advertises 0.03 dB and 0.06 dB per step: with a value range of 0..10 and 0..3 the whole controls appear to span only 0.30 dB and 0.18 dB. The hardware steps are 3 dB and 6 dB, i.e. 0..30 dB and 0..18 dB. Measured on a MECHREVO WUJIE 14SAH (ES9356 on SoundWire link 0) by recording the same signal at all four FU11 settings: FU11=0 rms 523 (-35.9 dBFS) FU11=1 rms 1007 (-30.3 dBFS) FU11=2 rms 2011 (-24.2 dBFS) FU11=3 rms 3794 (-18.7 dBFS) That is about +6 dB per step, matching the hardware definition rather than the advertised 0.06 dB. Because userspace (alsamixer, PipeWire/WirePlumber) derives the volume from this TLV, the capture gain currently looks like a control without any usable range, which is also why the default setting seems impossible to raise from the desktop. Fixes: 5d9cb740cd38 ("ASoC: es9356-sdca: Add ES9356 SDCA driver") Assisted-by: LLM Signed-off-by: Zachary Huang Link: https://patch.msgid.link/179398129782.44051.2897523393297405157@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit b286ee1cfb2d6a0cb4b9564d15508ce33d8a0506 Author: Eric Dumazet Date: Thu Nov 5 13:40:43 2026 +0100 tcp: rate limit receive queue collapsing [ Upstream commit c2213d9b61c1d6e99645a636630ee767c7542f78 ] When a socket is over its receive buffer limit and its sk_rcvbuf can not grow, every incoming segment that needs memory goes through tcp_prune_queue(), which runs tcp_collapse_ofo_queue() and tcp_collapse() on the receive queue. Both walk their whole queue, even when there is nothing left to collapse. A peer can trigger this walk per packet, without refilling memory: 1) The segment lands last in the out-of-order queue. Since commit b0e01253a764 ("tcp: refine tcp_prune_ofo_queue() logic"), tcp_prune_ofo_queue() drops nothing, the segment is dropped and the queues are unchanged. The peer can send it again forever. 2) The segment lands second to last: one skb is pruned, and one small segment fills that space again. 3) The out-of-order queue is empty and the receive queue alone is over the limit (application not reading). Collapsing frees nothing, the out-of-order segment is dropped, and the window is not closed. 4) Collapsing frees just one skb, enough to queue the segment. The next segment is over the limit again. Only allow a collapse if at least 1/8 of sk_rcvbuf of new memory was queued in the receive queues since the previous collapse. This restores the "12.5 % of the queue capacity" amortization of the 2018 SegmentSmack fixes (CVE-2018-5390), using the same unit as the sk_rcvbuf limit, so that peers sending small (bloated) segments are not penalized. The credit is the net growth of sk_rmem_alloc in tcp_queue_rcv() and tcp_data_queue_ofo(), so that: - Coalescing a segment into the tailroom of the previous skb charges no memory, and earns no credit. - An out-of-order segment replacing or covering queued skbs only earns the memory it adds. - Duplicates earn nothing. - Data moved from the out-of-order queue to the receive queue (tcp_ofo_queue()) is not credited twice. In-order data is credited too, so that a receive queue filled by bloated in-order segments can still be collapsed when a hole appears. In-order segments are rate limited as well: a peer could otherwise send small in-order segments that each trigger a collapse freeing a single skb, enough to queue the segment, while the out-of-order queue holds many skbs that can not be collapsed. The credit is tracked in a new u32 tp->rcv_collapse_credit, placed in a hole of the tcp_sock_write_rx group: no other field moves, and tcp_sock size is unchanged. tcp_queue_rcv() now samples sk_rmem_alloc, and writes the credit until it saturates at sk_rcvbuf, so that the fast path stops writing it after a full buffer of new memory. Saturating at the goal would not work: sk_rcvbuf, and the goal with it, can grow later (for instance in tcp_clamp_window(), just before the goal is checked), and a socket over its limit can not earn more credit until the application reads. When collapsing is not allowed, tcp_prune_queue() goes directly to tcp_prune_ofo_queue(), which is cheap in the cases above. A regular flow can see a difference when it goes over its limit before 1/8 of sk_rcvbuf of new memory was queued since the previous collapse: out-of-order skbs can be pruned (even for an in-order segment filling a hole), and an in-order segment that still does not fit is dropped, with a zero window advertised, where a collapse might have made room. Fixes: b0e01253a764 ("tcp: refine tcp_prune_ofo_queue() logic") Reported-by: Chris Mason Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Reviewed-by: Kuniyuki Iwashima Reviewed-by: Neal Cardwell Link: https://patch.msgid.link/20261105124043.1543405-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit b063934a63177442c19d3f8bb06efb2a3a416385 Author: Cheng Yongkang Date: Sun Nov 1 00:14:44 2026 -0700 btrfs: handle zero num_stripes in btrfs_chunk_item_size() [ Upstream commit 8416012aa6e794a6464e073ab236f4ff862935ac ] validate_sys_chunk_array() calls btrfs_chunk_item_size() with the on-disk num_stripes before btrfs_check_chunk_valid() has checked the chunk. With CONFIG_BTRFS_ASSERT=y, a zero-stripe system chunk trips ASSERT(num_stripes) instead of being rejected: assertion failed: num_stripes, in fs/btrfs/volumes.h:714 kernel BUG at fs/btrfs/volumes.h:714! RIP: 0010:btrfs_validate_super+0x3ce7/0x4210 Call Trace: open_ctree btrfs_get_tree vfs_get_tree do_new_mount Drop the assertion and compute the size as the chunk header plus num_stripes stripes. The size is unchanged for num_stripes > 0, and a zero-stripe chunk now reaches btrfs_check_chunk_valid(), which rejects it, so the mount fails with -EUCLEAN. Suggested-by: Qu Wenruo Link: https://lore.kernel.org/linux-btrfs/d2ee0cc1-674e-4447-88da-d346122a43a4@suse.com/ Fixes: 2a9bb78cfd36 ("btrfs: validate system chunk array at btrfs_validate_super()") Signed-off-by: Cheng Yongkang [ Slightly rework the commit message. ] Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit a9d3194dea3dcc014dc4485d80e862517aed3fb5 Author: Filipe Manana Date: Wed Oct 28 16:06:27 2026 +0000 btrfs: zstd: prevent leak of workspace below maximum level [ Upstream commit bb66a38f5812f2c04abd4eb6e586a12b5a95172a ] When putting a workspace we always protect the workspace for the maximum level from reclaim, since it can be used not just for that level but as well for any level below it. However the logic is flawed because if we do the put for a workspace at level 10 for example (maximum is level 15) and there is currently no idle workspace for the maximum level because all are currently being used, we don't add the workspace to the LRU list and that can result in leaking it if we don't get more compression or decompression requests for level 10 or any level below 10. Fix this by skipping the addition to the LRU list only if the level of the workspace matches the maximum level too (besides the list of idle workspaces for the maximum level being empty). Fixes: 3f93aef535c8 ("btrfs: add zstd compression level support") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 40544643e2aafed8b1034d02b791fd1aa46ed42a Author: Johannes Thumshirn Date: Wed Oct 28 12:57:27 2026 +0100 btrfs: zoned: fix lockdep splat on mount [ Upstream commit 04df03585f0d8ef2727e043119bba2cdfac2d8d7 ] When mounting a filesystem on a zoned drive passed into a VM via a virtio-blk disk lockdep sporadically complains about a possible deadlock between BTRFS' dev_replace::rwsem and virtio-blk's vdev_mutex: ====================================================== WARNING: possible circular locking dependency detected 7.3.0-rc6+ #317 Not tainted ------------------------------------------------------ mount/7418 is trying to acquire lock: ffff888102c07860 (&vblk->vdev_mutex){+.+.}-{4:4}, at: virtblk_report_zones+0xda/0x440 but task is already holding lock: ffff8881fd725ea8 (&fs_info->dev_replace.rwsem){++++}-{4:4}, at: btrfs_load_block_group_zone_info+0x186/0xe50 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&fs_info->dev_replace.rwsem){++++}-{4:4}: down_read+0x42/0x170 btrfs_map_block+0x1a6/0xe70 btrfs_submit_bbio+0x1a3/0x910 submit_one_bio+0x93/0xd0 btrfs_readahead+0x1c4/0x200 read_pages+0x56/0x200 page_cache_ra_order+0x27c/0x410 filemap_get_pages+0x12f/0x4a0 filemap_read+0xed/0x400 vfs_read+0x240/0x340 ksys_read+0x61/0xd0 do_syscall_64+0xa3/0x4f0 entry_SYSCALL_64_after_hwframe+0x76/0x7e -> #3 (mapping.invalidate_lock#3){++++}-{4:4}: down_read+0x42/0x170 filemap_fault+0xb0/0x1a40 __do_fault+0x34/0xc0 __handle_mm_fault+0x919/0x1db0 handle_mm_fault+0x97/0x240 do_user_addr_fault+0x21d/0x690 exc_page_fault+0x8e/0x230 asm_exc_page_fault+0x26/0x30 -> #2 (vm_lock){++++}-{0:0}: __vma_start_exclude_readers+0x91/0x1b0 __vma_start_write+0x47/0xd0 vma_expand+0x4c/0x2a0 relocate_vma_down+0x126/0x200 setup_arg_pages+0x240/0x3e0 load_elf_binary+0x1be/0x1860 bprm_execve+0x2d2/0x7b0 kernel_execve+0x107/0x130 kernel_init+0xc2/0x130 ret_from_fork+0x1ff/0x2f0 ret_from_fork_asm+0x1a/0x30 -> #1 (&mm->mmap_lock){++++}-{4:4}: __might_fault+0x68/0xa0 _copy_to_user+0x22/0x70 blkdev_copy_zone_to_user+0x22/0x40 virtblk_report_zones+0x297/0x440 blkdev_report_zones_ioctl+0xfd/0x130 blkdev_ioctl+0x20f/0x2c0 __x64_sys_ioctl+0x86/0xd0 do_syscall_64+0xa3/0x4f0 entry_SYSCALL_64_after_hwframe+0x76/0x7e -> #0 (&vblk->vdev_mutex){+.+.}-{4:4}: __lock_acquire+0x15a8/0x2850 lock_acquire+0xea/0x2f0 __mutex_lock+0xa7/0x10d0 virtblk_report_zones+0xda/0x440 blkdev_report_zones_cached+0x162/0x190 btrfs_get_dev_zones+0xdc/0x2c0 btrfs_load_block_group_zone_info+0x2b6/0xe50 btrfs_read_block_groups+0x338/0xc80 open_ctree+0x1aca/0x24b3 btrfs_get_tree.cold+0x105/0x26c vfs_get_tree+0x28/0xb0 __do_sys_fsconfig+0x324/0x690 do_syscall_64+0xa3/0x4f0 entry_SYSCALL_64_after_hwframe+0x76/0x7e other info that might help us debug this: Chain exists of: &vblk->vdev_mutex --> mapping.invalidate_lock#3 --> &fs_info->dev_replace.rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&fs_info->dev_replace.rwsem); lock(mapping.invalidate_lock#3); lock(&fs_info->dev_replace.rwsem); lock(&vblk->vdev_mutex); *** DEADLOCK *** locks held by mount/7418: 3, last CPU#0: #0: ffff888110aa6868 (&fc->uapi_mutex){+.+.}-{4:4}, at: __do_sys_fsconfig+0x2ae/0x690 #1: ffff888112ba20e8 (&type->s_umount_key#31/1){+.+.}-{4:4}, at: sget_fc+0x148/0x8d0 #2: ffff8881fd725ea8 (&fs_info->dev_replace.rwsem){++++}-{4:4}, at: btrfs_load_block_group_zone_info+0x186/0xe50 Holding the rwsem was widened in 0090d6e1b210 ("btrfs: zoned: fix use-after-free due to race with dev replace"), but it now also covers calling into blkdev_report_zones_cached(). The device replace ioctl() only works on a mounted filesystem and the only caller with setting 'new' to false is read_one_block_group() which is only called during mount, so it is safe to drop the rwsem before calling into blkdev_report_zones_cached(). Fixes: 0090d6e1b210 ("btrfs: zoned: fix use-after-free due to race with dev replace") Reviewed-by: Naohiro Aota Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit bd1e6c8aacf49c9198ebe0664cc292052e597a43 Author: Johannes Thumshirn Date: Tue Oct 27 15:33:05 2026 +0100 btrfs: zoned: don't wait for ordered extents in do_zone_finish() [ Upstream commit bcad7df05237382237ad1517411721d839174009 ] do_zone_finish() calls btrfs_wait_ordered_roots(), which holds fs_info->ordered_operations_mutex while waiting for writeback. It can be reached from writeback itself: cow_file_range() `-> btrfs_reserve_extent() `-> find_free_extent() `-> btrfs_zone_finish_one_bg() `-> do_zone_finish() If another task holds the mutex and waits for that writeback, this deadlocks. In general, we want to ensure all writes in the block group to complete before finishing the zone, as relocation does. However, the current callers do not need the wait (or cannot wait) in do_zone_finish(): - Relocation already waits for reservations and ordered extents itself before calling btrfs_zone_finish(). - btrfs_delete_unused_bgs() checks that ->reserved is zero and sets the block group read-only while holding groups_sem, so there can be no in-flight data write. - btrfs_zone_finish_one_bg() is called from the allocation path and cannot wait. Dropping the wait is still safe. Once the block group is read-only, ->reserved can only drop, and for data it only drops after the ordered extent's I/O has completed. So if ->reserved is zero, no data write is left in flight. If it is non-zero, do_zone_finish() returns -EAGAIN, which all callers handle. This makes btrfs_zone_finish_one_bg() fail with -EAGAIN when it races with an allocation in the selected block group. Fixes: 393f646e34c1 ("btrfs: zoned: finish least available block group on data bg allocation") Reviewed-by: Naohiro Aota Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 22df3ca47dfd4ff3aae89289afb5ceb23a02728c Author: Johannes Thumshirn Date: Thu Sep 10 14:19:39 2026 +0200 btrfs: zoned: requeue block group if zone reset bails out [ Upstream commit c5f878eefdd4f559422a68bf49b6f59e7c10e70e ] btrfs_reset_unused_block_groups() drops the block-group from fs_info->unused_bgs before performing the work that can actually fail, the actual submission of a REQ_OP_ZONE_RESET. Every failed operation after this leaves the block-group dangling, physically reset, but the in-memory structures aren't and it is not requeued to be reset on fs_info->unused_bgs. Instead of bailing out, re-add this block-group to fs_info->unused_bgs list. Fixes: 453a73c3069a ("btrfs: zoned: reclaim unused zone by zone resetting") Reviewed-by: Daniel Vacek Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 03b6dadd0fcb77b7ebcaf3a007f0880acb4844f5 Author: Johannes Thumshirn Date: Wed Sep 9 11:45:34 2026 +0200 btrfs: zoned: fix possible UAF in wait_eb_writebacks() [ Upstream commit 8ca411c7ad2c02ae65ae208a3f7483d6e0159c4f ] wait_eb_writebacks() iterates the fs_info->buffer_tree xarray and waits for the writeback of these extent-buffers. Waiting for writeback needs to be done without the rcu_read_lock() held (because it can sleep) and thus the loop drops the rcu_read_lock() before calling into wait_on_extent_buffer_writeback(). But extent_buffers are freed through RCU, so if btrfs_release_extent_buffer_rcu() is scheduled while we're still waiting on the writeback, the extent_buffer will be freed causing a use-after-free. Similar to what is done in find_extent_buffer_nolock(), get a reference to the extent_buffer before calling into wait_on_extent_buffer_writeback() so a successful writeback does not free the extent_buffer while we still have a reference to it. Fixes: 2dd7e7bc0282 ("btrfs: zoned: wait for extent buffer IOs before finishing a zone") Reviewed-by: Daniel Vacek Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 46a94be3ce1600b7dca4be4eee32aaa0d8ea17e3 Author: Johannes Thumshirn Date: Wed Sep 9 08:47:25 2026 +0200 btrfs: zoned: only change active zone counter on successful (de)activation [ Upstream commit 5e79f39fbeea78703ac389c67a810406fa09bc94 ] btrfs_zone_activate() unconditionally decrements the reserved_active_zones counter regardless if btrfs_dev_set_active_zone() fails to set the zone active, i.e. because it raced with another call that already set the bit in the bitmask, or not. This can lead to a double decrement of the counter in case the bit has already been set. Only decrement the counter *iff* btrfs_dev_set_active_zone() successfully marked the zone in the bitmap. Mirror this behaviour when clearing the bit again. Fixes: a7e1ac7bdc5a ("btrfs: zoned: reserve zones for an active metadata/system block group") Reviewed-by: Daniel Vacek Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit d27d0beaa034ed0be72f282f9413f04879c8e7e1 Author: Samuel Leyva Date: Sat Nov 7 17:22:25 2026 -0600 ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output [ Upstream commit f392763d73356760eac3e4ab7c87b0855be0d4bb ] The speaker amplifier GPIO is driven from a SUPPLY widget. DAPM powers supplies before the rest of the path, so the amplifier is enabled while the ES8316 headphone driver and charge pump, which also feed the speakers, are still powering up. This results in an audible pop every time the speaker output is powered on. Move the speaker GPIO handling to the Speaker endpoint widget, which DAPM powers up last and powers down first, and give the codec output a short time to settle before enabling the amplifier. The headphone path is left unchanged: the Headphone endpoint widget shares its power-up rank with the codec output drivers, so moving it would not guarantee the same ordering, and it could not be tested. Fixes: 54fcd9dd44b2 ("ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec") Signed-off-by: Samuel Leyva Link: https://patch.msgid.link/20261107232225.3838-3-samuelslg03idk@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 51e75124cd0fbefcc9197e54c8369753a36be6e8 Author: Ridong Chen Date: Sat Nov 7 20:00:57 2026 +0800 cgroup/cpuset: Reset partition data when an invalid partition stays invalid [ Upstream commit ba4834fc81ddc0b500843c827c09d3ff95a317a9 ] When cpuset.cpus or cpuset.cpus.exclusive of a partition root is changed, update_cpumask() and update_exclusive_cpumask() copy the new effective_xcpus computed for the trial cpuset into the cpuset, and call reset_partition_data() only if the partition was valid before and is invalid now: if ((old_prs > 0) && !is_partition_valid(cs)) reset_partition_data(cs); An invalid partition root (old_prs < 0) that stays invalid is not covered. Its effective_xcpus is then left with the trial value, which is computed from user_xcpus() and so falls back to cpuset.cpus when cpuset.cpus.exclusive is cleared. As an invalid partition root does not own any exclusive CPUs, and rm_siblings_excl_cpus() treats a non-empty effective_xcpus of a sibling without cpuset.cpus.exclusive as owned, those CPUs can then no longer be claimed by a sibling: # A1: cpuset.cpus=2-3, cpuset.cpus.exclusive=2-3, root, with tasks # offline CPUs 2-3 -> A1 becomes invalid echo > A1/cpuset.cpus.exclusive cat A1/cpuset.cpus.exclusive.effective # 2-3, expected empty echo 3 > B1/cpuset.cpus.exclusive # -EINVAL Reset the partition data whenever the cpuset is a partition root, valid or not, and ends up invalid. As effective_xcpus may be cleared by that, also force update_cpumasks_hier() to update the subtree, so that the effective_xcpus of the descendants doesn't keep the released CPUs. Add test cases for it. Fixes: de9f15e21c55 ("cpuset: use parse_cpulist for setting cpus.exclusive") Fixes: c5866c9a007d ("cpuset: refactor CPU mask buffer parsing logic") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261101114206.2434398-1-ridong.chen%40linux.dev?part=15 Reviewed-by: Waiman Long Signed-off-by: Ridong Chen Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit c6b7786081211e49f62e553a01083f080a0907a6 Author: Vijendar Mukunda Date: Sat Nov 7 23:22:27 2026 +0530 ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler [ Upstream commit 34ea81a7f284a13d825279fdede36b7f793f9936 ] The ACP external IRQ handler is registered before sdw_amd_probe() assigns adata->sdw, so a stray interrupt in the probe window could reach the adata->sdw->pdev[i] dereference with adata->sdw still NULL. The same window exists on the teardown side: after sdw_amd_exit() frees the context but before adata->sdw is cleared by the caller. Add NULL checks for adata->sdw in acp_irq_handler() before dereferencing ->pdev[0] and ->pdev[1], and in amd_sof_handle_acp70_sdw_wake_event() for the same reason. The interrupt-status register write that acknowledges the IRQ is kept outside the guard so the hardware bit is always cleared regardless of whether the SoundWire context is live. Fixes: 96eb81851012 ("ASoC: SOF: amd: add interrupt handling for SoundWire manager devices") Signed-off-by: Vijendar Mukunda Fixes: 1f41bf67bfe3 ("ASoC: SOF: amd: add soundwire wake irq handling") Link: https://patch.msgid.link/20261107175339.3547918-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 793dbee1b36537a66f2a898b8afdb15129bfead0 Author: Vijendar Mukunda Date: Sat Nov 7 23:22:26 2026 +0530 ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler [ Upstream commit 41e06aaef9c000c1bb52d8a6f73ae66c9bd36d83 ] The ACP external IRQ handler is registered before sdw_amd_probe() assigns adata->sdw, so a stray interrupt in the probe window could reach the adata->sdw->pdev[i] dereference with adata->sdw still NULL. The same window exists on the teardown side: after sdw_amd_exit() frees the context but before adata->sdw is cleared by the caller. Add NULL checks for adata->sdw in acp63_irq_handler() before dereferencing ->pdev[0] and ->pdev[1], and in handle_acp70_sdw_wake_event() for the same reason. The interrupt-status register write that acknowledges the IRQ is kept outside the guard so the hardware bit is always cleared regardless of whether the SoundWire context is live. Fixes: e1cb350610ce ("ASoC: amd: ps: handle SoundWire interrupts in acp pci driver") Signed-off-by: Vijendar Mukunda Link: https://patch.msgid.link/20261107175339.3547918-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit b200d9064606c886c976a2222343a17fb848a23e Author: Boris Brezillon Date: Wed Nov 4 19:51:53 2026 +0000 drm/panfrost: Enable cycle counting when perfcnt is enabled [ Upstream commit 99a2e2b1690f48b074bf14a3b7d5d52f45d26ecc ] If we don't do that, we end up with invalid timestamps in the block headers. We also need to skip the warning on the cycle counter reference being other than 0 during device reset, because of perfcnt's lingering ref. Ideally this would be dealt with by splitting the reset sequence into pre and post stages, so that a hypothetical panfrost_perfcnt_pre_reset() would release the cycle counter reference. In the absence thereof, we just make do. Fixes: 7786fd108777 ("drm/panfrost: Expose performance counters through unstable ioctls") Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patch.msgid.link/20261104-panfrost-reset-races-fixes-v3-1-09868a88c351@collabora.com Signed-off-by: Adrián Larumbe Signed-off-by: Sasha Levin commit 288b16c18650b715a48a5c7f2fbea8cbc9669887 Author: Tyler Baker Date: Fri Nov 6 00:43:33 2026 -0500 ASoC: qcom: x1e80100: recreate the headset jack on card rebind [ Upstream commit 704251f9dad3cb5f93ef64ff2d547868d42de319 ] The headset jack is only created while jack_setup is false and nothing clears it, so after a card rebind it is not created again and the codecs keep a pointer to the freed jack. Clear it on link exit, as sc8280xp does. Fixes: 6b9dc2da6657 ("ASoC: qcom: Add x1e80100 sound machine driver") Signed-off-by: Tyler Baker Link: https://patch.msgid.link/20261106054333.2748248-3-tyler.baker@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 31ac7a38fb5178cab9493e7fa0a18721ad63da52 Author: Hongyang Zhao Date: Fri Sep 4 18:02:27 2026 +0800 ASoC: qcom: common: Add generic headset jack helpers [ Upstream commit 7f8dd07370f8c17f8f98f0fa98691635828b0dac ] qcom_snd_wcd_jack_setup() combines creation of the card-level headset jack with the WCD-specific operation of attaching jack detection to codecs on the TX codec DMA links. External codecs connected over MI2S also provide component jack detection, but cannot use the WCD-specific DAI filtering. Factor the common jack allocation, DAPM pin registration and headset button mappings into a private initializer. Reuse it from the existing WCD path and add a generic setup helper which attaches the jack to every codec component in a runtime. Treat -ENOTSUPP as a no-op because snd_soc_component_set_jack() uses it for components which do not provide a set_jack callback. Add a matching cleanup helper so machine drivers can detach component jack detection when the DAI link exits. The WCD setup behavior remains unchanged. Signed-off-by: Hongyang Zhao Link: https://patch.msgid.link/20260904-rubikpi-next-20260605-v3-3-f49146d85af3@thundersoft.com Signed-off-by: Mark Brown Stable-dep-of: 704251f9dad3 ("ASoC: qcom: x1e80100: recreate the headset jack on card rebind") Signed-off-by: Sasha Levin commit bc22e8a6cd9313d898eb326712ff2be734aef82f Author: Tyler Baker Date: Fri Nov 6 00:43:32 2026 -0500 ASoC: soc-core: copy the DAI link names into the card [ Upstream commit 33a130f6ed8c75ed59b12889a417a57fb80d0abf ] snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus() keep a DAI name owned by the component, which is freed when the component unbinds, so the card cannot bind again afterwards. Copy the name onto the card device, as simple-card and audio-graph-card do since commit aa173b70d372 ("ASoC: generic: keep fallback dai_name stable across rebind"). Fixes: e894efef9ac7 ("ASoC: core: add support to card rebind") Fixes: 900dedd7e47c ("ASoC: Introduce snd_soc_of_get_dai_link_cpus") Signed-off-by: Tyler Baker Link: https://patch.msgid.link/20261106054333.2748248-2-tyler.baker@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 3631d847f3ed748f3f9e22fbfdd76ef07fa8a7d3 Author: Dmitry Torokhov Date: Thu Nov 5 22:30:17 2026 -0800 gpiolib: of: return -ENOENT from of_gpio_count() stub [ Upstream commit e20e4b8cda2b4d7dd32dbd2c0875a15d92545f04 ] gpiod_count() and its firmware backends are expected to return either a positive number of GPIOs or a negative error code (-ENOENT) when no GPIOs are assigned. However, the !CONFIG_OF_GPIO stub for of_gpio_count() returns 0 instead of -ENOENT. This causes gpiod_count() to skip the platform_gpio_count() fallback (which triggers when count < 0) and erroneously return 0 to callers. Change the stub to return -ENOENT to match the real of_gpio_count() implementation and the other error-returning stubs in gpiolib-of.h. Fixes: f626d6dfb709 ("gpio: of: Break out OF-only code") Reviewed-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-3-bb47ad58642d@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 17a6a74e4c2c16d36bb120a13a303c3fabd56f50 Author: Dmitry Torokhov Date: Thu Nov 5 22:30:16 2026 -0800 gpiolib: fix fast-path cancellation in gpiod_get_array() [ Upstream commit 51c85306270972f672737dc5e28332e2b41b26f1 ] In gpiod_get_array(), when a pin on the same chip is not in hardware order and the preceding pins form a contiguous block, the fast path is cancelled by setting array_info to NULL. However, descs->info was already populated with the array_info pointer during the first iteration, leaving descs->info pointing to the aborted array_info. Consequently, subsequent array operations still use the fast path with remaining bits set in the masks and wrong hardware pin numbers. Clear descs->info alongside array_info when cancelling the fast path so callers do not erroneously use the aborted array_info. Fixes: c4c958aa64f3 ("gpiolib: Fix array members of same chip processed separately") Reviewed-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-2-bb47ad58642d@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 233b889db63c316ec558db34ae15dcb4784dc39f Author: Dmitry Torokhov Date: Thu Nov 5 22:30:15 2026 -0800 gpiolib: fix GPIO descriptor leak in gpiod_get_array() [ Upstream commit b2a161687acdc297aa91fec7fa0966b5aecf0d16 ] In gpiod_get_array(), descs->ndescs is used as the loop induction variable and is only incremented at the end of each iteration. When krealloc() fails on the first iteration (when index is 0), descs->desc[0] has already been acquired via gpiod_get_index(), but descs->ndescs is still 0. Consequently, gpiod_put_array() frees descs without releasing descs->desc[0], leaking the descriptor. Fix this by using a dedicated loop induction variable and incrementing descs->ndescs immediately upon storing the retrieved descriptor. Additionally, since the fast-path array_info setup only executes for the first element (index 0), simplify the bitmap_set() calls to start at bit 0 for count bits instead of calculating offsets from the loop index. Fixes: bf9346f5d47b ("gpiolib: Identify arrays matching GPIO hardware") Reviewed-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-1-bb47ad58642d@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit f596196b9d856b9c5815def712a291c95447ab36 Author: Jagmeet Randhawa Date: Tue Oct 20 19:07:05 2026 +0000 drm/xe/guc: Do not attribute a TDR disable to a pending suspend [ Upstream commit eb1f465e9119f7680458218a63bbb8d32844908e ] handle_sched_done() treats any SCHED_DONE with runnable_state 0 as the completion of a suspend whenever q->guc->suspend_pending is set. That is not sufficient to tell apart the two producers of a scheduling disable. When a queue is suspended, __guc_exec_queue_suspend() sets suspend_pending and queues a SUSPEND message. If a job times out before that message runs, guc_exec_queue_timedout_job() stops submission, which traps the message, bans the queue and issues a disable of its own via disable_scheduling(). When the GuC acknowledges that disable, suspend_pending is still set, so handle_sched_done() misattributes the reply to the trapped SUSPEND message. This signals the suspend fence for a queue that was never suspended, tripping the exec_queue_suspended() assert in suspend_fence_signal(), and skips the wake_up_all() the TDR is waiting on, so the TDR stalls for its full 5s timeout and then triggers an unnecessary GT reset. The suspend path marks the queue suspended before disabling scheduling, and a trapped SUSPEND message never does, so exec_queue_suspended() distinguishes the two cases. Use it to qualify the attribution, the same way the VF migration replay path already does. The trapped message is not lost: it completes the suspend once submission restarts at the end of the TDR. While here, wake guc->ct.wq after clearing pending_disable rather than before, so a waiter observes the updated state on its first re-check, and wake unconditionally since the suspend and destroy paths have waiters too. v2: Rebase onto drm-xe-next. The suspend_pending check moved under sched->msg_lock in commit cf4171a20d13 ("drm/xe/guc: Fix race around q->guc->suspend_pending access"), so the exec_queue_suspended() qualification is folded into that locked snapshot rather than reinstating an unlocked check. No functional change from v1. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Jagmeet Randhawa Reviewed-by: Niranjana Vishwanathapura Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20261020190705.20127-1-jagmeet.randhawa@intel.com Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit f2bf33cf97c7523db73376729758fad7c59267ef Author: Jagmeet Randhawa Date: Wed Sep 2 20:12:22 2026 +0000 drm/xe/guc: Fix race around q->guc->suspend_pending access [ Upstream commit a869bd4d65bc131082568743418b3876c46c3b7b ] q->guc->suspend_pending is accessed without any common lock. __suspend_fence_signal(), called from guc_exec_queue_kill() and the suspend-timeout ban path, clears the flag asynchronously. Meanwhile handle_sched_done(), guc_exec_queue_stop() and __guc_exec_queue_process_msg_suspend() check the flag and then call suspend_fence_signal(), which asserts that it is still set. As the check and suspend_fence_signal() are not atomic, the clear can land in between and trip the xe_gt_assert(q->guc->suspend_pending). Rather than serializing those clears, drop them. Signalling the suspend fence from kill or from the suspend-timeout ban completes a suspend while the queue may still be executing on the hardware, so neither is a valid place to do it. Split the wake up out of __suspend_fence_signal() into suspend_wait_wake() and use that in guc_exec_queue_kill(), so a waiter still observes the killed state immediately rather than waiting out the full timeout - guc_exec_queue_wait_suspend_done() already breaks on exec_queue_killed(). The suspend-timeout ban needs no wake at all, as the waiter that timed out is its caller. suspend_pending now stays set on a killed or banned queue until it is torn down, so relax the !suspend_pending assert in __guc_exec_queue_resume() to permit that state. handle_sched_done() and guc_exec_queue_stop() can still race with each other, so take the per-queue msg_lock, which already covers the set on the suspend path, across their check-then-act. In handle_sched_done() the flag is snapshotted under the lock and deregister_exec_queue() is kept outside it. __guc_exec_queue_process_msg_suspend() is left unlocked: it runs on the scheduler message worker, which guc_exec_queue_stop() parks via xe_sched_submission_stop() before touching the flag. v2: Document that sched->msg_lock also protects guc->suspend_pending, which indicates a suspend message is in flight, in addition to the sched->msgs list (Niranjana) v3: Drop __suspend_fence_signal() from guc_exec_queue_kill() and guc_exec_queue_suspend_timeout_ban() rather than serializing them with msg_lock, keeping only the wake up in kill and guarding the !suspend_pending assert in resume (Matthew, Niranjana) Signed-off-by: Jagmeet Randhawa Reviewed-by: Niranjana Vishwanathapura Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20260902201222.30022-1-jagmeet.randhawa@intel.com Signed-off-by: Dave Airlie Stable-dep-of: eb1f465e9119 ("drm/xe/guc: Do not attribute a TDR disable to a pending suspend") Signed-off-by: Sasha Levin commit 2680ef1aca7d9d556dbacfbac0bb1f1087ad21e0 Author: Arvind Yadav Date: Tue Oct 27 14:29:52 2026 +0530 drm/xe/svm: Preserve default PAT index when resetting VMA attributes [ Upstream commit e800602296e8668b4cf143fc12d7cee4b31e64aa ] xe_vma_set_default_attributes() replaces the VMA attributes with a default structure. It sets pat_index to the saved default PAT index, but leaves default_pat_index zero. When the saved default is non-zero, the two fields no longer match. xe_vma_has_default_mem_attrs() then reports that the reset VMA has non-default attributes, triggering a warning in xe_vm_alloc_vma() during SVM garbage collection. A later reset also uses the incorrect zero value. Preserve default_pat_index when restoring the default attributes. Fixes: 4a938d3886d6 ("drm/xe: Merge adjacent default-attribute VMAs during garbage collection") Cc: Matthew Brost Cc: Thomas Hellström Cc: Himal Prasad Ghimiray Signed-off-by: Arvind Yadav Reviewed-by: Himal Prasad Ghimiray Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20261027085952.2882874-1-arvind.yadav@intel.com (cherry picked from commit ce155027427a0c76be173f19f911b414d9d686bc) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 4e845b624f8efa2d0afa18c4bcdeae4814898a85 Author: Badal Nilawar Date: Mon Nov 2 22:55:29 2026 +0530 drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry [ Upstream commit 74f1a6f03f2d46537f929a1b13f7dcd378437a4d ] Release firmware when the "LTES" manifest entry is not found in the firmware header. Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info") Reviewed-by: Daniele Ceraolo Spurio Link: https://patch.msgid.link/20261102172527.2794537-9-badal.nilawar@intel.com Signed-off-by: Badal Nilawar (cherry picked from commit 3e4b2a6349ed7258057fa95a1e58730615703dae) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit ffd57d2ccdcc29ae4812f47bc08fd6ae3fa413ea Author: Vinay Belgaumkar Date: Tue Oct 27 10:43:54 2026 -0700 drm/xe: Access GT MMIO after pcode init [ Upstream commit fc0ba46fd8278ed3e3a2c111b25036cb62dfe078 ] Allow pcode initialization to complete before we start poking around the GT MMIO space during resume as these accesses go through sgunit. We do write to MMIO registers in xe_wa_apply_tile_workarounds(), but those are in uncore space. Those accesses remain viable even during d3cold suspend. v2: Clarify about xe_wa_apply_tile_workarounds (Karthik Poosa) v3: Add fixes tag (Anshuman) Fixes: 95d0883ac810 ("drm/xe: Ensure GT is in C0 during resumes") Cc: Karthik Poosa Reviewed-by: Karthik Poosa Signed-off-by: Vinay Belgaumkar Link: https://patch.msgid.link/20261027174351.619929-7-vinay.belgaumkar@intel.com (cherry picked from commit 638d116d755ed89628ad07bde33ae7d7658db834) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit b1c5ba957ee1476e9523d9233ffdb9f4e5b524d3 Author: Vinay Belgaumkar Date: Tue Oct 27 10:43:53 2026 -0700 drm/xe: Toggle the D3Cold enable flag at runtime resume [ Upstream commit e42459b16cbf1cbcebfc1ab406140cca204fd831 ] We enable this flag during runtime suspend, need to set it back to false early during resume to maintain consistency in pci driver's internal state. d3cold_toggle() updates the root port's ability to go into d3cold via the dev->no_d3cold flag. With this patch, we are ensuring this internal state remains consistent with that of the endpoint. v2: Clarify the commit message (Matt Auld) v3: Add fixes (Karthik Poosa) Fixes: f026520367be ("drm/xe: Only set PCI d3cold_allowed when we are really allowing.") Cc: Matthew Auld Acked-by: Karthik Poosa Signed-off-by: Vinay Belgaumkar Reviewed-by: Karthik Poosa Link: https://patch.msgid.link/20261027174351.619929-6-vinay.belgaumkar@intel.com (cherry picked from commit e994e0f1ba52e4be3607ba7f952a8d835f1f6563) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 6f87a6fb3e8d10c956508c8d6c7caee45358ee56 Author: Arvind Yadav Date: Thu Oct 15 21:56:39 2026 +0530 drm/xe: Rebind BOs evicted before the first LR queue [ Upstream commit b52dcc698250e08eabdc4554a6fdb4d6f909133f ] A VM bind can evict BOs before the first LR exec queue is added. There is no preempt fence to trigger at that point. When the queue is added later, its new preempt fence is not triggered. The exec IOCTL does not validate or rebind BOs in preempt fence mode, and the rebind worker skips that work because no preempt fence is waiting. The first exec can then use stale mappings. Trigger the new preempt fence in xe_vm_add_compute_exec_queue() when the VM has evicted BOs or pending rebinds. This keeps the queue suspended until the rebind worker validates the BOs and restores their mappings. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: Matthew Brost Cc: Thomas Hellström Cc: Himal Prasad Ghimiray Reviewed-by: Matthew Brost Signed-off-by: Arvind Yadav Link: https://patch.msgid.link/20261015162639.3528278-1-arvind.yadav@intel.com Signed-off-by: Tejas Upadhyay (cherry picked from commit 928ee5d4fb1f211aa361524801c15b54603fae52) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit a3d1a2e0a38711866cec5a8a004f5423ebc556f1 Author: Raag Jadav Date: Thu Oct 22 10:42:30 2026 +0530 drm/xe/pci_error: Flush GT wedge worker before bus reset [ Upstream commit 1eb526467c96ddaf87791c2b3cefa9f93ff45358 ] With GT wedging now done async, make sure the wedge worker is flushed to avoid side-effects during PCI bus reset. Fixes: 13b9555ffb03 ("drm/xe/xe_pci_error: Implement PCI error recovery callbacks") Signed-off-by: Raag Jadav Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261022051303.282805-7-raag.jadav@intel.com Signed-off-by: Matt Roper (cherry picked from commit 0dbc1d0762bc89649aeaea98a63f6e5f786ea1b8) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit b589ee5327384d605acaf5c5a10fa495628ffd46 Author: Raag Jadav Date: Thu Oct 22 10:42:28 2026 +0530 drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() [ Upstream commit 031cc955b33b0d171fe50c870a9e601e80f14cea ] The device can be declared wedged while processing boot-time hardware errors, which can result in PM reference leak if driver probe fails before xe_device_wedged_fini() is registered. Early register the required cleanup action and fix this. Fixes: a7df563b45b0 ("drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors") Signed-off-by: Raag Jadav Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261022051303.282805-5-raag.jadav@intel.com Signed-off-by: Matt Roper (cherry picked from commit 6599a0eb0990cde96c4e66a4e1e2ae1b172e85d2) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 01679285ed8d2c89b6ea4893ba5d90d906540e64 Author: Raag Jadav Date: Thu Oct 22 10:42:27 2026 +0530 drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM [ Upstream commit a890a885b982f73e6e984e828ffda06b5121c4b6 ] xe_device_declare_wedged() callers are expected to hold a runtime PM reference. Fix it. Fixes: a7df563b45b0 ("drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors") Signed-off-by: Raag Jadav Reviewed-by: Riana Tauro Link: https://patch.msgid.link/20261022051303.282805-4-raag.jadav@intel.com Signed-off-by: Matt Roper (cherry picked from commit fc8d229d76102489b6f56538a818c285a87db1e9) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 8f6dec5e50a6471a976d5fb4e5270e802fc36cb4 Author: Raag Jadav Date: Thu Oct 22 10:42:25 2026 +0530 drm/xe/gt: Use GT ordered workqueue for wedging [ Upstream commit 8801081e5991e4939dc2d04564c46f33c3efe18d ] Currently, xe_gt_declare_wedged() stops GuC CT and initiates exec queue teardown synchronously. This can result in tdr timeout in cases where the device is declared wedged while jobs are still in-flight. Introduce a worker for GT specific wedge handling and queue the teardown on GT ordered workqueue, so we don't disrupt the scheduler while jobs are still in-flight. While at it, introduce for_each_initialized_gt() macro and use it for wedging GT. This helps avoid races in case the device is declared wedged in probe sequence before GT is initialized. Fixes: c9474b726b93 ("drm/xe: Wedge the entire device") Signed-off-by: Raag Jadav Reviewed-by: Matthew Brost Link: https://patch.msgid.link/20261022051303.282805-2-raag.jadav@intel.com Signed-off-by: Matt Roper (cherry picked from commit 913d394eb2be6536c66995affde44255d1e36493) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit efdfe64de391b146cec9003a66ba7cc379afd694 Author: Rodrigo Vivi Date: Wed Oct 21 15:45:56 2026 -0400 drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m [ Upstream commit da475c094342b6d5c8bc020b19d6900130bed047 ] When xe is built-in but configfs is a module, xe_configfs.o is not linked into xe, while IS_ENABLED(CONFIG_CONFIGFS_FS) in xe_configfs.h still exposes the real declarations, leading to undefined references. Use IS_REACHABLE() so this case falls back to the stubs, the same as CONFIGFS_FS=n. Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202610160935.Qk4ZxBxY-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202610162335.FEwMdGY9-lkp@intel.com/ Suggested-by: Matt Roper Assisted-by: LLM Reviewed-by: Matt Roper Link: https://patch.msgid.link/20261021194555.2171344-2-rodrigo.vivi@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit 30499cbd796117b63be3b59a1781c25ea3f4b27f) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit f85c74e87234fee1f90debe28835d3c905e19475 Author: Helen Koike Date: Fri Oct 16 18:40:50 2026 -0300 drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2 [ Upstream commit badac1974e098dba1a0a7f413e53f5b6ae24ab10 ] CTX_CS_INDIRECT_CTX_OFFSET default value is not retrieved from the GPU by inhibit+context save mechanism since it is not part of the Engine Context. Thus, at restore, 0x0 is programmed back to the GPU, which is an invalid value according to the PRM. This causes sporadic hangs on Alder Lake when executing test IntelAngleEnd2EndTestCases (error VK_DEVICE_LOST). Fix it by partially reverting commit c9dfd66cb91e ("drm/xe/lrc: Allow INDIRECT_CTX for more engine classes"). Re-add the programming of CTX_CS_INDIRECT_CTX_OFFSET for pre-Xe2 (in theory it should apply to all platforms, but we got an unexpected behaviour on Xe2 that still requires investigation). Fixes: c9dfd66cb91e ("drm/xe/lrc: Allow INDIRECT_CTX for more engine classes") Suggested-by: Tvrtko Ursulin Signed-off-by: Helen Koike Reviewed-by: Matt Roper Link: https://patch.msgid.link/20261016214112.1647202-1-koike@igalia.com Signed-off-by: Rodrigo Vivi (cherry picked from commit b99292acb2dce61ce50d37f54a66d84b768b8927) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit e505e09eaec9297be79dfaffda81e5f5b95e2ac2 Author: Daniele Ceraolo Spurio Date: Thu Oct 15 20:45:48 2026 +0000 drm/xe/gsc: Fix NVL-S GSC compatibility number [ Upstream commit f8795bced27bb00d74cef9de33e8a5e939c05e02 ] The compatibility number for the published GSC number is 1.0. The binary is correctly named nvl_gsc_1.bin (matching the major compatibility version number), but the driver is instead looking for compatibility 0.0 (which maps to nvl_gsc_0.bin), leading to the binary not being found. The driver supports running without GSC so this is not fatal, but all content protection features will not work without the GSC FW. Signed-off-by: Daniele Ceraolo Spurio Fixes: 8a90f0d1098f ("drm/xe/gsc: Define GSC for NVL-S") Cc: Alan Previn Cc: Julia Filipchuk Cc: Rodrigo Vivi Reviewed-by: Alan Previn Link: https://patch.msgid.link/20261015204548.147348-1-daniele.ceraolospurio@intel.com (cherry picked from commit 11f8678d6a702ab9d6abb2f50c45e82a56974068) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 06a1782642f36ae2459df020e4c85ceb94122b44 Author: Nitin Gote Date: Mon Oct 12 22:49:04 2026 +0530 drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines [ Upstream commit ddef200c67d445f978f323d947c8993570ae4756 ] The "Disable NULL query for Anyhit Shader" tuning uses xe_rtp_match_first_render_or_compute to program RT_CTRL once per GT. On a GT with no render (RCS) engine, that match falls back to a compute (CCS) engine instead, so the tuning is still written even though RT_CTRL's ray-tracing logic has no hardware behind it there. A CRI compute-only GT hits exactly this path, causing igt@xe_debugfs@check-gt-reg-sr to report a save-restore mismatch: Mismatch on 0xe530, expected 0x400 got 0x0 Restrict the rule to ENGINE_CLASS(RENDER) so it only applies where ray-tracing hardware is actually present. Every other in-tree platform in this version range (BMG, LNL, PTL, NVL) always has a render engine, which xe_rtp_match_first_render_or_compute already resolves ahead of any compute engine, so this is a no-op for them. Assisted-by: LLM Cc: Matt Roper Signed-off-by: Nitin Gote Fixes: 8d8431298f69 ("drm/xe/xe3: Disable null query for anyhit shader") Reviewed-by: Matt Roper Link: https://patch.msgid.link/20261012171901.19508-6-nitin.r.gote@intel.com Signed-off-by: Matt Roper (cherry picked from commit 65e2e108e466a2def170797a6d1b4b7849cec3a1) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 8a1baa1ebfdb6435c7104649726db61c23de4f3c Author: Karthik Poosa Date: Thu Oct 15 12:44:23 2026 +0530 drm/xe/hwmon: Handle unavailable memory controller sensors [ Upstream commit dbd199c775cbedbd1acaff96e1d7f4c398e558d9 ] Skip memory controller sensors that report invalid readings when computing the average temperature in get_mc_temp(). Return -ENXIO when no valid sensor data is available, and allow the helper to be used as an availability probe by making the output parameter optional. Signed-off-by: Karthik Poosa Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature") Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261015071434.1063785-6-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit 99ceaebb888944d00932063a649ebb41bd8af1d2) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 54953be189c4300eeb899075b4292b0f0d00f1d0 Author: Karthik Poosa Date: Thu Oct 15 12:44:22 2026 +0530 drm/xe/hwmon: Add helpers to validate thermal sensor readings [ Upstream commit f2a144e9891b397aebcfc0e88906c29bc079322d ] Add mmio_temp_valid() and mbx_temp_valid() to check whether a temperature sensor reading is valid. An MMIO value of 0xFFFFFFFF or a mailbox value of 0xFF indicates the sensor is unavailable. Gate these checks behind has_temp_sentinel, enabled on CRI currently. Signed-off-by: Karthik Poosa Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261015071434.1063785-5-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Stable-dep-of: dbd199c775cb ("drm/xe/hwmon: Handle unavailable memory controller sensors") Signed-off-by: Sasha Levin commit c9b9665b5a5d08cb866ac7e42ecad8c12c20d5f2 Author: Karthik Poosa Date: Thu Oct 15 12:44:21 2026 +0530 drm/xe/hwmon: Fix thermal sensor data handling [ Upstream commit d37dcdaa99b18995d74c2381b103e308f21e2565 ] Read all required thermal groups in get_mc_temp() and store them in a dword-aligned buffer, avoiding unaligned pcode accesses and ensuring correct memory controller temperature reporting. Store the pcode thermal data and thermal limit words as little-endian, so their per-byte views match the hardware layout on big-endian hosts. Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature") Fixes: c332fba805d6 ("drm/xe/hwmon: Expose temperature limits") Signed-off-by: Karthik Poosa Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261015071434.1063785-4-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit ca6e33701de8676118f1d039e0c00839d7de13c6) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 9a3d2724852281f254574e48c7da6329ab6505e3 Author: Karthik Poosa Date: Thu Oct 15 12:44:20 2026 +0530 drm/xe/hwmon: Decode mailbox temperature as sign-magnitude [ Upstream commit c9d8ef7f6835ddfca8259c322804038799be5641 ] The mailbox temperature is an 8-bit sign-magnitude value (bit 7 sign, bits 6:0 magnitude, range -127..127), not two's-complement. Casting the raw byte to s8 decodes negative readings incorrectly. Add mbx_temp_decode(), store the raw byte as u8, and use it in get_mc_temp() and get_pcie_temp() so temperatures are decoded correctly. Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature") Signed-off-by: Karthik Poosa Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261015071434.1063785-3-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit 1bbbd7d98fa588d5ace3d79ce56d8928f18768f5) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 8c289c73ddde8b20d0fd81c78b6933ff9d1e7953 Author: Karthik Poosa Date: Thu Oct 15 12:44:19 2026 +0530 drm/xe/hwmon: Fix pcode power limit handling [ Upstream commit 94099304b80e8c6e842c2626f603930577938f3a ] Return early on pcode read failure in xe_hwmon_pcode_rmw_power_limit() and propagate errors to callers. Replace boot_power_limit_read with per-channel read_power_limit_from_pcode[], set on the first successful pcode write, so reads and writes stay consistent even if the default limit write at boot fails. Also return PWR_LIM_EN for power label so card label visibility works. v2: Move default power limit writes to helper xe_hwmon_pcode_set_default_power_limits(). Fixes: 8aa7306631f0 ("drm/xe/hwmon: Fix xe_hwmon_power_max_write") Signed-off-by: Karthik Poosa Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20261015071434.1063785-2-karthik.poosa@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit c5b502e43f7cd6456663d5bae495551646a5e125) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 4da52c66c318f9aafcf85a4036b4c763cee5a4de Author: Karthik Poosa Date: Mon Sep 7 14:05:20 2026 +0530 drm/xe/hwmon: Use shared pcode default timeout for power limit write [ Upstream commit 1a925ad51847db376fc0acd21fc5b76fb9c36cde ] Drop the local PL_WRITE_MBX_TIMEOUT_MS macro and use the common PCODE_DEFAULT_TIMEOUT_MS for the power limit write mailbox command. This removes a duplicate timeout definition and keeps hwmon in sync with the pcode default (now 10ms). Signed-off-by: Karthik Poosa Link: https://patch.msgid.link/20260907083520.192418-3-karthik.poosa@intel.com Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling") Signed-off-by: Sasha Levin commit 244327b803db27b60383daaabe98c6e2d3c80f33 Author: Karthik Poosa Date: Mon Sep 7 14:05:19 2026 +0530 drm/xe/pcode: Increase default pcode mailbox timeout to 10ms [ Upstream commit 8721a51d44733b8b5cb41fa1bfe7fac2cf55107b ] The previous 1ms timeout may be insufficient for some mailbox commands, leading to spurious -ETIMEDOUT failures under load. Increase the default timeout to 10ms and introduce PCODE_DEFAULT_TIMEOUT_MS for a shared timeout definition, in line with pcode mailbox specification guidance. Signed-off-by: Karthik Poosa Link: https://patch.msgid.link/20260907083520.192418-2-karthik.poosa@intel.com Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling") Signed-off-by: Sasha Levin commit 140f7e0303053873bb6a0bdcc2226dff045357e4 Author: Michał Grzelak Date: Fri Aug 28 21:09:56 2026 +0200 drm/xe/pcode: match argument naming with PCODE_DATAx [ Upstream commit 68b966310260924a9dc6a5a96fd91cd190edbe2a ] Variable naming of val and val1 should match register macro naming. For xe, register macro naming of PCODE_DATA0 and PCODE_DATA1 is already synced with register name. Nevertheless there are still functions declaring val and val1. Rename val into val0 in functions declaring val1 in xe. v4->v5 - clean changelog's versioning v3->v4 - split i915 changes from xe (Jani) v2->v3 - resolve conflict from rebase v1->v2 - rebase onto drm-tip (Jani) Bspec: 19978, 19979 Suggested-by: Jani Nikula Signed-off-by: Michał Grzelak Link: https://patch.msgid.link/20260828190956.2622350-3-michal.grzelak@intel.com Signed-off-by: Jani Nikula Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling") Signed-off-by: Sasha Levin commit 9e50a0b90c3e9aa78226b66e3e3387133be704aa Author: Satyanarayana K V P Date: Tue Oct 13 15:24:20 2026 +0000 drm/xe/gt: Disable GT reset worker before engine teardown [ Upstream commit 31ac48502b2d2d953249c1cd1bf3d38667049a00 ] During tear-down process, a reset queued from Guc timeout handler can still access hwe after hwe is freed. Register a separate devm action that disables and drains the reset worker, so it runs before any engine is torn down. Fixes: 09c452d1171f ("drm/xe/gt: Synchronize GT reset with device unbind") Signed-off-by: Satyanarayana K V P Cc: Matthew Brost Cc: Piotr Piórkowski Cc: Balasubramani Vivekanandan Assisted-by: LLM Reviewed-by: Piotr Piórkowski Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20261013152417.3189567-8-satyanarayana.k.v.p@intel.com (cherry picked from commit 861590f69994e41c9ef1b65db8e9ba433f1d1c1c) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit ae46556995d2c14397927e05310f9cbecdbaf9bf Author: Satyanarayana K V P Date: Tue Oct 13 15:24:19 2026 +0000 drm/xe/guc: Protect timeout handling from device unplug [ Upstream commit 78945c8c44bb2cfd6e5d2f762535efce0cefb086 ] The GuC scheduler timeout callback accesses device and GT state while handling a timed-out job. Guard the callback with drm_dev_enter() and drm_dev_exit() so device unplug waits for in-flight timeout handling. If unplug has already started, mark the job with -ENODEV and return it to the scheduler for cleanup. Fixes: 6eb2aad402cc ("drm/xe: Move hw_engine_fini to devm managed") Signed-off-by: Satyanarayana K V P Cc: Matthew Brost Cc: Piotr Piórkowski Assisted-by: LLM Reviewed-by: Matthew Brost Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20261013152417.3189567-7-satyanarayana.k.v.p@intel.com (cherry picked from commit 3e9a95f3df5b0f9de163c5ee4e4e287750ef9655) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 44ec37a307ba1ae2505a239d5766daa95e58a7bf Author: Satyanarayana K V P Date: Tue Oct 13 15:24:18 2026 +0000 drm/xe: Prevent VF memory IRQ from accessing a torn-down engine [ Upstream commit db58638d5d0531beafafa498cffa516779876ee5 ] The VF memory IRQ handler iterates over HW engines whose names are set. Engine teardown clears hwe->gt but leaves hwe->name set, so the handler can select an engine whose GT has already been invalidated. This can cause a NULL pointer dereference in xe_hw_engine_handle_irq(). Invalidate the engine name during teardown so subsequent engine scans skip it. Signed-off-by: Satyanarayana K V P Cc: Matthew Brost Cc: Piotr Piórkowski Fixes: 6eb2aad402cc ("drm/xe: Move hw_engine_fini to devm managed") Reviewed-by: Piotr Piórkowski Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20261013152417.3189567-6-satyanarayana.k.v.p@intel.com (cherry picked from commit f88c6f2fa88bc5892b1e842972096613086c06b2) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit ebf5399d75dbb4d32f638c8a01f7b3b319d5e36b Author: Dnyaneshwar Bhadane Date: Mon Oct 12 17:55:16 2026 +0530 drm/xe/pat: Return error from xe_pat_init_early() on unknown platform [ Upstream commit 7539edbca32d63ce309f5e29cb9d595b0959466a ] xe_pat_init_early() currently only logs an error when the platform's graphics version doesn't match any known PAT table, but continues probing with an uninitialized pat.ops. This can lead to a NULL pointer dereference later when pat.ops is used. Change xe_pat_init_early() to return an int and propagate -ENODATA to xe_device_probe() so the driver fails to load cleanly instead of continuing in a broken state. Fixes: 152d7f2db978 ("drm/xe/pat: Handle unicast vs MCR PAT registers") Signed-off-by: Dnyaneshwar Bhadane Reviewed-by: Mallesh Koujalagi Link: https://patch.msgid.link/20261012122522.2307625-8-dnyaneshwar.bhadane@intel.com Signed-off-by: Matt Roper (cherry picked from commit e952337c3dbccf600ddae3bb1d38e996172ac8f8) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin commit 8010178f7ae6264fb71c9cd036e39666b452f460 Author: Alan Previn Date: Wed Sep 23 11:36:02 2026 -0700 drm/xe/gsc: Define GSC for NVL-S [ Upstream commit 8a90f0d1098f9a9019f1a076bd1ee4b6c7da7dbd ] NVL-S is identified by GSC major version 108. The compatibility version is 0.0. Signed-off-by: Alan Previn Reviewed-by: Julia Filipchuk Link: https://patch.msgid.link/20260923183600.1186943-5-alan.previn.teres.alexis@intel.com Signed-off-by: Rodrigo Vivi Stable-dep-of: 7539edbca32d ("drm/xe/pat: Return error from xe_pat_init_early() on unknown platform") Signed-off-by: Sasha Levin commit cdc73f6f00876ad96acb59826a014ce8bbee6f29 Author: Badal Nilawar Date: Tue Sep 29 22:48:24 2026 +0530 drm/xe/cri: Expose device UID through sysfs [ Upstream commit 0acb5de8d7a9aec9419f316ef06b937dde285685 ] Expose a read-only sysfs attribute, device_uid, that reports the GPU SoC's unique identifier. Bspec: 53048, 53049 Assisted-by: Claude:claude-opus-4.8 Signed-off-by: Badal Nilawar Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20260929171823.3811737-2-badal.nilawar@intel.com Signed-off-by: Rodrigo Vivi Stable-dep-of: 7539edbca32d ("drm/xe/pat: Return error from xe_pat_init_early() on unknown platform") Signed-off-by: Sasha Levin commit 174f2251875bd179bdef4f80f47638bb759d74b5 Author: Greg Thelen Date: Thu Oct 22 22:45:18 2026 -0700 kho: check fdt_phys in is_kho_boot() [ Upstream commit 58c5852ca96c58cdfdb9646870b217fc54d06a97 ] is_kho_boot() is called early in boot before the linear memory map is initialized, so calling phys_to_virt() via kho_get_fdt() there is invalid. On arm64 (and similarly in upcoming riscv64 support), this triggers BUG_ONs in debug builds, such as: kernel BUG at ./arch/arm64/include/asm/memory.h:377! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP Call trace: is_kho_boot+0x2c/0x38 (P) efi_init+0x94/0xf8 setup_arch+0xf0/0x240 start_kernel+0x84/0x490 __primary_switched+0x88/0x98 Use kho_in.fdt_phys in is_kho_boot() directly instead of translating it to a virtual address. Fixes: d6d511639185 ("kexec: introduce is_kho_boot()") Signed-off-by: Greg Thelen Reviewed-by: Pratyush Yadav (Google) Link: https://patch.msgid.link/20261023054518.3258350-1-gthelen@google.com [Pasha: massaged the changelog] Signed-off-by: Pasha Tatashin Signed-off-by: Sasha Levin commit 864eed53e970e9a46c4f315d7924bf1f987caba8 Author: Yifan Zhang Date: Wed Nov 4 17:56:53 2026 +0800 tracing/probes: bound symstr stores to reserved length [ Upstream commit 2fc0b3070d6d5dcecfed43cd0e62aa0fd4b4315c ] Traceprobe calculates dynamic string sizes before storing the values. A probed pointer can change between those passes, so fetch_store_symstrlen() can reserve space for a short symbol while fetch_store_symstring() observes a longer one. The store path then overwrites the trace record. Format the symbol into a temporary KSYM_SYMBOL_LEN buffer and copy only the bytes that fit in the reserved field, including a trailing NUL. Update __data_loc with the length actually stored so consumers do not read beyond the truncated value. Link: https://lore.kernel.org/all/179378621331.55520.2052332247156241151@stu.pku.edu.cn/ Fixes: b26a124cbfa8 ("tracing/probes: Add symstr type for dynamic events") Signed-off-by: Yifan Zhang Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit 789c6b701fb7eff9c170f72c662f4a6def1a2dc7 Author: Shao Mingyin Date: Tue Nov 3 21:54:56 2026 +0100 ata: libata-scsi: set the field pointer when rejecting CDL [ Upstream commit 7c972e73641cbe5f77f63c336de15c7a30268d49 ] ata_mselect_control_ata_feature() rejects enabling CDL while NCQ priority is enabled, but unlike its other error branches it returns without setting *fp. ata_scsi_mode_select_xlat() initializes fp to 0xffff and, when the handler fails, adds the offset of the mode page in the parameter list to it, i.e. the length of the mode parameter header and of the block descriptors. As fp is a u16, this wraps around, so the resulting sense data reports the byte before the mode page, i.e. the last byte of the mode parameter header or of the block descriptors, as the FIELD POINTER, instead of the byte containing the CDL_CTRL field that requests enabling CDL. Set *fp to 4, i.e. to the byte containing the CDL_CTRL field, like the branch rejecting an invalid CDL_CTRL value does. Fixes: df60f9c64576 ("scsi: ata: libata: Add ATA feature control sub-page translation") Signed-off-by: Shao Mingyin [cassel: set *fp to 4, the offset of CDL_CTRL in the mode page] Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-17-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 85b655df500cb70de9b2ec231467efbe387f3398 Author: Niklas Cassel Date: Tue Nov 3 21:54:55 2026 +0100 ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers [ Upstream commit 0fdb8eef88a886751e33600d446a66c529384f11 ] ata_scsi_mode_select_xlat() strips the mode page header before calling the mode page handlers, which report the position of an invalid field as an offset relative to the mode page data. It then converts this offset into an offset in the parameter list by adding the length of the mode parameter header and of the block descriptors, but not the length of the mode page header. As a result, the FIELD POINTER of the INVALID FIELD IN PARAMETER LIST sense data points 2 bytes (page_0 format) or 4 bytes (sub_page format) before the byte that is actually invalid. For example, changing byte 3 of the caching mode page in a MODE SELECT(10) parameter list without block descriptors reports byte 9 instead of byte 11. Pass the whole mode page, starting with its mode page header, to the handlers instead, like the ata_msense_*() functions, which generate the whole mode page. Offsets in buf are then the byte numbers of the mode page, as used in the mode page definitions of SPC, SBC and SAT, the handlers can compare buf with the mode page generated by the matching ata_msense_*() function without adjusting offsets, and the conversion done by ata_scsi_mode_select_xlat() becomes correct. This also allows reporting an invalid PAGE LENGTH at the PAGE LENGTH field, which was not part of buf before. As ata_scsi_mode_select_xlat() rejects SUBPAGE CODE FFh and mode pages with a wrong SPF bit, each handler only gets its mode page in a single format, so the mode page header length is known. Document what buf, len and fp are, and the return values, in kernel-doc comments for all the handlers. Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter") Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-16-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 96c13a64e95feae05e031571ccb67201f3780808 Author: Niklas Cassel Date: Tue Nov 3 21:54:54 2026 +0100 ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length [ Upstream commit a3e52dcf0fbaa1a103accef3e8861cdc250ee5d6 ] ata_scsi_mode_select_xlat() only accepts MODE SELECT parameter lists without block descriptors or with a single 8 byte block descriptor. For any other BLOCK DESCRIPTOR LENGTH, it terminates the command with INVALID FIELD IN PARAMETER LIST, and the FIELD POINTER should point at the BLOCK DESCRIPTOR LENGTH field, i.e. at byte 3 of the mode parameter header(6) or at byte 6 of the mode parameter header(10), as SPC requires the FIELD POINTER of a multiple-byte field to point at its first byte. However, the mode parameter header length and the BLOCK DESCRIPTOR LENGTH are added to the offset of the field, so the FIELD POINTER points 3 or 6 bytes after the end of the block descriptors instead. For example, a MODE SELECT(10) with a BLOCK DESCRIPTOR LENGTH of 16 reports byte 30 instead of byte 6. Do not add the mode parameter header length and the BLOCK DESCRIPTOR LENGTH to the offset of the BLOCK DESCRIPTOR LENGTH field. Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter") Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-15-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 37f2f4688a9ab7b5a057ceef9255513c291ee5c7 Author: Niklas Cassel Date: Tue Nov 3 21:54:53 2026 +0100 ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages [ Upstream commit 2a4c61cf94d48ec8560473d4fd5383583ce8809c ] When the mode page of a MODE SELECT parameter list has an unsupported SUBPAGE CODE, ata_scsi_mode_select_xlat() sets the FIELD POINTER of the INVALID FIELD IN PARAMETER LIST sense data to the SUBPAGE CODE byte of the mode page header (byte 1 of the page) if the SPF bit is set, and to the PAGE CODE byte (byte 0 of the page) otherwise. However, the SPF bit is tested on p[0] after p has already been advanced past the mode page header, so the test reads bit 6 of the first byte of the mode page data instead. If the parameter list ends with the mode page header, it even reads the byte that follows the parameter list in buffer, which is not initialized when no data beyond the parameter list was transferred. The test is not needed anyway: spg can only be non-zero for a mode page in sub_page format, i.e. with the SPF bit set, and the field in error is the SUBPAGE CODE. Always set the FIELD POINTER to the SUBPAGE CODE byte, which follows the mode parameter header, the block descriptors and the PAGE CODE byte. Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter") Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-14-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 91a4a56c512719fe33d55b304afb56282c8fb790 Author: Niklas Cassel Date: Tue Nov 3 21:54:52 2026 +0100 ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit [ Upstream commit a1eb72c477ec1320c540f27ce1e2f717d4518e62 ] ata_scsi_mode_select_xlat() accepts the caching and control mode pages both in page_0 format and in sub_page format with SUBPAGE CODE 00h. However, SAT-2 and later versions of SAT define the SPF bit of the Caching mode page and of the Control mode page as not changeable and set to zero (see SAT-6, 10.4.9 and 10.4.6), and SPC-7 (6.12, MODE SELECT(10) command) requires the device server to terminate a MODE SELECT command with INVALID FIELD IN PARAMETER LIST if the application client sets any field that is reported as not changeable to a value other than its current value. Reject a mode page with the SPF bit set to one and SUBPAGE CODE 00h, with the FIELD POINTER set to the byte containing the SPF bit. The only mode page with the SPF bit set to one that remains accepted is the ATA Feature Control mode page (control mode page, sub-page f2h), for which SAT-6 (12.3.4) requires the SPF bit to be set to one. The opposite case does not need a check: a mode page in page_0 format always has subpage code 00h, so it can never be the ATA Feature Control mode page. This also allows the mode page handlers to rely on the format of their mode page, which a later patch will make use of. Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command") Link: https://lore.kernel.org/r/20261103205448.931471-13-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 55bfce89afecd5df086b963c51f435fd0759fcc0 Author: Niklas Cassel Date: Tue Nov 3 21:54:51 2026 +0100 ata: libata-scsi: do not accept subpage code FFh in MODE SELECT [ Upstream commit b29c40dc150b0b4218c4d6844770892eb6b2f6b5 ] When the SUBPAGE CODE of the mode page in a MODE SELECT parameter list is FFh, ata_scsi_mode_select_xlat() rejects it for the control mode page, but accepts it for all other mode pages, i.e. for the caching mode page, the only other mode page that it supports. However, FFh is not the subpage code of an actual mode page: SPC-7 (7.5.2) only defines it as the MODE SENSE request code for all subpages. SUBPAGE CODE FFh only means "all subpages" in requests, i.e. in the MODE SENSE CDB for mode pages and in the LOG SELECT CDB for log pages (see SPC-5, 6.8), while the SUBPAGE CODE of a mode page in a MODE SELECT parameter list identifies a specific mode page. Also, SAT-2 and later versions of SAT define the Caching mode page with the SPF bit set to zero (see SAT-6, 10.4.9), i.e. without a SUBPAGE CODE field. Remove the ALL_SUB_MPAGES case, so that SUBPAGE CODE FFh is rejected like any other unsupported subpage. Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command") Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-12-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit ba7efde104e129f1071c26eac7ecac33e5dc0f56 Author: Niklas Cassel Date: Tue Nov 3 21:54:50 2026 +0100 ata: libata-scsi: fix MODE SELECT handling of data after the mode page [ Upstream commit 6fde0444d07ec954f3d885375e0402ff2f2e5064 ] ata_scsi_mode_select_xlat() only supports one mode page per MODE SELECT command, and rejects a parameter list with data after the mode page with INVALID FIELD IN PARAMETER LIST. However: - It does not set the field pointer, so the sense data reports 0xffff as the FIELD POINTER. - It only checks for data after the mode page after the mode page handler has been called. ata_mselect_control_ata_feature() has then already updated the CDL enabled flag of the device, even though the command is rejected and the CDL setting of the device is not changed. - For the control mode page, ata_mselect_control_spg0() does not need an ATA command, so the check is skipped, and the data after the mode page is silently ignored. Check for data after the mode page before calling the mode page handlers, and set the FIELD POINTER to the first byte after the mode page, i.e. to the first byte of the next mode page. The reason why only one mode page per command is supported is that a MODE SELECT command is translated into at most one ATA command, so update the comment accordingly. Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command") Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261103205448.931471-11-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 49bd10deaa055068caba14b21bebe2ca7fdc06b5 Author: Alexei Starovoitov Date: Mon Nov 2 06:49:22 2026 +0000 ipv6: Check the Home Address option again before its address is used [ Upstream commit 30c71476d842b094651bd7712f6c8ee8716147d0 ] ipv6_dest_hao() checks the Home Address option and sets IP6CB(skb)->dsthao to the offset of the destination options header. Later mip6_addr_swap() and mip6_destopt_reject() call ipv6_find_tlv() with that offset and use the 16 address bytes. They assume that the same header is still there. But the seg6 and ioam6 lwtunnels, the End.B6 actions, ipv6_rpl_srh_rcv() and BPF lwt progs move or rewrite the IPv6 headers and keep IP6CB(skb). Then ipv6_find_tlv() parses other bytes. It returns when the type matches, before it checks that the option is inside the header. Nobody checks the length of the option again. Thus mip6_addr_swap() can write after the data of the skb. mip6_destopt_reject() can copy that memory to an xfrm report. In ipv6_find_tlv(), check the length of an option before its type. The returned option is then inside the header, and the header is inside the linear data. In both callers, ignore an option with a length other than 16, as if ipv6_find_tlv() found none. Then the ICMPv6 error goes to the source address of the IPv6 header, and the xfrm report has no XFRMA_COADDR attribute. Nothing changes for a header that ip6_parse_tlv() accepted and that is still in its place. For the other callers an incomplete option is now absent: - ip6_find_1stfragopt() and mip6_rthdr_offset() can return another offset for the fragment header or the xfrm header, also in a forwarded packet. - calipso_skbuff_optptr() returns NULL. netlbl_skbuff_getattr() and netlbl_cache_add() then see no option. calipso_skbuff_delattr() returns 0 and the packet continues unchanged. Today it returns -EINVAL and SELinux drops the packet. It already returns 0 when an earlier option is incomplete. The receiver drops such a header in ip6_parse_tlv(). The code that moves the headers still does not reset the offset or the other fields of IP6CB(skb). If the bytes there look like a header with a Home Address option of length 16, both callers still use its address. The first tag also covers ipv6_find_tlv(), because its early return did no harm before mip6_addr_swap(). The second tag is for mip6_destopt_reject(). Fixes: 793832361fe7 ("[IPV6] MIP6: Revert address to send ICMPv6 error.") Fixes: 70182ed23d25 ("[IPV6] MIP6: Report to user-space when home address option is rejected.") Signed-off-by: Alexei Starovoitov Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261102064922.2636027-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 36d5a01be1059c6038c8e0e177d94028ada9ae6a Author: Eric Dumazet Date: Wed Nov 4 16:03:18 2026 +0100 calipso: do not charge request socket options to the listener [ Upstream commit b4a2cc6d748d3056a25812dcf5f5377a59afd02f ] calipso_req_setattr() and calipso_req_delattr() allocate ireq->ipv6_opt with ipv6_renew_options(), which charges the listener sk_omem_alloc through sock_kmalloc(). tcp_v6_reqsk_destructor() frees ireq->ipv6_opt without uncharging it, so each request socket leaks its options size from the listener budget. Once sysctl_optmem_max is reached, sock_kmalloc() fails, calipso_req_setattr() returns -ENOBUFS, and tcp_v6_route_req() drops all subsequent SYN packets. __sk_destruct() also reports an optmem leakage when the listener is destroyed. Uncharging in tcp_v6_reqsk_destructor() would not be correct: after a migration, req->rsk_listener is no longer the socket that was charged. These options belong to the request socket, there is no reason to charge them to the listener. Change ipv6_renew_options() to use kmalloc() when its sk argument is NULL, and use this from calipso_req_setattr() and calipso_req_delattr(), like cipso_v4_req_setattr() which uses kzalloc(). Note: After this patch, calipso_req_setattr() and calipso_req_delattr() no longer need the listener. Commit 10876da918fa ("calipso: Fix null-ptr-deref in calipso_req_{set,del}attr().") could be reverted in net-next (also removing the then unused sk variables), so that CALIPSO works with SYN cookies. Fixes: e1adea927080 ("calipso: Allow request sockets to be relabelled by the lsm.") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179378292255.488856.6917577451813010963@kernel.org/ Signed-off-by: Eric Dumazet Cc: Kuniyuki Iwashima Cc: Paul Moore Reviewed-by: Kuniyuki Iwashima Acked-by: Paul Moore Link: https://patch.msgid.link/20261104150318.1156620-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d3f1770da47a631f11490fdf31fe1fe52565feb3 Author: Or Har-Toov Date: Sun Nov 1 08:58:33 2026 +0200 net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum [ Upstream commit 9c1adbe7fa6cbc02c25db2039532918acf846400 ] mlx5e_rep_update_hw_counters() adds transmitted_eth_multicast.packets to vport_rx_packets but does not add transmitted_eth_multicast.octets to vport_rx_bytes. As a result, Ethernet multicast sent by a VF/SF is counted in its representor's rx_packets but not in rx_bytes. Fix by adding transmitted_eth_multicast.octets to the vport_rx_bytes sum. Fixes: 64b68e369649 ("net/mlx5: Refactor and expand rep vport stat group") Signed-off-by: Or Har-Toov Reviewed-by: Maher Sanalla Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261101065833.282261-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit bd7cfc48cd6e1bb08b42137a4d3f0971730db405 Author: Jesper L. Nielsen Date: Tue Nov 3 09:42:52 2026 +0100 net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps [ Upstream commit c4b75e64aa5b1adc75b4f1f251b5e3baa5b75b09 ] The CPTS reports the message type of a timestamp event using the PTPv2 header layout, i.e. the low nibble of the first header byte. In a PTPv1 header that byte is the upper byte of versionPTP and always 0, so every PTPv1 event is reported as message type 0, while am65_skb_get_mtype_seqid() reads the PTPv1 message type from the control field. To make PTPv1 match at all, commit 1b9e743e923b ("net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets") overwrites the whole value compared against the skb with the skb's own value once the sequence ids are equal. That throws away the event type and the port number of the event as well, so a PTPv1 skb matches any TX event with the same sequence id on either port. For PTPv1 this defeats commit a23c657e332f ("net: ethernet: ti: am65-cpsw: Use also port number to identify timestamps"). The overwritten value also sticks for the rest of the TX queue walk. Since every PTPv1 frame reads as message type 0, the hardware timestamps all PTPv1 frames to UDP ports 319 and 320, including Follow_Up and Delay_Resp, for which no skb waits. With a PTPv1 master on both ports whose sequence ids run in step (e.g. a Dante device with primary and secondary network started at the same time), the unclaimed TX event of Follow_Up N on one port is still on the event list when the other port queues Sync N, and am65_cpts_find_tx_ts() tries to match before it checks for expiry. Sync N then gets the transmit time of the other port's Follow_Up N, and the master announces a preciseOriginTimestamp up to one Sync interval early to every slave on that network. For PTPv1 replace only the message type of the event with the skb's and keep its event type, port number and sequence id, and compute the value per skb. Tested on AM62x with ti-linux-6.12.y and the port number commit backported: without this patch every boot in which both ports started PTP together (10 of 10) sent wrong Sync timestamps, with it none did (0 of 29). The bug was tracked down, and this fix and changelog drafted, with the help of an AI coding assistant (Claude). I reviewed and tested it on hardware as described above. Fixes: a23c657e332f ("net: ethernet: ti: am65-cpsw: Use also port number to identify timestamps") Signed-off-by: Jesper L. Nielsen Reviewed-by: Siddharth Vadapalli Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261103-am65-cpts-ptpv1-v2-1-e1f79ed1ba60@pascal-audio.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 746ec3f31d9e182108418153ddc14a47a9cc4b85 Author: Anil Kaushik Date: Mon Nov 2 12:09:29 2026 +0000 netlink: Do not call the unbind callback with the table locked [ Upstream commit a36b9e205cb3c452ab96cc783e63465d466fe615 ] When netlink_bind() fails to insert the socket, it calls netlink_undo_bind() with the table locked. genl_unbind() then takes cb_lock, while genl_unregister_family() and genl_register_family() take cb_lock for writing and then wait in netlink_table_grab() for the table users to go away: netlink_bind() genl_unregister_family() netlink_lock_table() down_write(&cb_lock) netlink_insert() fails netlink_undo_bind() netlink_table_grab() genl_unbind() waits for nl_table_users == 0 down_read(&cb_lock) An unprivileged user can get here by binding to a port ID that is in use, with nl_groups set. Lockdep does not see it, as nl_table_users is a plain counter. Unlock the table first, as the comment in netlink_release() asks for. Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261101101347.3910654-1-anilkaushikwireless@gmail.com Fixes: 3de21a8990d3 ("genetlink: Add per family bind/unbind callbacks") Signed-off-by: Anil Kaushik Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261102120929.4077030-1-anilkaushikwireless@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 81baca189fc8455f025027d70cc6e412f2712f7d Author: Prathamesh Deshpande Date: Sat Oct 31 22:57:13 2026 +0000 net/mlx5e: IPoIB, Fix QPN lookup race [ Upstream commit 29066b0fc046a2965129a74325b98d9abb4647a9 ] The parent RX completion path can load a QPN hash entry before mlx5i_pkey_del_qpn() unlinks and frees it, then dereference freed memory. Use RCU hlist operations and defer freeing with kfree_rcu(). The existing RCU read-side section in mlx5e_napi_poll() covers the lookup. Keep ht_lock for writers and acquire it before looking up the entry to delete. Fixes: 7e7f4780c340 ("net/mlx5e: IPoIB, Use hash-table to map between QPN to child netdev") Signed-off-by: Prathamesh Deshpande Reviewed-by: Tariq Toukan Link: https://patch.msgid.link/20261031225749.14214-1-prathameshdeshpande7@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 03ff634f8055371de18111cdbd740b213114f374 Author: Kyle Pepper Date: Fri Nov 6 17:24:57 2026 +0000 Bluetooth: reject invalid LE supervision timeout relationships [ Upstream commit c1d50a71cdee90a0c68b7a67221d8aae96d14a0c ] The LE parameter validator calculates an unsigned maximum latency by subtracting one from a truncated quotient. If the quotient is zero, this wraps and accepts invalid parameters. Exact quotient boundaries also accept equality where the supervision timeout must be greater. Compare the products directly after checking the field bounds. The validated interval and latency limits keep the products within int. This enforces the strict timeout relationship without division or unsigned subtraction. Sashiko identified the underflow while reviewing the soft interval preference RFC. The bug is already present in its unpatched base; keep this common-validator fix independent of that preference policy. Fixes: 8757825b128e ("Bluetooth: hci_check_conn_params() check proper range") Assisted-by: LLM Signed-off-by: Kyle Pepper Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 9e758ead3c75efd8ca3432102d64d891e2f78399 Author: Christian Loehle Date: Thu Nov 5 21:52:23 2026 +0000 cpufreq: Serialize global boost updates [ Upstream commit 3d5720dff09f3b90d9ab2a6707e4bb8d69542f4a ] Concurrent global boost sysfs writes can interleave their global flag and per-policy updates. An enabling write can set the global flag, then a disabling write can clear it and finish before the enabling write updates the policies. Both writes succeed, leaving boost enabled on the policies while the global flag is disabled. Serialize the complete global boost update, including rollback on failure, with a mutex. Fixes: 6f19efc0a1ca ("cpufreq: Add boost frequency support in core") Signed-off-by: Christian Loehle Reviewed-by: Pengjie Zhang Reviewed-by: Zhongqiu Han Reviewed-by: Sumit Gupta Link: https://patch.msgid.link/20261105215223.1263415-3-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit a8725b26b369105e261cad7462b2c031ec439f92 Author: Christian Loehle Date: Thu Nov 5 21:52:22 2026 +0000 cpufreq: Preserve global boost state on failed updates [ Upstream commit a0cde2b601bc32b76d61e50141c619790e5e2e41 ] cpufreq_boost_trigger_state() restores the opposite of the requested state when updating policy boost state fails. For example, a failed write of 0 when global boost is already disabled enables the global flag without enabling any policies. Save the original global boost state and restore it on failure. Fixes: 121baab7b88e ("cpufreq: Force sync policy boost with global boost on sysfs update") Signed-off-by: Christian Loehle Reviewed-by: Pengjie Zhang Reviewed-by: Zhongqiu Han Reviewed-by: Sumit Gupta Link: https://patch.msgid.link/20261105215223.1263415-2-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit c013e0561f10c82749721e7ac77d5c2d73fdad39 Author: Dheeraj Kumar Srivastava Date: Thu Nov 5 16:32:16 2026 +0000 iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails [ Upstream commit ec91bb159dc24eefe144ef8867937f4a055dd0e2 ] iommu_snp_enable() checks that the IOMMU can support SNP and sets amd_iommu_snp_en, then calls snp_rmptable_init() to map the RMP table. If that call fails, CC_ATTR_HOST_SEV_SNP is cleared but amd_iommu_snp_en is left set. Later IOMMU initialization uses amd_iommu_snp_en to configure the IOMMU for SNP, on the assumption that RMP setup succeeded. Clear amd_iommu_snp_en along with CC_ATTR_HOST_SEV_SNP. Fixes: 409f45387c93 ("x86/sev: Fix broken SNP support with KVM module built-in") Signed-off-by: Dheeraj Kumar Srivastava Reviewed-by: Ankit Soni Signed-off-by: Vasant Hegde Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin commit 992450e2cabc8152f8197624158e5fbb6b4744ff Author: Benjamin Segall Date: Mon Nov 2 15:11:56 2026 -0800 perf: Fix racy update of cpc->hrtimer_interval [ Upstream commit 3bbd85b2f67aff58f2cbec9a7fb705677b94473b ] Updates to cpc->hrtimer_interval can race with reads either in the hrtimer itself, or other calls to perf_mux_hrtimer_restart. This is not exactly expected to be a common config change, but it's easy enough to fix. Since there's already an IPI to each cpu to restart the timer, and all reads are with irqs disabled, just move the update onto the target cpu. Fixes: 62b856397927 ("perf: Add sysfs entry to adjust multiplexing interval per PMU") Reported-by: Sashiko Signed-off-by: Ben Segall Signed-off-by: Peter Zijlstra (Intel) Link: https://sashiko.dev/#/patchset/xm265wykhyrv.fsf%40google.com Link: https://patch.msgid.link/xm26se1ihlqb.fsf@google.com Signed-off-by: Sasha Levin commit b800a34a22f4b3e07a9f55f00e77a1d98d229648 Author: Sandipan Das Date: Mon Nov 2 15:52:07 2026 +0530 perf/x86/amd/uncore: Avoid context migration from non-owners [ Upstream commit 0ae655bce1934857fa3e316ddcb4be38c30dbd38 ] Each uncore context is owned by a single CPU that hosts all events for the corresponding uncore domain and is advertised through the sysfs cpumask attribute. When a CPU goes offline, the context is migrated to an online sibling if the departing CPU is the owner. Before commit d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management"), uncore_down_prepare() checked whether the CPU going offline owned the context. The check was lost when the function was replaced by amd_uncore_ctx_move(). Hence, when a CPU that is not the owner goes offline, ownership is always handed over to the first online sibling in the uncore domain irrespective of whether another sibling already owns it. This goes unnoticed as long as the owner is the lowest-numbered online CPU in the domain, since the first online sibling is then the owner itself. Once ownership has moved, that no longer holds. For example, consider an L3 domain spanning CPUs 8-15,136-143 and owned by CPU 8. $ cat /sys/bus/event_source/devices/amd_l3/cpumask 0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120 $ echo 0 | sudo tee /sys/devices/system/cpu/cpu8/online $ cat /sys/bus/event_source/devices/amd_l3/cpumask 0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120 $ echo 1 | sudo tee /sys/devices/system/cpu/cpu8/online $ cat /sys/bus/event_source/devices/amd_l3/cpumask 0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120 $ echo 0 | sudo tee /sys/devices/system/cpu/cpu10/online $ cat /sys/bus/event_source/devices/amd_l3/cpumask 0,8-9,16,24,32,40,48,56,64,72,80,88,96,104,112,120 Offlining CPU 8 correctly moves ownership to CPU 9 and onlining it again leaves CPU 9 as the owner. However, offlining CPU 10 then makes CPU 8 the owner while existing events remain on CPU 9. Both CPUs are now advertised for the same domain, so tools that open an event on every CPU in the cpumask count the domain twice, and the context gets modified from two CPUs without any synchronization. Restore the ownership check that was lost during the refactor. Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management") Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/273135a6d33a40f442fb18e140a90689fae7cd32.1793614726.git.sandipan.das@amd.com Signed-off-by: Sasha Levin commit 6dd9300aef781a17143b9dd17dcce92a2d7b194d Author: Peter Zijlstra Date: Tue Sep 15 13:51:12 2026 +0200 locking/osq: Fix unlink queue corruption [ Upstream commit 408b129aac48b574c0c9d11137a89eefba825d5d ] Very similar to commit 50972fe78f24 ("locking/osq_lock: Fix osq_lock queue corruption"), make sure to order the prev->next store against the next->prev store. Fixes: 50972fe78f24 ("locking/osq_lock: Fix osq_lock queue corruption") Suggested-by: David Laight Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Waiman Long Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin commit 5e140457428a9b17d63bad36849a4477ab159a44 Author: Peter Zijlstra Date: Tue Sep 15 13:09:33 2026 +0200 locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering [ Upstream commit 1b9e01fcc47aff00d2fd64693c5dcd620eff5865 ] The atomic_cmpxchg() in osq_wait_next() removes the current CPU's node from the tail of the queue and puts @old_cpu back. This is very much like an 'unlock', which is RELEASE, rather than ACQUIRE. Additionally, on success (the only case where the ordering is effective), this returns NULL which means both callsites will do nothing more, there are no subsequent operations to order against. Furthermore, the osq_lock() caller will then return false, indicating failure to acquire -- the mutex must go block. Again, not making a case for ACQUIRE. Neither atomics nor locks provide ordering on failure. Since ACQUIRE makes no sense, while RELEASE makes it more symmetric with osq_unlock(), switch the ordering. This then makes osq_unlock() consistently RELEASE. Fixes: c55a6ffa6285 ("locking/osq: Relax atomic semantics") Suggested-by: David Laight Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Waiman Long Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin commit b3f6b5414338e9de36dda080c513512e230b503b Author: Zhuangzhuang Wang <3050681779@qq.com> Date: Fri Oct 30 07:07:27 2026 +0000 locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks() [ Upstream commit aa63c0df79920f6abe1b66e1f8b6443ad2d62d0e ] Commit 051f5d223dfc ("lockdep: Enable the printing of held locks of remote running tasks and print task CPU") added the task's CPU to the "locks held by" line. As the comment above the printk() describes, a running task should be reported as "on CPU#N" and a task that is not running as "last CPU#N". The ternary has the two strings swapped, so the labels are inverted. Swap the strings so the output matches the comment. Fixes: 051f5d223dfc ("lockdep: Enable the printing of held locks of remote running tasks and print task CPU") Signed-off-by: Zhuangzhuang Wang <3050681779@qq.com> Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20261030-lockdep-fix-cpu-label-v1-1-96875c74b15b@qq.com Signed-off-by: Sasha Levin commit 014272105371b140affcee740039cb5f6dc63baa Author: Thomas Fourier Date: Wed Oct 28 15:57:02 2026 +0100 net/mlx5e: TC, Fix double free of branch in failure [ Upstream commit 31f9b43a3bb3d2201eadd147440252d0912dab21 ] When allocating the false branch fails in parse_branch_ctrl(), the already allocated true branch is freed but attr->branch_true is left pointing to it. The caller parse_tc_actions() fails the flow, and free_flow_post_acts(), mlx5_free_flow_attr_actions() which calls again free_branch_attr() on attr->branch_true. Clear the pointer after freeing it. This bug is theoretical and was compile tested only. Fixes: f86488cb4685 ("net/mlx5e: TC, initialize branch flow attributes") Signed-off-by: Thomas Fourier Reviewed-by: Tariq Toukan Tested-by: Tariq Toukan Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit a406620b0f477dc1500910b793b84a8376f35647 Author: Ridge Lomont Date: Tue Oct 27 15:29:21 2026 -0700 x86/kcfi: Don't emit KCFI_REFERENCE() in modules [ Upstream commit fb685de78e6bf79e49854e7d149f69b125583de5 ] KCFI_REFERENCE() takes the address of a symbol so that the compiler emits its __kcfi_typeid_ symbol, which the SYM_TYPED_FUNC_START() assembly implementing it needs. It is used from arch/x86 headers for __clear_pages_unrolled(), copy_page(), __memset() and __memmove(), and all of that assembly is built into vmlinux. Modules include the same headers, so with CONFIG_CFI=y every module also gets an __ADDRESSABLE() reference to each of these symbols in .discard.addressable. This serves no purpose there, and since __clear_pages_unrolled() is EXPORT_SYMBOL_GPL, modpost now rejects any GPL-incompatible module that includes : ERROR: modpost: GPL-incompatible module repro.ko uses GPL-only symbol '__clear_pages_unrolled' even though the module never uses the symbol. This makes OpenZFS impossible to build against CFI kernels; its configure checks fail in the same way and are misreported as CONFIG_DEBUG_LOCK_ALLOC. scripts/module.lds.S does not help here: modpost checks .o before the final link, and even after it the discarded section only loses its relocations, the undefined symbols stay in .symtab, where the module loader resolves them with the same license check. Only emit the reference when building vmlinux. Tested on x86_64 with clang 23.1.3 and CONFIG_CFI=y, with both CONFIG_LTO_CLANG_FULL=y (the configuration from the Fixes: commit) and CONFIG_LTO_CLANG_THIN=y: vmlinux links without warnings and still contains __kcfi_typeid___clear_pages_unrolled, __kcfi_typeid_copy_page, __kcfi_typeid___memset and __kcfi_typeid___memmove. It boots in QEMU with no CFI failures. A minimal module with MODULE_LICENSE("Proprietary") including fails modpost before this change and builds and loads after it. OpenZFS builds against a CFI kernel with this change, and its pool, encryption, checksum and send/recv operations run without CFI failures, in QEMU and on a desktop with CFI enforcing. Fixes: 9b041a4b66b3 ("x86/mm: Ensure clear_page() variants always have __kcfi_typeid_ symbols") Assisted-by: LLM Signed-off-by: Ridge Lomont Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Nathan Chancellor Link: https://github.com/openzfs/zfs/issues/18092 Link: https://patch.msgid.link/20261027-kcfi-reference-modules-v2-1-3a3247f15806@proton.me Signed-off-by: Sasha Levin commit 32f4256adb2318c8cc30dd35dbb0aca73017a16e Author: Isaac Adjei Date: Thu Nov 5 08:16:51 2026 +0000 gpio: mpfs: reject unsupported interrupt types [ Upstream commit cfbd01eddaf5bfdd4f53560013fe830571a186e9 ] The switch statement in mpfs_gpio_irq_set_type() does not handle unsupported interrupt types. For example, IRQ_TYPE_NONE is not listed. When an unsupported type is passed, interrupt_type remains uninitialised. Its undefined value is then written to the GPIO control register. The function still returns 0, making the caller believe the operation succeeded. Add a default case to return -EINVAL for unsupported interrupt types. Smatch reported the following warning: drivers/gpio/gpio-mpfs.c:144 mpfs_gpio_irq_set_type() error: uninitialized symbol 'interrupt_type'. I built the driver with W=1 and got no warnings. I also reran Smatch and confirmed that the warning was resolved. This is compile-tested only. I do not have access to PolarFire SoC hardware for runtime testing. Fixes: e57b53f0f36a ("gpio: mpfs: Add interrupt support") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202411080149.bOpayvf6-lkp@intel.com/ Signed-off-by: Isaac Adjei Link: https://patch.msgid.link/20261105-gpio-mpfs-irq-type-v1-1-cbb2b0b2a807@isaacadjei.me Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit e247c9a79431ebc49b8bbcfc5df8df6eaa42787e Author: Eric Dumazet Date: Fri Oct 30 12:15:28 2026 +0100 tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND [ Upstream commit 475ff14ba558bb8857bca878f1d593784ccc4f0f ] snd_cwnd has no practical upper bound: snd_cwnd_clamp defaults to ~0, and RTAX_INITCWND, a locked RTAX_CWND metric, TCP_BPF_IW and TCP_BPF_SNDCWND_CLAMP accept any positive value. Congestion control modules do u32 arithmetic on cwnd that assumes much smaller values. For instance, ssthresh() handlers compute: CUBIC, BIC, ROCCET: cwnd * (BICTCP_BETA_SCALE + beta), up to 2047 DCTCP: cwnd * dctcp_alpha, up to 1024 CDG, NV, CUBIC, ...: cwnd * beta, below 1024 With a large initcwnd route or TCP_BPF_IW, cwnd is set directly to such values, and the next RTO or recovery calls ->ssthresh() with it. The product then wraps: DCTCP with cwnd = 2^24 and alpha = 1024 gets ssthresh == cwnd, and CUBIC computes a wrong ssthresh and Wmax. CUBIC bictcp_update() also expects cwnd below about one million packets. The paths that can grow cwnd by large amounts (tcp_slow_start(), tcp_cong_avoid_ai(), bbr_set_cwnd() and tcp_init_cwnd()) already bound it by snd_cwnd_clamp, so give snd_cwnd_clamp a finite default of 2^20 packets, and cap the metric and BPF paths that set it or set cwnd directly. 2^20 packets do not limit real flows: with the maximum window scale of 14, a peer can not advertise more than 65535 << 14 bytes (~1GB), which is less than 2^20 packets for any MSS of 1024 bytes or more. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Chris Mason Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261030111528.2850082-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 4ba954b9909c7232db3e5b04dffe4e2f68d24e28 Author: Kayra Cizmeci Date: Tue Oct 20 21:54:01 2026 +0300 sched/cache: Ignore non-fair current in alb_break_llc() [ Upstream commit 006991aa89974378ee579416dba87adc22cd60fd ] Commit d6b9afab44e23 ("sched/cache: Fix checking active load balance by only considering the CFS task") stopped using task_util() for non-fair cur. __active_load_balance_cpu_stop() calls detach_one_task(), that only looks to cfs_tasks list. So if the rq->curr is not fair, doing a decision according to it is wrong, since we only migrate tasks that is fair. Commit f0d243a96f26 ("sched/fair: Avoid creating misfits during cache-aware balancing") passes cur to task_misfits_asym_cpu() without checking if the cur is in fair class or not. Fix this. Fixes: f0d243a96f26 ("sched/fair: Avoid creating misfits during cache-aware balancing") Signed-off-by: Kayra Cizmeci Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Tim Chen Link: https://patch.msgid.link/20261020185402.57017-1-kayracizmeci@gmail.com Signed-off-by: Sasha Levin commit b69d6e28063f5642ecc98e1da5fbe3fcacc2ff4c Author: Hui Su Date: Wed Oct 21 13:38:34 2026 +0900 sched/topology: Balance cluster static-key updates [ Upstream commit 5ebdfe12ab96368d0339593129d4ce0bc2bd06f5 ] build_sched_domains() increments sched_cluster_active once per newly built partition that contains an SD_CLUSTER domain. detach_destroy_domains() instead tested the global static key before decrementing it, so destroying a cluster-less partition could drop a reference owned by another partition and disable cluster-aware scheduling while SD_CLUSTER domains remained installed. Check the installed domains before detaching them, only while the key is enabled, and decrement only when the removed partition contains an SD_CLUSTER domain. With two cluster-bearing partitions installed, removing a singleton partition left the baseline count at 1 where 2 partitions still carried SD_CLUSTER; the fixed kernel correctly reports 2. On an asymmetric cluster topology where the parent partition gains no cluster domain, the baseline count drops to 0 while a cluster partition remains installed; the fixed kernel keeps it at 1. Fixes: 8881e1639f1f ("sched/fair: Scan cluster before scanning LLC in wake-up path") Signed-off-by: Hui Su Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: K Prateek Nayak Reviewed-by: Kayra Cizmeci Link: https://patch.msgid.link/20261021043834.1140951-1-sh_def@163.com Signed-off-by: Sasha Levin commit 0295879e5eabbf3c6d9362000073315f7f88bb51 Author: Hui Su Date: Fri Oct 23 11:52:07 2026 +0900 sched/pelt: Fix u32 truncation of the PELT period count [ Upstream commit a0c755e574e37fddb59edf175f27dc3877e7fe23 ] accumulate_sum() computes the number of elapsed PELT periods in a u64 but returns u32. When the count is a multiple of 2^32, it is truncated to zero even though the PELT sums have been updated. The caller interprets zero as no period boundary crossed and skips recomputing the averages, leaving *_avg stale relative to *_sum. Return the period count as u64 so the caller can test it without truncation. Fixes: a481db34b9be ("sched/fair: Optimize ___update_sched_avg()") Signed-off-by: Hui Su Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Kayra Cizmeci Link: https://patch.msgid.link/20261023025207.2967903-1-sh_def@163.com Signed-off-by: Sasha Levin commit 7bdaf9e7986acbbcf9d886460ade09af3fcda98c Author: Christian Loehle Date: Thu Oct 15 12:37:54 2026 +0100 sched/core: Account I/O waits independently of delayed dequeue [ Upstream commit 0965587d00b84f0a3b0fc94930d4a5f8ff011eda ] Starting blkio delay accounting and incrementing rq->nr_iowait in __block_task() ties both to removal from the runqueue. With EEVDF delayed dequeue, this misses the initial part of an I/O sleep, or the entire sleep if the task wakes before it is dequeued. Such tasks are also missing from procs_blocked while their dequeue is delayed. Final dequeue can run in another task's context, causing delayacct_blkio_start() to timestamp the wrong task. Start both forms of accounting in try_to_block_task(), when the current task commits to blocking, before delayed dequeue or proxy execution can retain it on the runqueue. End both when clearing is_blocked, including queued wakeups and the proxy execution paths that let the current task continue. Checking is_blocked excludes wakeups that precede blocking. Save the CPU charged at the start of the wait. Delayed tasks can migrate while still queued, and proxy execution can also move blocked tasks. Decrement the saved CPU's counter on unblock, regardless of the task's current placement, and remove the old dequeue-based accounting. CPU iowait continues to classify idle time using the counter on the charged CPU; it does not accumulate the full per-task blocked duration. Closes: https://lore.kernel.org/r/20261014081731.1068794-1-zhanxusheng@xiaomi.com Fixes: 152e11f6df29 ("sched/fair: Implement delayed dequeue") Reported-by: Zhan Xusheng Signed-off-by: Christian Loehle Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Zhan Xusheng Reviewed-by: Kayra Cizmeci Link: https://patch.msgid.link/fd8578a1-e60b-4993-ab51-2b5d63abcf77@arm.com Signed-off-by: Sasha Levin commit 40e644b33189a8a592e6f3cb6518867a53099b29 Author: Nickolai Zeldovich Date: Sun Oct 25 08:46:57 2026 -0400 sched/deadline: Fix this_bw on class change of a dying task [ Upstream commit 0c93e25ef11a9dee43f6076bd1f09771dc2b167e ] Moving a SCHED_DEADLINE task out of the class with sched_setscheduler(2) after it stored TASK_DEAD in do_task_dead(), but before __schedule() dequeued it, subtracts its bandwidth from the runqueue's this_bw twice. this_bw then stays short until reboot: __sub_rq_bw() warns about the underflow or about running_bw > this_bw, and GRUB reclaim for SCHED_FLAG_RECLAIM tasks on that CPU is miscomputed. The class change dequeues the still queued task with DEQUEUE_SAVE, which removes its bandwidth from running_bw and this_bw. switched_from_dl() then calls task_non_contending(), which, if the 0-lag time has passed, removes it from this_bw again because the task is TASK_DEAD. That removal is meant for the dying task's own DEQUEUE_SLEEP dequeue, which has removed nothing before it. Do the TASK_DEAD removal only on that dequeue path. Reproduced under QEMU on x86_64 and riscv64 by moving exiting deadline tasks to SCHED_OTHER in a loop; with this patch there is no warning. Fixes: 8fd27231c330 ("sched/deadline: Track the "total rq utilization" too") Signed-off-by: Nickolai Zeldovich Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Juri Lelli Tested-by: Juri Lelli Link: https://patch.msgid.link/20261025124657.836229-1-nickolai@csail.mit.edu Signed-off-by: Sasha Levin commit e129b82a0800897d33004d5688beaa4e78e74670 Author: Ravi Bangoria Date: Mon Oct 26 04:18:37 2026 +0000 perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS [ Upstream commit 927f9c5cdadbc4ac6973bcd1690107fcb392612c ] The IBS_{FETCH|OP}_CTL2[Dis] bit allows IBS sampling to be stopped without a RMW of IBS_{FETCH,OP}_CTL. Systems providing this bit therefore do not require the IBS_STARTED and IBS_STOPPED states used to coordinate control MSR updates with late NMIs. Add a separate stop path for these systems. Preserve the Val bit while disabling the event so that a delayed NMI can be identified and consumed, and wait briefly for such an NMI before restarting the event. Leave the existing handling unchanged on systems without IBS_CAPS_DIS. Closes: https://lore.kernel.org/r/20261007234815.4026028-1-jmattson@google.com Fixes: efa5700ec0da ("perf/amd/ibs: Support IBS_{FETCH|OP}_CTL2[Dis] to eliminate RMW race") Reported-by: Jim Mattson Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Jim Mattson Link: https://lore.kernel.org/r/20261007234815.4026028-1-jmattson@google.com Link: https://patch.msgid.link/20261026041838.941-4-ravi.bangoria@amd.com Signed-off-by: Sasha Levin commit 9194665da11308f62c184f5f3d0cc2c644b28e01 Author: Ravi Bangoria Date: Mon Oct 26 04:18:36 2026 +0000 perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR [ Upstream commit b61c12527223423ab66891b2e8131da0d66537c4 ] IBS hardware captures a sample and raises an NMI. Since the NMI can be delivered with a delay, a privilege change may occur between sample capture and NMI delivery. Because IBS only provides the sample RIP, the kernel records GPRs from the NMI pt_regs, which may reflect kernel mode if a privilege switch occurred in the interim. This can leak kernel addresses to unprivileged users through PERF_SAMPLE_REGS_USER and/or PERF_SAMPLE_REGS_INTR. Fix this by using interrupt regs while preparing PERF_SAMPLE_REGS_USER and PERF_SAMPLE_REGS_INTR. With the change, when IBS samples a user mode instruction but the NMI is delivered in kernel mode, PERF_SAMPLE_REGS_USER will source its register state from task_pt_regs(current) and PERF_SAMPLE_REGS_INTR will be omitted from the data sent to userspace. In addition to fixing the kernel address leak, this change also ensures GPR snapshot consistency, which resolves the DWARF unwinding issue with IBS. Closes: https://lore.kernel.org/r/CAPu-DQqF0aF6=GS8Z6KKWeeX_V5LiXeKU_rJQZC+uGg8zuTPNw@mail.gmail.com Fixes: d29e744c7167 ("perf/x86: Relax privilege filter restriction on AMD IBS") Reported-by: Gennady Kupava Reported-by: Jayapal Ashwin Nair Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20261026041838.941-3-ravi.bangoria@amd.com Signed-off-by: Sasha Levin commit 1b2ff6084411821eab994598ee7acfb06c7591d3 Author: Kan Liang Date: Mon Aug 24 16:27:20 2026 +0800 perf: Add sampling support for SIMD registers [ Upstream commit 918b7d6d1729952d51da4fa81db7b366a207de8f ] Users may be interested in sampling SIMD registers during profiling. The current sample_regs_* structure does not have sufficient space for all SIMD registers. To address this, new attribute fields sample_simd_{pred,vec}_reg_* are added to struct perf_event_attr to represent the SIMD registers that are expected to be sampled. Currently, the perf/x86 code supports XMM registers in sample_regs_*. To unify the configuration of SIMD registers and ensure a consistent method for configuring XMM and other SIMD registers, a new event attribute field, sample_simd_regs_enabled, is introduced. When sample_simd_regs_enabled is set, it indicates that all SIMD registers, including XMM, will be represented by the newly introduced sample_simd_{pred|vec}_reg_* fields. The original XMM space in sample_regs_* is reserved for future uses. Since SIMD registers are wider than 64 bits, a new output format is introduced. The number and width of SIMD registers are dumped first, followed by the register values. The number and width are based on the user's configuration. A new ABI, PERF_SAMPLE_REGS_ABI_SIMD, is added to indicate the new format. The enum perf_sample_regs_abi is now a bitmap. This change should not impact existing tools, as the version and bitmap remain the same for values 1 and 2. Additionally, two new __weak functions are introduced: - perf_simd_reg_value(): Retrieves the value of the requested SIMD register. - perf_simd_reg_validate(): Validates the configuration of the SIMD registers. A new flag, PERF_PMU_CAP_SIMD_REGS, is added to indicate that the PMU supports SIMD register dumping. An error is generated if sample_simd_{pred|vec}_reg_* is mistakenly set for a PMU that does not support this capability. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Kan Liang Co-developed-by: Dapeng Mi Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260824082731.1013973-13-dapeng1.mi@linux.intel.com Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR") Signed-off-by: Sasha Levin commit f048043ac4c7a5e8a7202af63488838d31717060 Author: Kan Liang Date: Mon Aug 24 16:27:16 2026 +0800 perf: Move and enhance has_extended_regs() for arch-specific use [ Upstream commit 05fe8825796e6b5557656c6c984486f0e66154fe ] Move has_extended_regs() to include/linux/perf_event.h so it can be used by arch-specific code. While moving it, enhance the check logic and rename it to event_has_extended_regs() to match existing perf event helper naming. Signed-off-by: Kan Liang Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260824082731.1013973-9-dapeng1.mi@linux.intel.com Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR") Signed-off-by: Sasha Levin commit 351222fde625d814faa1747bd573cf242037e515 Author: Dapeng Mi Date: Mon Aug 24 16:27:12 2026 +0800 perf: Eliminate duplicate arch-specific function definitions [ Upstream commit cb388bd530cc518b0e245fb4eabc40f3de538e4f ] Define default common __weak functions for perf_reg_value(), perf_reg_validate(), perf_reg_abi() and perf_get_regs_user(). This helps to eliminate the duplicated arch-specific definitions. No function changes intended. Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260824082731.1013973-5-dapeng1.mi@linux.intel.com Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR") Signed-off-by: Sasha Levin commit aa92643fa54fedec0c22ef7fb728e0a5105e74ae Author: Ravi Bangoria Date: Mon Oct 26 04:18:35 2026 +0000 perf/amd/ibs: Reset CPU0 IBS state on syscore resume [ Upstream commit 2c1d35bd95b13b50b43a0cb2167305dabfb54c07 ] During a suspend/resume cycle, all CPUs except CPU0 go through hotplug callbacks, which sets up IBS state. CPU0 bypasses this path, leaving its IBS state stale after resume. Fix this bug by explicitly setting CPU0's IBS state in the syscore ->resume() callback. Fixes: efa5700ec0da ("perf/amd/ibs: Support IBS_{FETCH|OP}_CTL2[Dis] to eliminate RMW race") Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Jim Mattson Link: https://patch.msgid.link/20261026041838.941-2-ravi.bangoria@amd.com Signed-off-by: Sasha Levin commit 0b9c1cbc25625016f6fa608b0492dd15b0e211b9 Author: Ian Rogers Date: Sun Oct 25 14:55:08 2026 -0700 perf/core: Clamp deferred callchain entry count to fit u16 header.size [ Upstream commit 5e4d83fb3616ebf807df1ce1b0ee7a8cdcb5ff87 ] In perf_callchain_deferred_output(), if trace->nr is large enough that sizeof(deferred_event->event) + trace->nr * sizeof(u64) + id_header_size exceeds U16_MAX, header.size wraps while the output loop still writes all trace->nr entries into the ring buffer. Clamp nr per event (accounting for event->id_header_size when sample_id_all is enabled) so the record never overflows u16 header.size. Fixes: c69993ecdd4d ("perf: Support deferred user unwind") Signed-off-by: Ian Rogers Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20261025215508.1237480-2-irogers@google.com Signed-off-by: Sasha Levin commit 70168f08992b772584452dcbf0774136a53ece9d Author: Ian Rogers Date: Sun Oct 25 14:55:07 2026 -0700 perf/core: Include perf_event_attr::defer_output in is_sb_event() check [ Upstream commit 772f38fc69d5cf22f13b43dec30c2bbc5bdf4eb8 ] Events configured with attr.defer_output = 1 receive deferred callchain sideband records (PERF_RECORD_CALLCHAIN_DEFERRED) via perf_iterate_sb(). Include attr->defer_output in is_sb_event() so that such events are attached to the sideband event list even when no other sideband flags (such as mmap or comm) are enabled on the event. Fixes: c69993ecdd4d ("perf: Support deferred user unwind") Signed-off-by: Ian Rogers Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20261025215508.1237480-1-irogers@google.com Signed-off-by: Sasha Levin commit d38e18b64f53a802e75549755588e8491c383087 Author: Siddharth Chintamaneni Date: Sat Oct 31 23:00:48 2026 -0700 fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() [ Upstream commit 7a5783cfac71b3c12e7fb1c2894dd4538d57d513 ] In default_llseek(), the range checks for SEEK_DATA and SEEK_HOLE compare the signed loff_t offset directly against inode->i_size: if (offset >= inode->i_size) { retval = -ENXIO; goto out; } When a negative offset is supplied to SEEK_HOLE (e.g. lseek(fd, -10, SEEK_HOLE) on a sysctl file in /proc/sys), the signed comparison evaluates to false and execution proceeds to: offset = inode->i_size; This overwrites the negative offset with a non-negative value before the final `if (offset >= 0 || unsigned_offsets(file))` check, causing default_llseek() to update file->f_pos and return inode->i_size instead of failing with -ENXIO. Similarly, for SEEK_DATA on a file with FOP_UNSIGNED_OFFSET, a negative offset bypasses the range check and succeeds via unsigned_offsets(file). Read the inode size once via i_size_read(inode) after acquiring the inode lock and compare (unsigned long long)offset >= eof for both SEEK_DATA and SEEK_HOLE, matching must_set_pos(). Fixes: 982d816581ee ("fs: add SEEK_HOLE and SEEK_DATA flags") Signed-off-by: Siddharth Chintamaneni Link: https://patch.msgid.link/20261101060049.81441-2-sidchintamaneni@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit a1c2b896c9a05bb337d3bfbaa94d37f3151f5c01 Author: Jeff Layton Date: Tue Nov 3 07:04:00 2026 -0500 statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask [ Upstream commit 925d238324c79bcb75ad0add1d1b9d31d5f48115 ] STATX_ATTR_CHANGE_MONOTONIC is kernel-internal. cp_statx() strips it from stx_attributes but copies attributes_mask verbatim, so it leaks to userland on filesystems that advertise it (nfs, ceph), e.g. stx_attributes_mask = 0x8000000000303000 on NFS. Add a new mask constant and apply it to both fields. Fixes: a1175d6b1bda ("vfs: plumb i_version handling into struct kstat") Reviewed-by: Jan Kara Signed-off-by: Jeff Layton Link: https://patch.msgid.link/20261103-statx-v2-1-8b09aa8118ab@kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit 6f8e94382806129f3e9f7bb18c4cecffd1e9eeae Author: Hungyu Lin Date: Sun Nov 1 11:38:15 2026 +0000 vfs: preserve subsecond timestamps at filesystem time limits [ Upstream commit 55a0c91000646b008261e3b1e15d1e774f3026e4 ] timestamp_truncate() clears tv_nsec whenever the clamped seconds equal either filesystem time limit. This also drops the fractional part of timestamps whose seconds were already within the supported range. For example, setting a JFS mtime to 0.123456789 produces 0.000000000, although the filesystem can store the requested value. Utilities such as touch and cp -p consequently lose valid subsecond timestamps when preserving these endpoint values. Timestamps strictly between the filesystem limits are unaffected. Only clear tv_nsec when clamping actually changes tv_sec. Continue to truncate in-range nanoseconds to the filesystem's timestamp granularity, including when the seconds equal either endpoint. Ben Hutchings suggested comparing clamped and original seconds in the 2019 utimes review. That caller was switched to timestamp_truncate(), but the helper retained its endpoint equality check. Link: https://lore.kernel.org/lkml/12c095e595836a7ff7f2c7b2a32cb5544dd29b55.camel@codethink.co.uk/ Fixes: 50e17c000c46 ("vfs: Add timestamp_truncate() api") Signed-off-by: Hungyu Lin Link: https://patch.msgid.link/20261101113815.52911-1-dennylin0707@gmail.com Reviewed-by: Jeff Layton Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit 52f2dbf35ecf74bc18c03f27cee78900434002c0 Author: Andrea Parri Date: Mon Oct 26 19:06:18 2026 +0100 iov_iter: take an unsigned long segment count in import_iovec() [ Upstream commit 965e5e451146a19f69523fbcbc73d07e401a3775 ] readv(), writev() and their positional variants, process_vm_readv(), process_vm_writev(), vmsplice(), process_madvise(), vectored aio and the btrfs encoded I/O ioctls all take a full-width segment count, and all of them hand it to import_iovec() or __import_iovec(). Those take an unsigned int count, so on 64-bit kernels the upper 32 bits are dropped before iovec_from_user() checks the count against UIO_MAXIOV. A count of 0x100000001 is therefore imported as one segment: writev() on a pipe writes a byte and readv() reads it back, instead of both failing with EINVAL. A count of 0x100000000 returns 0 as an empty vector. import_iovec() was added with an unsigned int count, but the helper it wrapped, rw_copy_check_uvector(), took an unsigned long, as does iovec_from_user() today. Until v4.1, readv(), writev(), preadv(), pwritev(), process_vm_readv(), process_vm_writev() and vectored aio therefore failed these counts with EINVAL, as did vmsplice() until v4.18. Widen nr_segs in both import helpers so the UIO_MAXIOV check sees the count the caller passed. Callers with 32-bit counts are unaffected. AI assistance was used to find the bug, develop the fix, and run the reproducers. Fixes: bc917be81059 ("saner iov_iter initialization primitives") Signed-off-by: Andrea Parri Link: https://patch.msgid.link/20261026180619.4147910-1-parri.andrea@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit cc554796e11a063471e71aa347465ac56edddb99 Author: Abbott Liu Date: Wed Sep 30 16:46:32 2026 +0800 initrd: flush deferred fput() before mounting root [ Upstream commit 807c1d7125a2b3ca5705a803aa2e19f9d53d1ea3 ] Booting an old-style initrd, i.e. a filesystem image instead of a cpio archive, with "root=/dev/ram rootfstype=squashfs" can fail to mount the root filesystem: RAMDISK: squashfs filesystem found at block 0 RAMDISK: Loading 68449KiB [1 disk] into ram disk... done. No filesystem could mount root, tried: squashfs Kernel panic - not syncing: VFS: Unable to mount root fs on "/dev/ram" or unknown-block(1,0) rd_load_image() copies the image into /dev/ram with kernel_write() and then drops the file with fput(). The data only reaches the ramdisk once the final __fput() releases the block device and bdev_release() calls sync_blockdev(). But that __fput() is deferred. Since commit 343f4c49f243 ("kthread: Don't allocate kthread_struct for init and umh") init is a user mode task, so the __fput() is queued as task work and only runs once init returns to userspace, i.e. long after mount_root(). Before that it ran as delayed fput work at least a jiffy later, which doesn't help either. Whether the mount survives this depends on the block size. Squashfs calls sb_min_blocksize() first and set_blocksize() syncs and drops the page cache when the requested block size differs from the current one. That hides the problem for most configurations. With CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y and 4K pages both block sizes are 4K because set_init_blocksize() gives a page-aligned ramdisk a PAGE_SIZE block size on the first open. So set_blocksize() does nothing and squashfs reads the superblock with bios that bypass the page cache. brd has no page for that range yet and returns zeroes, so the magic check fails and the mount returns -EINVAL. With rootfstype= naming a single filesystem there is nothing left to retry and mount_root_generic() panics. Fixing this in squashfs would be the wrong end. Most block-backed filesystems read their superblock or their file data with bios that bypass the block device page cache, so they are exposed to the same race, just less loudly. So flush the deferred fput() in rd_load_image() right after dropping the ramdisk file, the same way mount_root_generic() already does before it retries with another filesystem type. All deferred closes at this point belong to files the boot itself created. Verified on arm64 QEMU with an openEuler Embedded rootfs image packed as squashfs. Fixes: 93e72b3c612a ("squashfs: migrate from ll_rw_block usage to BIO") Signed-off-by: Abbott Liu Link: https://patch.msgid.link/20260930084632.2965573-1-liuwenliang@huawei.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit a1d3b72d14f2fc2f086b5ca1edadb7a5e738a79e Author: Christian Brauner Date: Sun Nov 1 11:57:22 2026 +0100 libfs: end offset readdir at positions past DIR_OFFSET_EOD [ Upstream commit 45eb9737058fa78a73f17a5da55c8cb482c6d5bb ] offset_dir_llseek() takes any position up to LONG_MAX but offset_readdir() only skips the walk for DIR_OFFSET_EOD itself. For a position past it mas_find_rev() starts the walk at the highest offset in the directory. So an lseek() past the end makes the next getdents64() return the whole directory again. Before commit b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories") the walk went up from the position and found nothing past the end, and dcache_readdir() returns nothing there either. So only walk for positions below DIR_OFFSET_EOD. Fixes: b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories") Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-3-c621125b56d1@kernel.org Reviewed-by: Chuck Lever Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit 8f9c57090ef86832fc754602755e4467554d600f Author: Christian Brauner Date: Sun Nov 1 11:57:21 2026 +0100 libfs: walk offset directories in offset order [ Upstream commit 309f7a5585aeaf77d3d7c27304ac97e515447dac ] offset_iterate_dir() walks d_children from the head and only uses the maple tree to map ctx->pos back to a dentry when a getdents64() call resumes. offset_dir_lookup() finds the entry at ctx->pos, or the one with the next lower offset if it is gone, and the list walk continues from there. That only works if list order and offset order agree and quite often they don't. A rename over an existing name gives the moved dentry the offset of the name it replaced but __d_move() puts it at the head of d_children. RENAME_EXCHANGE does the same to both dentries. And once the cyclic offset allocator wraps new entries get low offsets at the head of the list. So if the entry at ctx->pos is unlinked between two getdents64() calls we resume at the entry with the next lower offset and that one can sit anywhere in the list: (1) If it sits further down the list everything in between is skipped. Create y, t, a, b and rename b over t. The list is now t(4) a(5) y(3). Stop the listing at t and unlink t. The next call resumes at y and a is never returned although nobody touched it. (2) If there is no lower entry we restart at the head and return the whole directory again. Nickolai reported this for the simple case of unlinking the oldest entry while a listing is about to reach it. Ending the walk there instead turns this into (1): create a, b, c, rename c over a, stop the listing at the renamed entry, unlink it, and b is lost. Instead of the list let's walk the maple tree itself in descending offset order. Then ctx->pos really means that everything above it has been emitted and resuming at the highest offset at or below it is right no matter where the dentry sits in d_children. Entries created or renamed to a new name after the listing started get an offset above ctx->pos and aren't returned, same as with the list walk which never went back to the head. So a readdir loop that renames or creates an entry for each one it reads still terminates. The maple tree can't change under us as all modifications happen with the directory's i_rwsem held exclusive and offset_readdir() holds it shared. That also covers the dentries in the tree. They are all persistent and only unlink, rmdir and rename remove or rename them. And since the previous patch i_rwsem is the lock of the tree. So keep a single ma_state across the walk and emit directly from the dentry without taking rcu_read_lock(), a reference or d_lock. This also makes the walk cheaper than the list walk was. With a million entries on tmpfs a getdents64() listing goes from 146ms to 114ms. With four processes listing the directory at the same time it goes from 470ms to 113ms per listing as they don't bounce the parent's d_lock and the dentries' lockrefs between them anymore. base v2 this 1M entries, getdents64 32k buffer (ms) 146 127 114 1M entries, getdents64 1k buffer (ms) 184 156 141 1M entries, getdents64 128b buffer (ms) 429 364 335 1M entries, ls -f (s) 0.259 0.239 0.228 1M entries, LC_ALL=C ls (s) 0.482 0.467 0.455 1M entries, 4 parallel listers (ms) 470 125 113 18 entries, rewind and list (ns) 4107 3594 3323 250k of 1M left, getdents64 32k (ms) 58.8 57.8 53.8 250k of 1M left, getdents64 128b (ms) 128 114 108 Fixes: b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories") Fixes: f70681e9e606 ("libfs: Fix duplicate directory entry in offset_dir_lookup") Reported-by: Nickolai Zeldovich Link: https://patch.msgid.link/20261018024549.798968-1-nickolai@csail.mit.edu Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-2-c621125b56d1@kernel.org Reviewed-by: Chuck Lever Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit 30ec7666148226225497263885db77f545fefe12 Author: Florian Fainelli Date: Tue Nov 3 13:50:40 2026 -0800 MIPS: SB1250: Validate and update IRQ affinity [ Upstream commit 456c965ca46c59a4a241c755e6565fd883a522f4 ] sb1250_set_affinity() selects the first online CPU in the requested affinity mask without checking whether such a CPU exists. If the intersection is empty, the resulting CPU index is invalid and must not be passed to cpu_logical_map(). Reject affinity masks containing no online CPU with -EINVAL before accessing the CPU mapping or interrupt mapper registers. Also update the effective affinity mask to reflect the single logical CPU selected as the interrupt target. Fixes: 421d1563c662 ("mips: Validate online cpus in irq_set_affinity() callbacks") Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit 05aa3069b087a2cd0754c975ab0b2fb339b4f16e Author: Florian Fainelli Date: Thu Oct 22 09:31:00 2026 -0700 MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window [ Upstream commit ff209a7294988aac52b2522b1d0d7349da4541ec ] The Cobalt PCI I/O window starts at 0x1000, excluding the VIA IDE controller's fixed compatibility-mode ports at 0x170, 0x1f0, 0x376 and 0x3f6. Since pcibios_enable_device() was converted to pci_enable_resources(), these unclaimed resources cause pata_via to fail to probe with -EINVAL. Start the PCI I/O window at zero to cover the southbridge legacy ports, retaining 0x1000 as the allocation minimum via PCIBIOS_MIN_IO. Register the PCI controller from plat_mem_setup(), before the VIA reservations and i8259 initialization, so the legacy resources do not conflict with the host bridge window and prevent PCI bus scanning. Keep the VIA resource reservations in plat_mem_setup() after the PCI controller registration and use insert_resource() to nest them beneath the PCI window. The i8259 and RTC resources are also claimed beneath it. Boot-tested on a Qube2 with a MIPS64 kernel. All seven PCI functions enumerate, both tulip devices bind, and pata_via initializes both ATA hosts and detects the ST380012A 80 GB disk. All 18 boot checks pass, including a read-only disk test and Ethernet ping. Fixes: ae81aad5c2e1 ("MIPS: PCI: Use pci_enable_resources()") Signed-off-by: Florian Fainelli Reviewed-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit b27acee5ca0ec6afe68caf1f1218de2260cea4b3 Author: Florian Fainelli Date: Fri Oct 16 15:18:26 2026 -0700 MIPS: Alchemy: Save the Ethernet address before reusing PROM memory [ Upstream commit 792ac17faa0503448f3ef85b49f16456ac54ab84 ] Alchemy keeps pointers into the firmware environment and looks up ethaddr when initializing the Ethernet devices. By that point, memory allocation can have overwritten the environment, causing prom_getenv() to pass an invalid pointer to strchr() and panic during boot. On the MTX-1, the struct page layout change in 9ddb3c14afba reduces struct page from 40 to 32 bytes and exposes this unreserved firmware memory. Bisection and boot tests confirmed that the parent boots while the change reproduces the panic. Parse the Ethernet address during prom_init(), before registering RAM with memblock, and keep the six bytes in kernel-owned init data. Return the saved address during device initialization, preserving the existing YAMON formats and command-line fallback without reserving a fixed low-memory region. Fixes: b93ddc4f9156 ("mips: Reserve memory for the kernel image resources") Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit 86e5e09bd85fdfb91545a68fd04720fa3819eb53 Author: Florian Fainelli Date: Fri Oct 16 11:15:59 2026 -0700 MIPS: Alchemy: Register interrupt chips with the IRQ core [ Upstream commit dd722e605bd6b5ac593475ad2ed76cd9d27cb2ef ] Alchemy initializes its interrupt chips through the set-type callbacks, which use irq_set_chip_handler_name_locked() to assign the chip and flow handler. This bypasses irq_set_chip() and its descriptor registration. Since /proc/interrupts switched to iterating the IRQ descriptor maple tree, the statically allocated Alchemy descriptors are no longer found. On an MTX-1, the file contains only the CPU header and ERR counter even though the timer, serial, Ethernet and PCI wireless interrupts work. Register each IC0/IC1 interrupt chip through irq_set_chip() before setting the initial trigger type. Do the same for the Au1300 GPIC. Keep the locked set-type callbacks for later trigger changes. Fixes: 171cc0d9eed1 ("genirq/proc: Speed up /proc/interrupts iteration") Signed-off-by: Florian Fainelli Reviewed-by: Dmitry Ilvokhin Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit 903497c8af94c23b2e096528a8a123b53007f9df Author: Imre Kaloz Date: Tue Oct 13 11:45:54 2026 +0200 MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC [ Upstream commit c9c0d267002029a5bf97ee50e6b11b4d16808aca ] The Bridge probe reads its part number from the 1-wire PROM and defers until the SGI 1-wire master and DS250x slave are present, so without them there is no PCI bus and no serial console. The IP30 RTC is a DS1685-family part, but the defconfig, derived from ip27_defconfig, has the M48T35 driver, so there is no RTC. Enable the 1-wire drivers and select the DS1685 family. Also drop four lines that savedefconfig removes, as CRYPTO_CAMELLIA, CRYPTO_CTS and CRYPTO_HMAC are selected built-in and IPV6_SIT=m is the default. Fixes: bb2d63500b5c ("MIPS: config: Add ip30_defconfig") Signed-off-by: Imre Kaloz Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit f50e042e68ea8b7fb8da3714c37dd09684b4fbc4 Author: Rosen Penev Date: Sun Oct 4 16:48:26 2026 -0700 MIPS: Avoid dead code/data elimination when using recordmcount [ Upstream commit 255d9dbd936f7db8b963e82429f6e57cd9d48999 ] CONFIG_LD_DEAD_CODE_DATA_ELIMINATION builds with -ffunction-sections, placing every function in its own section. recordmcount refuses to use weak symbols as section bases, as a strong definition could override them, so a weak function alone in its section, such as the generic pcibios_fixup_bus() stub, breaks the build: Cannot find symbol for section 88: .text.pcibios_fixup_bus. drivers/pci/probe.o: failed MIPS always records mcount locations with recordmcount, so this hits any config with the function tracer and dead code elimination enabled, e.g. malta_defconfig built with LLVM=1. Only offer dead code elimination when recordmcount is not used, as powerpc does since commit f8b2336f15f3 ("powerpc: Avoid dead code/data elimination when using recordmcount"). In practice this makes it unavailable together with the function tracer on MIPS. Fixes: c0436b503591 ("MIPS: Enable dead code elimination") Signed-off-by: Rosen Penev Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit ecc88725cad966bb9ed18fbc6f0b933c14710953 Author: Imre Kaloz Date: Thu Oct 1 21:19:38 2026 +0200 MIPS: SGI-IP27: print the NMI dump on an nbcon console [ Upstream commit b79147fb33c3b5713c005e763b00239ea14b552a ] Since the 8250 console became nbcon, printk() in nmi_dump() only queues records for a printer thread that never runs, as no CPU leaves the NMI handler. Print from an emergency section and flush pending records before the hub reset. Fixes: d3539347022a ("serial: 8250: Switch to nbcon console, take 2") Signed-off-by: Imre Kaloz Reviewed-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin commit 82378cf642bd722d552c200e40aca1596b12d132 Author: Eric Dumazet Date: Tue Nov 3 10:00:11 2026 +0100 tcp: ipv6: free ireq->ipv6_opt after an RCU grace period [ Upstream commit fafbc4051123d5459ea6950899cec08ed946e278 ] ireq->ipv6_opt is only set by calipso_req_setattr(), when a CALIPSO NetLabel mapping is configured. Request socket migration (net.ipv4.tcp_migrate_req=1, or a BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program) clones the request socket with inet_reqsk_clone(), so that the old request socket and its clone share the same ipv6_opt, then reqsk_migrate_reset() clears the pointer in the old one. Another cpu holding a reference on the old request socket can still be using these options, sending a SYNACK from tcp_v6_send_synack() or creating a child in tcp_v6_syn_recv_sock(), when the clone is freed. tcp_v6_reqsk_destructor() frees ipv6_opt with a plain kfree(), leading to a use-after-free. Both readers already run under RCU, like their IPv4 counterparts. Use kfree_rcu() in tcp_v6_reqsk_destructor(), as commit e3f33b0a1d89 ("ipv4: free inet_opt and ireq_opt after an RCU grace period") did for ireq_opt. Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179369559062.488856.15441115725436277776@kernel.org/ Signed-off-by: Eric Dumazet Reviewed-by: Hangbin Liu Reviewed-by: Jiayuan Chen Reviewed-by: Kuniyuki Iwashima Tested-by: Linkui Xiao Link: https://patch.msgid.link/20261103090011.4128420-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 97dca627c464185f92a5484ff10d7dd0c6c6bd3f Author: Long Zhao Date: Tue Nov 3 12:47:17 2026 +0800 gpio: regmap: free the irqchip if adding the irq domain fails [ Upstream commit 80415a6ff295b03dab98ef55598c72be66945d82 ] gpio_regmap_register() creates a regmap irqchip and then calls gpiochip_irqchip_add_domain(). If that call fails, the error path only removes the gpiochip, so the irqchip and its domain leak. Free the irqchip there when this function allocated it. An external irq domain is not affected: irq_chip_data stays NULL and the caller owns that domain. Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device") Cc: Michael Walle Signed-off-by: Long Zhao Reviewed-by: Michael Walle Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20261103-gpio-regmap-irqchip-leak-v1-1-d038a20840f7@ambarella.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 3aee04b4d58cbe6b5e0a9c6d527a936b46f1348a Author: Florian Westphal Date: Thu Oct 29 17:54:45 2026 +0100 netfilter: nat: zero newrange before filling it in [ Upstream commit d1bb235aa409a4e5aeba6c748d953d948625b1e9 ] nf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4() and netmap_tg6() each build a stack-local struct nf_nat_range2 from the caller-supplied range, inheriting range->flags unmodified. Two of them only memset() the min_addr/max_addr members, the other two don't memset() anything at all, so newrange.base_proto is left as stack garbage. If the inherited flags include NF_NAT_RANGE_PROTO_OFFSET, nf_nat_l4proto_unique_tuple() reads range->base_proto.all to compute the NAT port offset. Neither the NETMAP nor the MASQUERADE targets mask the flags field in their checkentry callback, so this uninitialized stack value can end up feeding the NAT port selection. The per-member memset()s are not enough: they have to enumerate every field that must be cleared, and base_proto was missed when NF_NAT_RANGE_PROTO_OFFSET/base_proto was added to the struct. memset() the whole struct instead, so every member is covered regardless of which ones get explicitly assigned afterwards. There are other places that miss this, but those hardcode .flags so nat core won't read from the uninitialized fields. C99 initializers would be preferrable, but this is a more intrusive change. Lets followup in nf-next and convert others as well. This is an LLM finding. Fixes: 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 20fd0512514a3333395e52f1168e94b4a248a3d3 Author: Pablo Neira Ayuso Date: Wed Oct 28 12:25:35 2026 +0100 netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload [ Upstream commit e95b3be75ae0652d40a48a210f0cf5197b3b3783 ] Allocate flow rule object after transaction has been allocation and rule deactivation has been performed, otherwise memleak is possible. Let the transaction unwind the existing rule deactivation from the abort path, this needs to update nft_flow_rule_destroy() to skip release if flow_rule is null. While at this, remove check for non-null flow_rule in newrule error path now that nft_flow_rule_destroy() is skipped if flow_rule is null. Fixes: 63b48c73ff56 ("netfilter: nf_tables_offload: undo updates if transaction fails") Reported-by: Xingyuan Mo Link: https://patch.msgid.link/20261028062204.1079089-1-hdthky0@gmail.com/ Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 4e8db7acf9431d6e16f33445a65c50c13ae04158 Author: Joas Antonio dos Santos Date: Sat Oct 24 14:03:17 2026 -0300 netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() [ Upstream commit 7af52bda65c0bbbf40894aa3df36ac1bb5697984 ] ct_sip_parse_transport() compares the value of the "transport=" header parameter against "TCP"/"UDP" with strncasecmp(..., 3), but it never checks that the parsed value is at least 3 bytes long. ct_sip_parse_param() returns matchlen = end - start, where end is the next ';' or, when there is no ';', the end of the payload buffer (limit = dptr + datalen). If the "transport=" value is only 1 or 2 bytes long and runs exactly to the end of the payload (e.g. a REGISTER request whose Contact header ends in ";transport=T" with no trailing CRLF), matchlen is less than 3 while strncasecmp() still reads up to 3 bytes, reading 1-2 bytes past the end of the linearized skb data. Add a matchlen check before the comparison, mirroring the sdp_media_type() pattern a few lines below, so short values cannot reach strncasecmp(). The bug was found by LLM-assisted manual review of the SIP helper's parsers and confirmed with a userspace ASan harness built from the verbatim parser functions, which reports a heap-buffer-overflow read of size 2 in strncasecmp() called from ct_sip_parse_transport(). Fixes: ea45f12a2766d ("[NETFILTER]: nf_conntrack_sip: parse SIP headers properly") Link: https://patch.msgid.link/20260815133104.50369-1-joasantonio108@gmail.com/ Signed-off-by: Joas Antonio dos Santos Assisted-by: Claude:claude-opus-5-5 Reviewed-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit f865566da51a39ff4ead49ded3f79c03f32376a5 Author: Fernando Fernandez Mancera Date: Mon Oct 26 13:07:10 2026 +0100 netfilter: x_tables: check target name before accessing verdict [ Upstream commit 364b200285bb2cc518e3c5efe6591951c05b8e01 ] Non-standard targets may contain only struct xt_entry_target. mark_source_chains() nevertheless reads the target as an xt_standard_target before checking its name, potentially reading four bytes beyond a header-only target. Check that the target is standard before reading its verdict. Non-standard targets remain handled as fallthrough rules. See the following KASAN trace: BUG: KASAN: slab-out-of-bounds in translate_table+0x1660/0x1a40 [ip6_tables] Read of size 4 at addr ffff88800ed56ff8 by task rep/432 Call Trace: kasan_report+0xfa/0x120 translate_table+0x1660/0x1a40 [ip6_tables] do_ip6t_set_ctl+0x667/0xa76 [ip6_tables] nf_setsockopt+0x77/0xd0 do_sock_setsockopt+0x118/0x490 __sys_setsockopt+0xe4/0x160 __x64_sys_setsockopt+0xbd/0x190 do_syscall_64+0xde/0x4f0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 432: kasan_save_stack+0x2f/0x50 __kasan_kmalloc+0x7f/0x90 __kvmalloc_node_noprof+0x1b1/0x5c0 xt_alloc_table_info+0x3c/0xa0 do_ip6t_set_ctl+0x5ee/0xa76 [ip6_tables] nf_setsockopt+0x77/0xd0 do_sock_setsockopt+0x118/0x490 __sys_setsockopt+0xe4/0x160 __x64_sys_setsockopt+0xbd/0x190 do_syscall_64+0xde/0x4f0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: VEGA Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit a05186f106a42681539552edbda85c4c238b9618 Author: Laveesh Bansal Date: Tue Oct 20 06:29:11 2026 -0700 netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() [ Upstream commit 683ff28ab18accb25268741a724645eee839d41a ] nf_ct_bridge_refrag() warns when skb->protocol is neither IPv4 nor IPv6. A vlan filtering bridge can get there with a vlan ethertype: if the protocol of the tag of a frame differs from the vlan_protocol of the bridge, br_allowed_ingress() moves the tag back into the packet after NF_BR_PRE_ROUTING, where bridge conntrack has already defragmented it. Anyone who can send fragments into a port of such a bridge can trigger the warning, which takes the machine down with panic_on_warn. The packet is dropped either way, so only warn on kernels built with CONFIG_DEBUG_NET. This only avoids the warning. Such fragmented packets are still dropped. syzbot reported the warning. It keeps triggering on CONFIG_DEBUG_NET kernels until the vlan tag is handled, which is left for a follow-up: https://syzkaller.appspot.com/bug?extid=a8ba738fe2db6b4bb27f Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system") Assisted-by: LLM Signed-off-by: Laveesh Bansal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 9c5fa02bd32b97ed9cda14601a0cc8e497822685 Author: Xingyuan Mo Date: Tue Oct 20 11:37:40 2026 +0800 netfilter: nft_set_rbtree: check catchall_sync return before queue_done [ Upstream commit 1cec19d70bc282a8e7f7c42697d44046f60dc506 ] nft_rbtree_gc_queue() passes the result of nft_trans_gc_catchall_sync() straight to nft_trans_gc_queue_sync_done(). When the catchall path flushes a full GC batch and nft_trans_gc_alloc() fails, catchall_sync returns NULL and queue_sync_done dereferences trans->net (NULL+0x10). Guard the call like the pipapo GC path already does. Fixes: 7d259f021aaa ("netfilter: nft_set_rbtree: prefer sync gc to async worker") Assisted-by: opencode:deepseek-v4 Signed-off-by: Xingyuan Mo Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 7a66771cf858dc547518cf3bda60c0bf8e90f39f Author: Qingfang Deng Date: Mon Nov 2 11:59:43 2026 +0800 tcp: initialize send sequence numbers before deferring TFO [ Upstream commit 57889a8f6d49fc153aa0017d13086ab736567f8a ] TCP_FASTOPEN_CONNECT can return from connect() before tcp_connect_init() when a cached cookie or cookieless Fast Open allows deferring the SYN. At this point write_seq contains the initial sequence number, while snd_una and snd_nxt have not been initialized to that sequence number. Consequently, inet_diag and /proc/net/tcp{,6} report the initial sequence number as the send queue length despite no SYN or payload being queued. Initialize snd_una and snd_nxt to write_seq before marking the connection as deferred. Both sequence-based queue lengths then remain zero until the first write starts the connection and runs tcp_connect_init(). Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support") Signed-off-by: Qingfang Deng Reviewed-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Reviewed-by: Kuniyuki Iwashima Reviewed-by: Neal Cardwell Link: https://patch.msgid.link/20261102035943.9700-1-qingfang.deng@linux.dev Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit df3390c2f9ef17a5916905df2abe9a1f236e483f Author: Cheng Yongkang Date: Sat Oct 31 21:48:40 2026 -0700 net: bridge: disable MRP ports before the FDB flush in del_nbp() [ Upstream commit 37dfd0efbfffc20a57e41c2eb349ac49b1ca1ff8 ] del_nbp() flushes the port's FDB entries before it unregisters the RX handler. For a normal port, br_stp_disable_port() moves the port to BR_STATE_DISABLED before this cleanup. That does not hold for an MRP ring port. br_set_state() ignores state changes while BR_MRP_AWARE_BIT is set, so br_stp_disable_port() leaves the port state alone. br_mrp_port_del() then restores forwarding when the bridge is up before clearing the bit. A frame received between br_fdb_cleanup_by_dst() and netdev_rx_handler_unregister() can therefore create a new FDB entry referencing the dying port. Nothing removes that entry before destroy_nbp_rcu() frees the port, so a later frame to the learned MAC can be forwarded through the freed port. Remove the MRP and CFM instances before disabling the port, so that br_stp_disable_port() actually transitions it to BR_STATE_DISABLED. With CONFIG_BRIDGE_VLAN_FILTERING=y, synchronize_net() in nbp_vlan_group_unpublish() also drains receive paths that could still learn with the old state before the final FDB cleanup. Found through an LLM-assisted source code analysis workflow and reproduced on net with KASAN and CONFIG_BRIDGE_VLAN_FILTERING=y in QEMU. A diagnostic switchdev module accepts MRP objects and delays the NETDEV_CHANGEUPPER callback for 1.5 s, holding del_nbp() after the FDB cleanup and before RX handler removal. The reproducer floods the MRP port with rotating source MACs, waits for the port's RCU callback through the module's rcu_barrier(), then sends frames to those MACs from another port. The unpatched kernel reports: BUG: KASAN: slab-use-after-free in br_forward+0xb1/0x820 Call Trace: br_forward+0xb1/0x820 br_handle_frame_finish+0x148b/0x1e50 br_handle_frame+0x90a/0x15c0 With this patch, three runs of six cycles each reach the delay without a KASAN report. Fixes: 6536993371fa ("bridge: mrp: Integrate MRP into the bridge") Suggested-by: Ido Schimmel Link: https://lore.kernel.org/netdev/20261012123051.GA714215@shredder/ Closes: https://lore.kernel.org/netdev/20261022090431.3641707-1-teel4res@gmail.com/ Signed-off-by: Cheng Yongkang Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261101044840.1595584-1-1020691186@qq.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit fbf142bfadbaf68092f77847aaafab62ad26fca8 Author: Lorenzo Bianconi Date: Mon Nov 2 12:46:04 2026 +0100 net: stmmac: set XDP metadata length on the page_pool RX path [ Upstream commit 6d9b7c85af57305ec2bd5907124478867edcc60b ] stmmac_rx() initializes the XDP buffer with the metadata area valid, so an XDP program can reserve metadata with bpf_xdp_adjust_meta() and write it in [xdp->data_meta, xdp->data), for example to export the RX hardware timestamp obtained from the metadata kfunc. When such a frame is passed to the stack, the skb is built in place around the same page with napi_build_skb(), but skb_metadata_set() is never called. napi_build_skb() clears skb_shared_info up to dataref, which includes meta_len, so skb_metadata_len() stays zero. The stack and TC BPF then see an empty metadata range even though the bytes are present in the skb headroom. The AF_XDP zero-copy path already records the length in stmmac_construct_skb_zc(). Record the metadata length after reserving the headroom and adding the frame data. No copy is needed because the skb is built over the buffer the XDP program wrote to. With the length recorded, the software VLAN stripping path can move the metadata together with the MAC header, as it already does for zero-copy frames. Fixes: e3f9c3e34840 ("net: stmmac: add Rx HWTS metadata to XDP receive pkt") Signed-off-by: Lorenzo Bianconi Reviewed-by: Daniel Machon Reviewed-by: Nicolai Buchwitz Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20261102-stmmac_meatada_pp_path-v1-1-d93cc4f9a864@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 9852b6b0e681277c47dfd18ed0dc65c1ccb7d0db Author: Timur Stukan Date: Sun Nov 1 17:02:39 2026 +0200 bonding: fix missing down path on speed/duplex failure after FAIL->UP [ Upstream commit a76ab5e733b41dede6f238a691eefb4374f99f79 ] In bond_miimon_commit(), when a slave is proposed as BOND_LINK_UP but bond_update_speed_duplex() fails in bonding mode that needs speed/duplex (802.3ad, tlb, alb), the slave is set to BOND_LINK_DOWN directly. This bypasses bond_set_slave_link_state(), bond_miimon_link_change() and failover. This is fine for slave that coming from BOND_LINK_BACK, which was never brought up and is not in use. But since commit 1899bb325149 ("bonding: fix state transition issue in link monitoring") the commit phase also handles BOND_LINK_FAIL -> BOND_LINK_UP which means a slave that is still in use and may be curr_active_slave. If the link recovers within downdelay and goes down again before the commit phase reads speed/duplex, the slave is silently marked down while remaining the active slave in worst cases. In alb/tlb the bond MAC stays on the dead port, no failover happens and TLB/RLB state is not cleaned, so the bond stops passing traffic until that link comes back even though other slaves are up. A non-active slave is affected too, in alb, RLB clients assigned to it are not reassigned and become unreachable. Reproduced in tlb and alb mode with miimon=100 and downdelay=10000 by flapping a slave within downdelay and dropping it again before commit (a longer delay was added between inspect and commit to make window wider and easier to test): bond0: (slave enp0s3): link status down for interface, disabling it in 10000 ms bond0: (slave enp0s3): link status up again after 3400 ms bond0: (slave enp0s3): failed to get link speed/duplex procfs then shows the active slave with "MII Status: down" and "Link Failure Count: 0", and all traffic is lost. Fix this by dropping the loop in bond_mii_monitor() that applied all proposed link states before bond_miimon_commit(). bond_miimon_commit() now applies each state itself: UP after the speed/duplex check, as it already did, DOWN in the down path, and FAIL/BACK directly. So when the speed/duplex check runs, slave->link still holds the previous state. If the check fails for a slave that is FAIL or UP, take it through the regular down path, including failover. DOWN and BACK slaves were never brought up and are still just reverted to DOWN. The down path is moved into bond_miimon_slave_down() so both callers share it. After the fix: bond0: (slave enp0s3): failed to get link speed/duplex bond0: (slave enp0s3): link status definitely down, disabling slave bond0: (slave enp0s4): making interface the new active one Fixes: 1899bb325149 ("bonding: fix state transition issue in link monitoring") Signed-off-by: Timur Stukan Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20261101150240.66292-1-timur.stukan.linux@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit f9ca379fec83686acc41e97ee714c99544abbc16 Author: Kyle Zeng Date: Thu Oct 29 21:22:21 2026 -0700 ip6mr: Serialize multicast router socket ownership [ Upstream commit c6b41de4dd9f2d6856d8d8d292348f7961034152 ] MRT6_TABLE checks whether the socket owns its current table before acquiring RTNL. MRT6_INIT also looks up its table before taking RTNL. Consequently, concurrent TABLE and INIT calls can initialize the old table and then change the socket's selected table. Another INIT can register the same socket in the new table. rawv6_close() calls ip6mr_sk_done(), which clears only the first table owned by the socket. After the socket's RCU-delayed free, the other table retains a dangling mroute_sk pointer. A subsequent multicast cache report passes that pointer to sock_queue_rcv_skb_reason(). This produces a KASAN slab-use-after-free in sk_filter_trim_cap(). Look up the selected table in ip6mr_sk_init() after acquiring RTNL. Likewise, re-read the current table and check its owner under RTNL in MRT6_TABLE before updating the selection. This preserves the single-table ownership invariant shared with ip6mr_sk_done(), without changing the locking of the other multicast socket options. Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables") Signed-off-by: Kyle Zeng Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261030042221.73996-1-kylebot@openai.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 3d1890c1879ca9802015bf52d7b3e18afd6774b8 Author: Timur Stukan Date: Sun Nov 1 16:56:53 2026 +0200 bonding: 3ad: don't set BOND_LINK_FAIL on a slave that is not up [ Upstream commit 9a65b9c2a97594bcaaf393329807653eff895bbf ] In 802.3ad mode, when bond_update_speed_duplex() fails on NETDEV_UP or NETDEV_CHANGE, bond_slave_netdev_event() sets the slave link to FAIL if the slave has ever been up (last_link_up != 0), and to DOWN otherwise, so that miimon can set it right once speed/duplex are valid. last_link_up is never cleared, so a slave that is currently DOWN but was up before is set to FAIL as well. miimon then treats it as a slave that is still in use and takes it through the full down path again: the link failure count is incremented, "link status definitely down" is logged and the 802.3ad port is disabled a second time, although the slave has not been up since it went down. Reproduced in 802.3ad mode with miimon=100 by setting a slave down and up again. On NETDEV_UP the speed is still unknown, so the notifier sets FAIL, and the next miimon pass sees no carrier and proposes DOWN: ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate 1 ip link set enp0s3 down ip link set enp0s4 down ip link set enp0s3 master bond0 ip link set enp0s4 master bond0 ip link set enp0s3 up ip link set enp0s4 up ip link set bond0 up # wait for LACP to settle ip link set enp0s3 down ip link set enp0s3 up procfs then shows "Link Failure Count: 2" in enp0s3 slave part. Also in dmesg wrote twice: "link status definitely down, disabling slave". Fix this by setting FAIL only for a slave that is currently UP and leaving other states alone. An up slave that loses speed/duplex still goes through FAIL as before, and DOWN/BACK slaves are left to miimon, as in the other modes. Fixes: ea53abfab960 ("bonding/802.3ad: fix link_failure_count tracking") Signed-off-by: Timur Stukan Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20261101145653.63648-1-timur.stukan.linux@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 2396429ea7c1f9c0a6c2d2c5adb19f66d025eff9 Author: Colton Pawielski Date: Sat Oct 31 11:47:23 2026 -0500 net: 8139cp: keep Rx masked while NAPI is scheduled [ Upstream commit 547b1ae5ec50b7d81b05b4219e0db7e56279d65f ] cp_rx_poll() calls napi_complete_done() and only then takes cp->lock with interrupts disabled to unmask the Rx interrupts. An interrupt that is not masked while polling (TxOK, TxErr, ...) can arrive in between. cp_interrupt() then sees the Rx status bits, which are still set, finds NAPI no longer scheduled, masks Rx and schedules NAPI again. cp_rx_poll() then carries on and unmasks Rx anyway. From that point Rx interrupts are enabled while NAPI is scheduled: cp_interrupt() leaves the Rx bits for the poll routine, does not mask them because napi_schedule_prep() fails, and the level-triggered interrupt fires again as soon as it returns. On an SH7751 LANDISK under combined Tx/Rx load this interrupt storm was captured with a RAM trace right before the board locked up hard. Mask Rx in cp_interrupt() whenever Rx status is pending, not only when NAPI gets scheduled. If the race leaves Rx unmasked, the next interrupt masks it again, and the pending poll unmasks it when it completes. Fixes: ab1e7e1d2666 ("8139cp: use napi_complete_done()") Signed-off-by: Colton Pawielski Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261031-b4-8139cp-napi-v2-1-5824797c0fe6@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 9787a6b21c4ec704ce1f0ddc8e1fdebb875b4b59 Author: Jinseob Kim Date: Wed Nov 4 20:59:38 2026 +0900 gpiolib: reset lookup flags for each hogged line [ Upstream commit c20464a78162cf8b3a1c9dc7e0d764e535bfe582 ] gpiochip_add_hog() initializes lflags once before iterating over the GPIO specifiers. In the non-OF path, an active-low line sets GPIO_ACTIVE_LOW, but a later active-high line does not clear it. A single firmware hog with mixed polarities therefore configures later active-high lines as active-low, including inverting their initial output value. Initialize the lookup flags for each line before translating its flags. The OF helper already overwrites the flags for each specifier; the non-OF path must also start with a fresh value. Codex assisted with identifying the issue and developing the fix. Fixes: 802c51a83e9a ("gpiolib: fix hogs with multiple lines") Signed-off-by: Jinseob Kim Link: https://patch.msgid.link/20261104115938.226-1-kimjinseob88@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 00d9a7f1232eb1928c5dc82753ce3e88665c0691 Author: Chris Chiu Date: Thu Nov 5 10:56:47 2026 +0800 ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a [ Upstream commit 022e9f8f094279ecd632b3846968790fad7d8ad6 ] HP ZBook 8 G2a (SSIDs 0x103c:0x8f40, 0x103c:0x8f41, 0x103c:0x8f42, 0x103c:0x8f62) use the Realtek ALC245 codec with a TAS2781 amplifier via I2C. They share the same hardware configuration as the related 0x103c:0x8f94 / 0x103c:0x8f95 models but were left on ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED, which drives the speaker mute LED backwards: off when muted and on when unmuted. Reassign these SSIDs to ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED so the LED follows mute state correctly. Fixes: 9afbbf490322 ("ALSA: hda/realtek - Enable Mute LED and Tas2781 for HP platform") Signed-off-by: Chris Chiu Link: https://patch.msgid.link/20261105025647.1116662-1-chris.chiu@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit b6bcf4f7fe004f160b7ea5782493cfa2139e5fdc Author: Richard Fitzgerald Date: Wed Nov 4 12:23:37 2026 +0000 ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() [ Upstream commit 8c63987ac7fe605c337edbf9052cf97e2a415558 ] In cs35l56_hda_unbind() call cs_dsp_stop() before cs_dsp_power_down() if cs_dsp is in a running state. cs35l56_hda_runtime_resume() calls cs_dsp_run() if cs_dsp_power_up() has previously run successfully. If cs35l56_hda_unbind() is then called while in this runtime-resumed state cs_dsp will be running. The code wasn't checking for this and was calling cs_dsp_power_down() while still in a running state, which is illegal. This is currently fairly harmless for the cs35l56 driver. But it doesn't comply with the API, so potentially could break with any future changes that expect the correct API use. Fixes: fb78d73dde2d4 ("ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()") Signed-off-by: Richard Fitzgerald Link: https://patch.msgid.link/20261104122337.1072468-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit a07decca9b75effa50c4ff49f4427da7f11735c5 Author: Richard Fitzgerald Date: Wed Nov 4 11:11:21 2026 +0000 ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load() [ Upstream commit d2895945d37e3426191894a010f94db31c206e10 ] Remove the gotos from cs35l56_hda_fw_load() to prevent mixing auto-cleanup and goto-cleanup in the same function. Replace them with returns and remove the goto cleanup code, as there's no need to "undo" a cs_dsp_power_up() with a cs_dsp_power_down() here. Two previous commits added auto-cleanup to cs35l56_hda_fw_load() but didn't remove the goto, which leaves mixed cleanup and goto. commit 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with PM_RUNTIME_ACQUIRE*() macros") commit 185841c94accc ("ALSA: hda: cs35l56: Use auto-cleanup for firmware loading") There's actually no need to call cs_dsp_power_down() here. On the CS35L54/56/57 amps it doesn't control the DSP subsystem power (that is all managed by the firmware), so it's perfectly safe to just return if there are any errors after a successful cs_dsp_power_up(). As cs_dsp_power_up() was successful it is valid to leave cs_dsp in this state, which matches the state of the hardware. The two places that cs_dsp_power_down() is called conditionally have been changed to check the cs_dsp.booted flag, now the fw_patched flag is not a guaranteed proxy. The booted flag is directly indicating that there has been a successful cs_dsp_power_up() so this is more correct anyway. Fixes: 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with PM_RUNTIME_ACQUIRE*() macros") Signed-off-by: Richard Fitzgerald Link: https://patch.msgid.link/20261104111121.1054077-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 062b20cbc22ccd56eed5aace72179259124cf155 Author: Michał Kopeć Date: Mon Nov 2 12:49:39 2026 +0100 ALSA: hda/core: Stop capability walk on empty capability header [ Upstream commit f65c917397c77daeb7e6d0893ebe89107ddd5692 ] snd_hdac_bus_parse_capabilities() walks the controller's linked capability list starting at LLCH. On some platforms one of the entries reads back as all zeros. Such a header does not describe a capability, but the walk still treats it as one: it falls into the default case and reports an error, printing the raw register value instead of the capability ID: snd_hda_intel 0000:00:1f.3: Unknown capability 0 The walk then stops anyway, because the next pointer of a zero header is 0, so the message is only noise. Treat an all-zero header as the end of the list, the same way a failed read (-1) is already handled, and log it at debug level only. Also print the capability ID in hex for a genuinely unknown capability, instead of the full header value. Fixes: 0b00a5615dc4 ("ALSA: hdac_ext: add hdac extended controller") Signed-off-by: Michał Kopeć Link: https://patch.msgid.link/20261102114939.2182131-1-michal.kopec@3mdeb.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 547288341f5e2e5b4e4a1fa2a35e93f82177b615 Author: Takashi Sakamoto Date: Mon Nov 2 12:36:52 2026 +0900 ALSA: firewire: fix inverted streaming speed between tx and rx streams [ Upstream commit 64d3a2c8e7bc0d3cf144d71ee2fb357c15b6c71f ] ALSA firewire-tascam driver uses inverted streaming speed when reserving isochronous resources between tx and rx streams. Correct the streaming speeds. This has no impact on existing functionality, as both streams are always reserved together when handling PCM substreams. Fixes: dbd0cf204fe6 ("ALSA: firewire-tascam: reserve resources for transferred isochronous packets at S400") Signed-off-by: Takashi Sakamoto Link: https://patch.msgid.link/20261102033652.1184893-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit e38307bbcbdcd0eaa796c2ee8f6bbd11dc8cd69f Author: Shivam Madlani Date: Sun Nov 1 20:08:18 2026 +0530 ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7 [ Upstream commit 5cdee541b37c6d29a6e05cb2a875a365cfbcf520 ] The HP OmniBook 7 Laptop 14-fr0xxx (PCI SSID 103c:8e3b) uses an ALC245 codec with CS35L41 amplifiers. The existing quirk ALC287_FIXUP_CS35L41_I2C_2 does not configure the speaker mute or mic-mute LEDs, leaving them non-functional. Switch to ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED, which controls the speaker mute LED via COEF index 0x0b, the mic-mute LED via GPIO 0x04, and chains to the CS35L41 amplifier setup. Also update the model name from the internal board codename ("HP Agusta") to the retail product name. Fixes: 7150d57c370f ("ALSA: hda/realtek: Add support for HP Agusta using CS35L41 HDA") Signed-off-by: Shivam Madlani Link: https://patch.msgid.link/20261101143818.17714-1-shivammadlani5@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit bf9bfea87df7119ef5966d928645df42798dab83 Author: Munique Feitoza Date: Fri Oct 30 17:28:09 2026 -0300 drm/nouveau: Fix CE channel creation on pre-Kepler GPUs [ Upstream commit a2b7b707d75e605d31fb3d85a6b27f8bb2a01413 ] Commit 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel") changed nouveau_accel_ce_init() to unconditionally request a privileged channel (priv = true) when calling nouveau_channel_new(). However, privileged channels (func->ramfc->priv) are only supported on Kepler (gk104_chan_ramfc) and newer FIFO implementations. On pre-Kepler GPUs that expose a Copy Engine runlist, func->ramfc->priv is false, which causes nvkm_chan_new_() to reject the channel creation with -EINVAL: nouveau 0000:01:00.0: DRM: failed to create ce channel, -22 Only request a privileged CE channel when device->info.family >= NV_DEVICE_INFO_V0_KEPLER. Fixes: 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel") Signed-off-by: Munique Feitoza Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261030202809.28723-1-muniquefeitoz4@gmail.com Signed-off-by: Sasha Levin commit d3fe4821f01787ebfb20006a95f1088b5eb4bdd3 Author: Rosen Penev Date: Tue Nov 3 14:15:29 2026 -0800 drm/nouveau/fifo: map Kepler video engine contexts non-privileged [ Upstream commit 0820004c342af7ca1b01d0b21e0d5d99ad5c10eb ] Since the engine context rework, gk104_ectx_ctor() maps every engine context into the channel's VMM as a privileged page. The MSVLD, MSPDEC and MSPPP falcons on Kepler fetch their context with non-privileged requests, so the first method sent to any of them faults and the channel is killed: fifo: fault 00 [READ] at 0000000001050000 engine 10 [MSVLD] client 0d [HUB/MSVLD] reason 05 [PRIV_VIOLATION] on channel 9 fifo: fault 00 [READ] at 0000000001051000 engine 14 [MSPDEC] client 0b [HUB/MSPDEC] reason 05 [PRIV_VIOLATION] on channel 10 fifo: fault 00 [READ] at 0000000001052000 engine 11 [MSPPP] client 0c [HUB/MSPPP] reason 05 [PRIV_VIOLATION] on channel 11 Before the rework, gk104_fifo_gpfifo_engine_ctor() mapped engine contexts without the privileged bit. Restore that for the three video engines, and keep the privileged mapping for everything else. Fixes: 8ab849d6dd4c ("drm/nouveau/fifo: add new engine context handling") Signed-off-by: Rosen Penev Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261103221529.585436-1-rosenp@gmail.com Signed-off-by: Sasha Levin commit 6fdf8476f50e75e0f09830725a6f138960e1ea61 Author: Frederic Konrad Date: Wed Nov 4 12:49:58 2026 +0530 spi: cadence-quadspi: Fix race between DMA completion and transfer start [ Upstream commit 059518f775baecc9803fc97787bd0b17558f8047 ] In cqspi_versal_indirect_read_dma(), the DMA transfer is started by writing CQSPI_REG_INDIRECTRD_START_MASK to the indirect read control register. Under certain timing conditions, the DMA completion interrupt may be triggered and complete the transfer before the completion structure is reinitialized. This creates a race where the completion event is lost, causing wait_for_completion_timeout() to time out even though the transfer has already completed, resulting in errors such as: spi-nor spi0.0: CS0: operation failed with -110 Fix this by reinitializing the completion structure before starting the DMA transfer, ensuring that any completion event generated after the transfer begins is correctly observed. Fixes: 1a6f854f7daa ("spi: cadence-quadspi: Add Xilinx Versal external DMA support") Signed-off-by: Frederic Konrad Signed-off-by: Srikanth Boyapally Signed-off-by: Radhey Shyam Pandey Link: https://patch.msgid.link/20261104071958.2405117-1-radhey.shyam.pandey@amd.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 2dbe65d9c6b73ae8cbe9de5e9ce9f56fe2a2cc45 Author: Luiz Augusto von Dentz Date: Wed Nov 4 17:16:50 2026 -0500 Bluetooth: Fix not updating of hdev->commands[] after reset [ Upstream commit e00aa1a33f81a5e25b510f569ab9cb9f97eb41b9 ] Read Local Supported Commands was only read once during the INIT/SETUP flow, but the supported commands bits may change at runtime, for example after a firmware change applied with vendor commands, so update hdev->commands[] every time the response is received. Fixes: 6a070e6e81ad ("Bluetooth: Store supported commands only during setup procedure") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f53963bca469ac95114e5527ea1f84d3605ec33b Author: Florian Fainelli Date: Thu Oct 29 14:15:40 2026 -0700 net: dsa: b53: restore the NSP IMP port 2 Gbps mode [ Upstream commit 41af38324341df9d769641d6485abb67fd5209ed ] The Northstar Plus IMP port uses the switch's proprietary 2 Gbps mode for its internal link to the AMAC. Its fixed-link description reports 1 Gbps, so applying that speed clears PORT_OVERRIDE_SPEED_2000M and leaves the two ends of the internal link configured at different speeds. Force the 2 Gbps mode and flow control for BCM5301x and NSP CPU ports. The mismatch caused switch output queue discards on both copper and SerDes ports, with one discard for every TCP retransmission. With both ends restored to their high-speed modes, iperf3 reports no retransmissions. Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link") Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261029211540.4123250-3-florian.fainelli@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 68c680f0faab3e82123b9ad7793c8585273a8bb7 Author: Florian Fainelli Date: Thu Oct 29 14:15:39 2026 -0700 net: ethernet: bgmac: preserve forced 2.5 Gbps link speed [ Upstream commit d4f3d2c04624854d27aa948cd7bfc9d946faaac5 ] Northstar and Northstar Plus use a 2.5 Gbps internal link between the AMAC and the switch. BGMAC_FEAT_FORCE_SPEED_2500 makes bgmac_miiconfig() configure that speed, but bgmac_adjust_link() subsequently replaces it with the synthetic fixed PHY's 1 Gbps speed. Use the forced speed when processing link changes so the MAC remains at 2.5 Gbps. Together with configuring the switch IMP port for its 2 Gbps mode, this eliminates the output queue discards that caused approximately 1000 TCP retransmissions per second during an iperf3 transmit test. Restrict the platform forced-speed flag to Northstar Plus using the SoC compatible, since Hurricane2 shares the AMAC compatible. Other platform AMACs without a phy-handle must continue following the fixed PHY speed. The BCMA path already selects the flag only for the Northstar family. Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support") Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261029211540.4123250-2-florian.fainelli@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 021c7ebf29fe17674f221b7bdf2d3c2e006439d1 Author: Stanislavs Nilovs Date: Tue Nov 3 12:34:14 2026 +0200 Bluetooth: qca: Disable SoC debug logging for WCN3950 [ Upstream commit d97b618b6675516d63d55b8f31ee6cb3b164bd6b ] Added WCN3950 module to the switch-case to disable SoC debug packets. Fixes: 590deccf4c06 ("Bluetooth: hci_qca: Disable SoC debug logging for WCN3991") Signed-off-by: Stanislavs Nilovs Reviewed-by: Bartosz Golaszewski Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 2b050a1a00737e83f50893be0b33b9062c942626 Author: Zhao Li Date: Mon Nov 2 20:47:35 2026 +0800 Bluetooth: L2CAP: Clear request identifiers on incoming LE connections [ Upstream commit 15a80cc8263abd50132a05d1b06824de8e28abcb ] Incoming LE and ECRED channels retain the peer's request identifier after an immediate response. The deferred LE response also leaves the identifier set, unlike the deferred ECRED response. A later ECRED request can reuse that identifier and include an unrelated channel in its shared-response handling. That walk matches on the identifier alone, so an LE channel is selected too. If the old channel is closing, the checks can refuse the new connection. The check at request receipt rejects it with L2CAP_CR_LE_INVALID_PARAMS; the check before a deferred response returns L2CAP_CR_LE_AUTHORIZATION. Store the identifier only when deferring the response, and clear it after sending the deferred LE response. Keep deferred ECRED identifiers until the shared response is sent, since a partially accepted group still needs them. AI assistance was used. Fixes: 27e2d4c8d28b ("Bluetooth: Add basic LE L2CAP connect request receiving support") Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Signed-off-by: Zhao Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 5e20d7e8ee59d0d59e63cc84f410264bc73eebc7 Author: Zijun Hu Date: Mon Nov 2 22:55:20 2026 -0800 Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path [ Upstream commit 3efdadae3a252b14ca1f62b16e31a9aa7c5d30cf ] Correct (Input|Output)_Transport_Unit_Size based on Core spec v6.3, Vol 4, Part E, 7.1.45: "The Host shall set the Input_Transport_Unit_Size and Output_Transport_Unit_Size to be equal. For HCI Host transport the Host shall set them to 0." Fixes: b2af264ad3af ("Bluetooth: Add support for HCI_Enhanced_Setup_Synchronous_Connection command") Signed-off-by: Zijun Hu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 5e4d5f691dc7d4e6272f4756323aa7cb30eb7f21 Author: Richard Fitzgerald Date: Wed Nov 4 13:33:22 2026 +0000 ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() [ Upstream commit 4d07af76ca41cc1a03240cd3b5f44dc428856214 ] Check that avail does not become < 1 in wm_adsp_control_add(). This prevents overflows during subsequent operations. The main aim is to trap a negative value in avail, but a zero length would mean that the control ends up without a name, so 1 is the smallest valid value. Fixes: b7ede5af62ab6 ("ASoC: wm_adsp: Take prefix into account in control name length") Signed-off-by: Richard Fitzgerald Link: https://patch.msgid.link/20261104133322.1085061-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 3fc7374e642ec4c06cf403a38e0c837ee8f351f9 Author: Sasha Levin Date: Wed Oct 28 23:45:07 2026 -0400 ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() [ Upstream commit 17654aa629cba9a70e31cc1b7226a4fc1a1c801a ] acpi_bus_offline() and acpi_bus_online() hold the physical_node_lock of the ACPI device being hot-removed while they call device_offline() and device_online() for its physical nodes. Offlining a CPU this way takes cpu_add_remove_lock and the CPU hotplug lock under physical_node_lock, and lockdep connects that to the uevent attribute of platform devices, whose store method takes physical_node_lock in acpi_primary_dev_companion(): physical_node_lock (acpi_bus_offline()) -> cpu_add_remove_lock -> cpu_hotplug_lock -> cpuhp_state-down (mce_cpu_pre_down() unregistering a device) -> device_links_lock (device_links_purge()) -> kn->active of a uevent attribute (device link unregistration) -> physical_node_lock (uevent_store() -> acpi_companion_match()) syzbot has reported this cycle twice. The uevent attribute waited for in the link unregistration is the device link's, not a platform device's, and the physical_node_lock taken at the end is that of the platform device's ACPI companion, not of the processor being ejected, so lockdep only connects them because they share lock classes and this is unlikely to deadlock. However, lockdep turns itself off after reporting it. It can be reproduced in a QEMU guest by writing to the uevent attribute of an ACPI-enumerated platform device, reading the uevent attribute of a device link while the link is removed, offlining a CPU and ejecting one through sysfs. physical_node_lock protects the list of physical nodes. Since acpi_unbind_one() blocks on it, holding it also keeps device_offline() and device_online() from running in parallel with whatever happens to a device after it has been unbound from its ACPI companion, but that is not necessary: a reference to each device is held while the lock is dropped, and the removal of the devices that can actually be taken offline here (CPUs, memory blocks and containers) is serialized by the device hotplug lock or acpi_scan_lock, both of which acpi_device_hotplug() holds throughout. So drop physical_node_lock around device_offline() and device_online(). Mark the nodes to offline with a new offline_pending flag, hold a reference to each device while the lock is dropped, and look its node up again afterwards to record whether it needs to be put back online, because it may have been unbound in the meantime. Physical nodes added while the lock is not held are not offlined by the current pass, which is no different from adding them right after it. Since acpi_container_offline() no longer runs under the container's physical_node_lock, the nesting annotation added to acpi_scan_is_offline() by commit 4c533c801d1c ("ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()") is not needed anymore, so drop it. Fixes: 683058e315f0 ("ACPI / hotplug: Use device offline/online for graceful hot-removal") Reported-by: syzbot+cea7285bc17b76ffe39f@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/6ae18ed0.6200f071.51519.0f60.GAE@google.com Reported-by: syzbot+a265816368571f78ab88@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/6adf293a.67317f00.38c4bc.00af.GAE@google.com Signed-off-by: Sasha Levin Link: https://patch.msgid.link/20261029034507.2721580-3-sashal@kernel.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 10baa8180bd4e553f2826cb73a703d4040350a1f Author: Sasha Levin Date: Wed Oct 28 23:45:06 2026 -0400 ACPI: scan: Print the offline failure message in acpi_bus_offline() [ Upstream commit b9ea1e921c2721546f53270cffdc6866e20576dd ] When a physical node of an ACPI device being hot-removed cannot be offlined, acpi_bus_offline() passes the physical device back to acpi_scan_try_to_offline() through ret_p and the latter prints "Offline failed." for it after the namespace walk. By then physical_node_lock is not held anymore, so the device may have been unbound from its ACPI companion and freed in the meantime. Print the message in acpi_bus_offline() when device_offline() fails in the second pass, while physical_node_lock keeps the device bound to its ACPI companion and so the reference taken by acpi_bind_one() is still held. acpi_scan_try_to_offline() only needs to know that something could not be offlined, so pass the ACPI device back through ret_p instead, like in the "Offline disabled." case. Fixes: 303bfdb1a14d ("ACPI / scan: Add second pass of companion offlining to hot-remove code") Suggested-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Link: https://patch.msgid.link/20261029034507.2721580-2-sashal@kernel.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit ea5b9ec37ad52c358a7c8ebfcd04e8fdd8a2a365 Author: Richard Fitzgerald Date: Wed Nov 4 15:24:02 2026 +0000 firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path [ Upstream commit 39d31f76ad1b12f1b5e6ef4c15f89e6b3c3f603a ] If cs_dsp_power_up() fails on or after cs_dsp_load() mark the controls disabled and free the alg regions. Fixes: f6bc909e7673c ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs") Signed-off-by: Richard Fitzgerald Link: https://patch.msgid.link/20261104152402.1153795-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit efe38fc803cff40800637b93e299f171e336a956 Author: Stanley Jhu Date: Wed Nov 4 23:16:51 2026 +0800 PM: runtime: Update runtime_pm.rst for non-fatal resume errors [ Upstream commit 7a93f7e30a3f7c8dd4f5fe4cde54d01c8018e2bc ] Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures"), rpm_callback() no longer sets dev->power.runtime_error when ->runtime_resume() returns an error. However, Documentation/power/runtime_pm.rst still states in both the resume callback rules and the ->runtime_idle() comparison that the PM core treats ->runtime_resume() errors as fatal device errors and blocks runtime PM helper functions until the status is manually reset. Update the resume callback semantics bullet to state that on error the PM core resets the runtime PM status to 'suspended', returns the error code from synchronous resume helpers, and unlike with the suspend callback never treats resume failures as fatal, leaving the Section 4 runtime PM helpers unblocked so a subsequent resume request can run ->runtime_resume() again. Also drop ->runtime_resume() from the ->runtime_idle() fatal-error comparison. Fixes: eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures") Fixes: aedc51762a0d ("PM: runtime: Clarify ->runtime_idle() callback return value handling") Signed-off-by: Stanley Jhu Reviewed-by: Brian Norris Reviewed-by: Bart Van Assche [ rjw: Adjustment of the resume callback errors bullet point ] Link: https://patch.msgid.link/20261104151651.3035537-1-stanleyjhu@google.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit d0bce38f5698fd7189a7ec3cbb73a6339d7c1d88 Author: Brian Norris Date: Tue Sep 29 19:49:53 2026 -0700 PM: runtime: Clarify ->runtime_idle() callback return value handling [ Upstream commit aedc51762a0d3d4a50d1542b59aafcd6060c4b39 ] This doc says "Negative error return codes are ignored by the PM core" for ->runtime_idle(). This is misleading: any non-zero return value (including negative error codes such as -EBUSY or -EAGAIN) tells the PM core to abort automatic suspension of the device, which is commonly used by subsystems to prevent immediate runtime suspend. Clarify that unlike ->runtime_suspend() and ->runtime_resume(), the PM core does not treat negative return values from ->runtime_idle() as a fatal device error, and that any non-zero value stops the PM core from suspending the device. Signed-off-by: Brian Norris Link: https://patch.msgid.link/20260929194956.v3.5.If6e26acac7770c65446dd0b81f891948abb38973@changeid Signed-off-by: Rafael J. Wysocki Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors") Signed-off-by: Sasha Levin commit 3e1f3e39c1ab4ff41363de5257508373071c1fe2 Author: Brian Norris Date: Tue Sep 29 19:49:52 2026 -0700 PM: runtime: Add "Section" hyperlinks [ Upstream commit 86122467eea539ac13d40b6938abd1fbb40fb640 ] Add reStructuredText targets for each section, and use them throughout to make the generated HTML more navigable. Signed-off-by: Brian Norris Link: https://patch.msgid.link/20260929194956.v3.4.I7666a5802ea59359afce4ff7d0b1af668e5f5292@changeid Signed-off-by: Rafael J. Wysocki Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors") Signed-off-by: Sasha Levin commit 1ba64f85c106b823cf936799ba6e10a92eebed38 Author: Brian Norris Date: Tue Sep 29 19:49:51 2026 -0700 PM: runtime: Misc improvements to runtime_pm.rst [ Upstream commit 437b4ed6cb5848027fe9b9c8d0da495eef7f8de3 ] There are several small errors and omissions, as well as new updates (pm_runtime_resume_and_get(), devm_pm_runtime_enable()) we should incorporate. Signed-off-by: Brian Norris Link: https://patch.msgid.link/20260929194956.v3.3.I383681b22c12d7caee976cb91aa90d1a94d4a591@changeid Signed-off-by: Rafael J. Wysocki Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors") Signed-off-by: Sasha Levin commit 4d3f5ef6746c108d399c13de3b4c5cbb147a3e80 Author: Mario Limonciello Date: Tue Nov 3 08:14:57 2026 -0600 drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence [ Upstream commit a26ec190925733dd205507493e936e59dbcd2b19 ] On Navi1x/Sienna Cichlid with runtime PM, when the audio function is enabled, BACO entry and exit are delegated to PMFW by sending SMU_MSG_ArmD3 instead of going through smu_v11_0_baco_set_state(). Unlike the v13/v14/v15 helpers, smu_v11_0_baco_set_armd3_sequence() does not update smu_baco->state, so the driver keeps reporting SMU_BACO_STATE_EXIT while the ASIC is armed for / sitting in BACO. At runtime resume amdgpu_device_baco_exit() checks amdgpu_device_supports_baco(), which ends up in smu_v11_0_get_bamaco_support(). Since the state never reads ENTER, the "already in BACO" shortcut is skipped and the live BACO feature bit is consulted instead. PMFW clears that bit once ArmD3(BACO) is armed, so the check reports "supported but not enabled", the exit fails with -ENOTSUPP and the ULPS ArmD3 message is never sent. The runtime resume caller ignores the error, and a later secondary bus reset leaves the device unreachable. This shows up on a Navi 23 being handed from amdgpu to vfio-pci: baco_enter: in_runpm=1 audio_enabled=1 armd3=1 baco_state=1 ret=0 bamaco: state=1 ... feat supported=1 enabled=0 in_runpm=1 baco_exit: supports=0 ... runtime resume: baco_exit ret=-524 Update smu_baco->state in the helper, mirroring the v13 implementation, so the capability check short-circuits while in BACO. Reported-by: Nathan Blomquist Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/6076 Tested-by: Nathan Blomquist Fixes: 13d75eadfa1a ("drm/amd/pm: correct the runpm handling for BACO supported ASIC") Acked-by: Alex Deucher Link: https://patch.msgid.link/20261103141457.2558235-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher (cherry picked from commit d515b2694eab5b35533c7fb7af5bddff53ff60d3) Signed-off-by: Sasha Levin commit e417824c090f3e6aaa9379092b92a79830218166 Author: Eric Dumazet Date: Mon Nov 2 08:54:41 2026 +0100 tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() [ Upstream commit 8e069fd3fd396b89af417e50b359bc9892dd41cd ] When IPV6_FL_F_REFLECT is set on a listener, or the net.ipv6.flowlabel_reflect sysctl has FLOWLABEL_REFLECT_ESTABLISHED, tcp_v6_send_synack() reflects the flowlabel of the SYN packet, reading it from the skb stored in ireq->pktopts. Since commit 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table"), request sockets are processed without holding the listener lock. A cpu can then process a retransmitted SYN for a request socket, and send a SYNACK from tcp_check_req(), while another cpu receives the ACK completing the 3WHS. tcp_v6_syn_recv_sock() consumes ireq->pktopts when it wins the hashdance, and the first cpu reads a freed skb: BUG: KASAN: slab-use-after-free in tcp_v6_send_synack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcp_ipv6.c:582) Read of size 8 at addr ffff88802b08b608 by task poc-ipv6-pktopt/5076 Call Trace: tcp_v6_send_synack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcp_ipv6.c:582) tcp_rtx_synack (net/ipv4/tcp_output.c:4719) tcp_check_req (net/ipv4/tcp_minisocks.c:762) tcp_v6_rcv (net/ipv6/tcp_ipv6.c:1826) ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479) ip6_input_finish (net/ipv6/ip6_input.c:534) ip6_input (include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6_input.c:545) ipv6_rcv (include/net/dst.h:481 net/ipv6/ip6_input.c:119 include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6_input.c:351) Freed by task 5074 on cpu 0 at 15.412249s: kmem_cache_free (include/linux/kasan.h:235 mm/slub.c:2780 mm/slub.c:6630 mm/slub.c:6757) tcp_v6_syn_recv_sock (net/ipv6/tcp_ipv6.c:1528) tcp_check_req (net/ipv4/tcp_minisocks.c:934) tcp_v6_rcv (net/ipv6/tcp_ipv6.c:1826) ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479) ip6_input_finish (net/ipv6/ip6_input.c:534) Request socket migration has the same issue: reqsk_migrate_reset() transfers ireq->pktopts to the clone, which can be freed while another cpu holding a reference on the old request socket is still sending a SYNACK. The SYNACK timer itself is not an issue, because inet_csk_reqsk_queue_drop() calls timer_delete_sync(). Save the flowlabel of the SYN in the request socket instead, so that tcp_v6_send_synack() no longer needs ireq->pktopts. As a side effect, the flowlabel is also reflected for SYN packets reusing a TIME_WAIT socket, as ireq->pktopts is not set in this case. Fixes: e994b2f0fb92 ("tcp: do not lock listener to process SYN packets") Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table") Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.") Reported-by: Anvik Loitongbam Reported-by: Yingjie Wang Closes: https://lore.kernel.org/netdev/82c31e4d5043f3dbd11b44177cfba779d335aae3.1793599929.git.x-professor@outlook.com/ Signed-off-by: Eric Dumazet Reviewed-by: Jiayuan Chen Reviewed-by: Neal Cardwell Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261102075441.3771550-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 5103f07ded158f10f85b61f144a78314a7a51994 Author: Kuniyuki Iwashima Date: Sun Nov 1 06:35:24 2026 +0000 ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow(). [ Upstream commit 4019af3afd72864ec6abbfde2d76e416a64456c2 ] Since the cited commit, ip_route_input_slow() could call rt_dst_alloc() with vrf in the local_input: path. If res->fi != NULL and one of the following is true, - a non-zero itag from fib_validate_source_reason() (realms/classid) - RTN_BROADCAST with BC_FORWARDING enabled do_cache is set to false. Then, the route is not added to rt_uncached_list, so the route cannot be removed from rt_flush_dev(). If the route is cached in sk->sk_rx_dst, removing the vrf device gets stuck. [0] Let's call rt_add_uncached_list() if !do_cache in ip_route_input_slow(). [0]: unregister_netdevice: waiting for vrf0 to become free. Usage count = 2 ref_tracker: netdev@000000008b304ac4 has 1/1 users at dst_alloc+0x14b/0x490 ip_route_input_rcu+0x1540/0x2530 ip_route_input_noref+0x5a/0x90 ip_rcv_finish_core+0x4b0/0x1140 ip_rcv_finish+0xe6/0x190 ip_rcv+0x6c/0x130 __netif_receive_skb+0x121/0x300 process_backlog+0x2df/0x5e0 __napi_poll+0x8c/0x380 net_rx_action+0x43c/0xab0 handle_softirqs+0x19f/0x520 do_softirq+0x46/0x60 __local_bh_enable_ip+0x79/0x80 __dev_queue_xmit+0x1b0e/0x24c0 ip_finish_output2+0x8b2/0xcd0 ip_output+0xf2/0x1e0 Fixes: f5a0aab84b74 ("net: ipv4: dst for local input routes should use l3mdev if relevant") Reported-by: Jason Zhang Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261101064418.2055158-4-kuniyu@google.com Reviewed-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 20c6a7d4a4c9fe019f065d546d01b8d6c72df000 Author: Kuniyuki Iwashima Date: Sun Nov 1 06:35:23 2026 +0000 ipv6: Flush rt->from in rt6_uncached_list_flush_dev(). [ Upstream commit a0fe1a3f390a75152c7395fdf63fc39da77d7838 ] When a device is unregistered, rt6_uncached_list_flush_dev() iterates over uncached routes and switches the dying dev with blackhole_netdev. However, rt->from could be cached via sk->sk_rx_dst and hold the device reference. Then, unregister_netdevice() gets stuck with the splat below. [0] Let's release rt->from in rt6_uncached_list_flush_dev(). Note that ip6_rt_copy_init() could set rt->from even if in6_dev_get() returns NULL (e.g. mtu < IPV6_MIN_MTU is set concurrently). Also, rt->from->nh could be replaced with another device than rt_dev and rt_idev->dev, and in such a case, nexthop_flush_dev() sets fib6_destroying before rt6_uncached_list_flush_dev(). [0]: unregister_netdevice: waiting for dummy2 to become free. Usage count = 2 ref_tracker: netdev@000000006fb9da8c has 1/1 users at netdev_get_by_index+0x14c/0x170 fib6_nh_init+0x1ae/0x1950 ip6_route_info_create_nh+0x15d/0x780 ip6_route_add+0x55/0x150 inet6_rtm_newroute+0x15d/0x1360 rtnetlink_rcv_msg+0x606/0x710 netlink_rcv_skb+0x14f/0x2f0 netlink_unicast+0x71b/0x940 netlink_sendmsg+0x595/0x840 __sock_sendmsg+0x119/0x150 ____sys_sendmsg+0x3e9/0x5c0 ___sys_sendmsg+0x157/0x1a0 __x64_sys_sendmsg+0x119/0x170 do_syscall_64+0x109/0x330 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") Reported-by: Jason Zhang Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261101064418.2055158-3-kuniyu@google.com Reviewed-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 483f40f8da5c341fae4f191429c27372dcb92889 Author: Kuniyuki Iwashima Date: Thu Oct 1 20:47:18 2026 +0000 ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo(). [ Upstream commit f12d2907992db7ba91cc4a1796dce3cffb01318c ] IPv6 uncached routes are linked to the global per-cpu lists, rt6_uncached_list. When unregistering a netdev, rt6_uncached_list_flush_dev() iterates over the potentially long lists to find uncached routes tied to the device and swap it with blackhole_netdev. Since it is called for every device in dying netns under RTNL, it adds O(N_dev x (N_cpu + N_route)) costs to any batched device unregistration. Let's call it once per batched device unregistration without RTNL. Because it now runs without RTNL, rt->dst.dev and rt->rt6i_idev->dev may transition to NETREG_UNREGISTERED at different times. Thus, we must check that both devices are blackhole_netdev before unlinking the route; otherwise, the remaining device reference would not be flushed when the other device is unregistered. In addition, since netdev_run_todo() runs even when IPv6 is disabled, rt6_uncached_list_flush_dev() must check ipv6_mod_enabled() before touching rt6_uncached_list. Note also that netdev_run_todo() cannot be called before rt6_uncached_list is initialised because: 1. unregister_netdevice_many_notify() panics when dev_boot_phase == 1 (net_dev_init() is subsys_initcall()). 2. the only device registered before fs_initcall_sync() is loopback and loopback_net_init() panics in case of failure. Reported-by: Chris J Arges Closes: https://lore.kernel.org/netdev/20260917-hash-bucket-route-lists-v3-0-30493a37b6eb@cloudflare.com/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel Tested-by: Chris J Arges Link: https://patch.msgid.link/20261001204752.2572265-7-kuniyu@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: a0fe1a3f390a ("ipv6: Flush rt->from in rt6_uncached_list_flush_dev().") Signed-off-by: Sasha Levin commit 580ada1992c6b64a4e92f58137fd069520adfdaa Author: Kuniyuki Iwashima Date: Thu Oct 1 20:47:17 2026 +0000 ipv4: Batch rt_flush_dev() in netdev_run_todo(). [ Upstream commit ca6854799069778fef446d307935f764cc3d3afb ] IPv4 uncached routes are linked to the global per-cpu lists, rt_uncached_list. When unregistering a netdev, rt_flush_dev() iterates over the potentially long lists to find uncached routes tied to the device and swap it with blackhole_netdev. Since it is called for every device in dying netns under RTNL, it adds O(N_dev x (N_cpu + N_route)) costs to any batched device unregistration. Let's call it once per batched device unregistration without RTNL. Note that rt_flush_dev() must be called after setting dev->reg_state to NETREG_UNREGISTERED. Otherwise, because rt_flush_dev(NULL) runs without RTNL, it could race with unregister_netdevice_many_notify() and prematurely purge routes for NETREG_UNREGISTERING dev, for which flush_all_backlogs() has not been called yet. Reported-by: Chris J Arges Closes: https://lore.kernel.org/netdev/20260917-hash-bucket-route-lists-v3-0-30493a37b6eb@cloudflare.com/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel Tested-by: Chris J Arges Link: https://patch.msgid.link/20261001204752.2572265-6-kuniyu@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: a0fe1a3f390a ("ipv6: Flush rt->from in rt6_uncached_list_flush_dev().") Signed-off-by: Sasha Levin commit e6afcaed408602ef6b3b37fbadebaab5533a5654 Author: Zhou Minqiang Date: Wed Nov 4 19:56:41 2026 +0800 PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove [ Upstream commit 1f65b45f0f16e1c80a68a5757c9556f78bb39f19 ] When a WQ_MEM_RECLAIM workqueue (e.g. iscsi_ctrl) triggers device removal via device_del -> pm_runtime_remove, the unconditional flush_work inside pm_runtime_remove can trigger a check_flush_dependency warning: CPU1: pm_wq worker CPU2: iscsi_ctrl wq -------- -------- pm_runtime_work(starget) pm_runtime_remove(starget) spin_lock_irq(&starget->lock) __pm_runtime_disable(starget, false) request_pending = false spin_lock_irq(&starget->lock) (blocked, CPU1 holds the lock) rpm_suspend(starget, RPM_NOWAIT) status = RPM_SUSPENDING rpm_callback(cb, starget) spin_unlock_irq(&starget->lock) (acquires lock) disable_depth 0→1 __pm_runtime_barrier(): request_pending == false → skip cancel_work_sync status == RPM_SUSPENDING → enter wait_queue, sleep spin_unlock_irq(&starget->lock) cb(starget) → 0 spin_lock_irq(&starget->lock) status = RPM_SUSPENDED wake_up_all(&wait_queue) (woken up, waiting for lock) spin_unlock(&starget->lock) spin_lock_irq(&starget->lock) status == RPM_SUSPENDED spin_lock(&parent->lock) → exit wait_queue rpm_idle(parent, RPM_ASYNC) barrier returns spin_unlock(&parent->lock) flush_work(&starget->work) spin_lock(&starget->lock) __flush_work(from_cancel=false) spin_unlock_irq(&starget->lock) check_flush_dependency() ← WARNING! Replace flush_work with cancel_work_sync in pm_runtime_remove. cancel_work_sync internally calls __flush_work with from_cancel=true, which causes check_flush_dependency to return early before the warning. This preserves the use-after-free fix from commit 29ab76827761 ("PM: runtime: Fix a race condition related to device removal") without the warning. Fixes: 29ab76827761 ("PM: runtime: Fix a race condition related to device removal") Signed-off-by: Zhou Minqiang Link: https://patch.msgid.link/20261104115641.2682786-1-zhouminqiang2@huawei.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 9bc45578d5f0478fa7434eb7d2e2e4b008998c3b Author: Avi Weiss Date: Sat Oct 31 13:41:35 2026 +0200 net: skbuff: reject zero MPLS TTL before decrementing [ Upstream commit 24614e72df484ad50ecba98aaa88c7df2448c122 ] skb_mpls_dec_ttl() decrements the u8 TTL before checking whether it expired. An incoming TTL of zero wraps to 255, causing the TC MPLS dec_ttl action to pass an expired packet instead of dropping it. Reject a zero TTL before the decrement while preserving the existing behavior for TTL one and valid TTL values. Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Signed-off-by: Avi Weiss Reviewed-by: Xia Yan Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261031114135.3784868-2-thnkslprpt@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 5a4d0d190f210073e3fed6e876ffcb7cbd677b72 Author: Christian Loehle Date: Tue Nov 3 18:19:03 2026 +0000 cpufreq: Hold the policy write lock when changing boost state [ Upstream commit e6f50e602e373583423654ec000cad8b8d08f7bc ] The per-policy boost sysfs handler calls policy_set_boost() under policy->rwsem, but the global boost handler and cpufreq_online() do not. Consequently, global and per-policy boost changes can concurrently update policy->boost_enabled, invoke the driver callback and update the boost frequency QoS request. The driver callbacks also access policy state, e.g. CPPC updates cpuinfo.max_freq that assumes policy->rw_sem held. Take policy->rwsem around policy_set_boost() in both unlocked callers. Keep locking at the call sites because the per-policy sysfs handler already holds the lock. Fixes: 218a06a79d9a ("cpufreq: Support per-policy performance boost") Signed-off-by: Christian Loehle Link: https://patch.msgid.link/be3739f8-e668-4711-912c-91459d77ed35@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 34b1a3996f2f53387e0315f4846ab3cc907bac11 Author: Guillaume Nault Date: Wed Oct 28 21:32:35 2026 +0100 tcp: Fix dup-ack detection on non-SACK bidirectional data transfer. [ Upstream commit 11140c51df12e594d6bf2c8d2af5dec63b0219ac ] When receiving a pure ack from a peer that also sends data, we can have SEG.SEQ > SND.WL1, even though the segment contains no data. This makes tcp_may_update_window() return true (because of the "after(ack_seq, tp->snd_wl1)" condition), and tcp_ack_update_window() then adds FLAG_WIN_UPDATE to the segment set of flags, even when there's no window update. Since FLAG_WIN_UPDATE prevents the segment from being considered as dup-ack (as it's part of FLAG_NOT_DUP), this can inhibit fast retransmit on non-SACK connections, making recovery very slow as it now entirely relies on RTO. The "DUPLICATE ACKNOWLEDGMENT" definition of RFC 5681, section 2, says that lack of window update is a necessary condition for a dup ack: "(e) the advertised window in the incoming acknowledgment equals the advertised window in the last incoming acknowledgment.". Spurious window updates can thus prevent dup ack detection and, in the end, fast retransmit. Avoid this scenario by setting FLAG_WIN_UPDATE only when a window update actually occurs. Pure acks with SEG.SEQ > SND.WL1 can now be detected as dup-ack and trigger fast retransmission. Also, stop setting FLAG_WIN_UPDATE in tcp_ack()'s header prediction path. One of the conditions for header prediction to happen is that received segments don't trigger a window update. This flag update was thus wrong to begin with. Now that tcp_ack_update_window() sets FLAG_WIN_UPDATE only if a window update actually occurred, we need the header prediction path to stop reporting spurious window updates too. Otherwise BPF programs would get inconsistent window update information (CA_ACK_WIN_UPDATE) between fast an slow paths. Finally, add FLAG_SND_UNA_ADVANCED to the definition of FLAG_NOT_DUP. This is necessary for the case where an incoming segment acknowledges less than a full segment of the retransmit queue. Such segments were not considered dubious by tcp_ack_is_dubious() because of the spurious FLAG_WIN_UPDATE flag, which prevented the segment from being seen as a duplicate ack. Now that FLAG_WIN_UPDATE doesn't cover this scenario anymore, we need another way to mark these acks as non-duplicate. Adding FLAG_SND_UNA_ADVANCED to FLAG_NOT_DUP is the natural way of doing this, since, by definition, a segment advancing SND.UNA, even by a small amount, cannot be a duplicate ack. A side effect of this patch is that repeated zero window acks received from peer can now be considered duplicate acks (because of the the "|| !win" condition in tcp_may_update_window()). Therefore, they can now trigger fast retransmission and fast recovery, including congestion window reduction, when the peer is stalled. This is RFC compliant and shouldn't have any negative effect. Add packetdrill selftest. Before this patch, the 1001:2001 segment was retransmitted upon RTO, now it's sent right after reception of the third duplicate ack. Thanks to Tom Williams for the investigation help and initial reproducer. Reported-by: Tom Williams Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Guillaume Nault Reviewed-by: Kuniyuki Iwashima Reviewed-by: Neal Cardwell Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/6426d558e45fc6ab724c40af62e4a8793215dd8a.1793219189.git.gnault@redhat.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 68c761c16dfb275f86edc1a163171b4edd546b64 Author: Hungyu Lin Date: Thu Oct 29 00:49:02 2026 +0000 isofs: handle Rock Ridge long-form dates before 1900 [ Upstream commit 0cbfc16fe49629f5c1fc3628405661c2b938ec61 ] iso_date() stores the year relative to 1900 and rejects negative values. Rock Ridge LONG_FORM timestamps encode calendar years from 1 to 9999, so valid years before 1900 are returned as seconds since the Unix epoch equal to zero instead of their recorded dates. For example, an 1899 timestamp on an image produced by xorriso is reported as 1970 by stat, and cp -p preserves that incorrect time. Use the calendar year for both timestamp formats and pass it directly to mktime64(). Keep the epoch fallback for year zero, while allowing valid long-form years before 1900. Short-form dates are unchanged. Fixes: 5ea45f54c8d6 ("isofs: fix Y2038 and Y2156 issues in Rock Ridge TF entry") Signed-off-by: Hungyu Lin Link: https://patch.msgid.link/20261029004902.76944-1-dennylin0707@gmail.com Signed-off-by: Jan Kara Signed-off-by: Sasha Levin commit 601a36d10b39329b7dedf4f9d362db2d9584cc65 Author: Daejun Park Date: Tue Nov 3 15:29:32 2026 +0900 erofs: treat files shared by inode_share as stacked [ Upstream commit 7c26dc33ea7bb677db294bfb4e58d4207477c9e3 ] A file-backed mount whose image or extra device is on a block-backed EROFS passes erofs_is_stacked_file(). If inode_share shares that file, erofs_real_inode() may pick an inode of a file-backed EROFS in the same domain to read it. File-backed reads then nest in the same task. Treat files that use erofs_ishare_fops as stacked. Fixes: 34096ba919fd ("erofs: support unencoded inodes for page cache share") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261030-erofs-fileio-bioset-v1-1-caf47adbb3a3@samsung.com Signed-off-by: Daejun Park Reviewed-by: Gao Xiang Signed-off-by: Gao Xiang (Docker) Signed-off-by: Sasha Levin commit 2a233314fbd6adb8e7678e0ba9e174e1e65f995a Author: Joseph Kain Date: Thu Oct 29 14:11:01 2026 -0700 net: stop defer_count outliving the deferred-free list [ Upstream commit 241dec6f9ab74d8c3ef246764f3611666b96b9e1 ] After the llist conversion, rejected frees retain their counter increments. A producer racing the counter reset and list detach can also leave a count for an skb already drained. Deferred freeing can then remain disabled while the list is empty. Undo rejected reservations and subtract only the number of skbs drained. Allow admission up to the configured limit. Retain the halfway notification and also notify when the reserved count reaches the limit, covering reservations published after an earlier purge. Fixes: 844c9db7f7f5 ("net: use llist for sd->defer_list") Signed-off-by: Joseph Kain Assisted-by: LLM Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit 4995894979b5e425e6c8a871fb922c7802d2e3e2 Author: James Clark Date: Thu Oct 29 20:55:56 2026 +0700 net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes [ Upstream commit 3f1054a0cb09552dd54db024694f74747f9f1d49 ] A periodic output requested by PTP_PEROUT_REQUEST2 drifts away from the PHC as soon as the PHC frequency is adjusted, for example by ptp4l or ts2phc: at +10 ppm each edge is 10 us later than the one before. The GenF that generates the output counts its period in ref_clk cycles, which the PPM correction of the CPTS clock does not reach; each GenF has its own PPM registers. am65_cpts_ptp_adjfine() programs them only for the GenF used for PPS, and am65_cpts_perout_enable_hw() starts every GenF with them cleared, so a GenF used for a periodic output is never corrected. Commit eb9233ce6751 ("net: ethernet: ti: am65-cpts: adjust pps following ptp changes") added the correction for the PPS GenF, and commit 7849c42da2ca ("net: ethernet: ti: am65-cpts: adjust estf following ptp changes") passed the same values to the ESTFs. In am65_cpts_ptp_adjfine(), update every enabled GenF the way the PPS GenF was updated: read its control register, set or clear the PPM direction bit and write it back with the PPM value. The PPS GenF and the ESTFs get exactly the values they got before. In am65_cpts_perout_enable_hw(), start a GenF with the current correction instead of none; this applies to the PPS GenF too. Tested on a BeagleY-AI (J722S) with the GENF0 output looped back to the HW1_TS_PUSH input (EXTTS 0). With the PHC frequency adjusted by +10 ppm before the periodic output is started, the edges drift 10 us per second against the PHC without this patch (290 us after 29 s); with it, they stay 20 to 23 ns after the PHC second. This also works if the frequency is adjusted after the periodic output has started. Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver") Signed-off-by: James Clark Reviewed-by: Jacob Keller Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit 100ade4d4b9ff53137f43341c92d6f25a9f3e46d Author: Jude Gyimah Date: Tue Nov 3 14:25:37 2026 +0100 ASoC: rockchip_spdif: select REGMAP_MMIO [ Upstream commit 67a7e2073909e948c3cbd86c28d17e86c2958dd6 ] rockchip_spdif calls __devm_regmap_init_mmio_clk, which drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO. rockchip_spdif.c:(.text+0xf67): undefined reference to `__devm_regmap_init_mmio_clk' The driver can be built into vmlinux while REGMAP_MMIO is a module, in which case the symbol is not there at link time. Select rather than depend on: REGMAP_MMIO has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_SOC_ROCKCHIP_SPDIF unselectable. Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_SPDIF=y and CONFIG_REGMAP_MMIO=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: f874b80e1571 ("ASoC: rockchip: Add rockchip SPDIF transceiver driver") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261103132537.3717496-6-jude.gyimah87@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit f1735cb0d46af3693779a1d71d127347ba892f38 Author: Jude Gyimah Date: Tue Nov 3 14:25:36 2026 +0100 ASoC: rockchip_sai: select REGMAP_MMIO [ Upstream commit 829904994e7a54fa89cf550e50dbcd58a09602eb ] rockchip_sai calls __devm_regmap_init_mmio_clk, which drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO. rockchip_sai.c:1424:(.text+0x153060): undefined reference to `__devm_regmap_init_mmio_clk' The driver can be built into vmlinux while REGMAP_MMIO is a module, in which case the symbol is not there at link time. Select rather than depend on: REGMAP_MMIO has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_SOC_ROCKCHIP_SAI unselectable. Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_SAI=y and CONFIG_REGMAP_MMIO=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: cc78d1eaabad ("ASoC: rockchip: add Serial Audio Interface (SAI) driver") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261103132537.3717496-5-jude.gyimah87@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 8b2fd3ff530806d37a65f04a694c1e5545cbfd3f Author: Jude Gyimah Date: Tue Nov 3 14:25:35 2026 +0100 ASoC: rockchip_pdm: select REGMAP_MMIO [ Upstream commit 420c7918a61b97b8cd99e402e7e5a857edb097ee ] rockchip_pdm calls __devm_regmap_init_mmio_clk, which drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO. rockchip_pdm.c:(.text+0xef4): undefined reference to `__devm_regmap_init_mmio_clk' The driver can be built into vmlinux while REGMAP_MMIO is a module, in which case the symbol is not there at link time. Select rather than depend on: REGMAP_MMIO has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_SOC_ROCKCHIP_PDM unselectable. Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_PDM=y and CONFIG_REGMAP_MMIO=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261103132537.3717496-4-jude.gyimah87@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 1abf25d5af273f2e9789f28a4f7534063b53123c Author: Jude Gyimah Date: Tue Nov 3 14:25:34 2026 +0100 ASoC: rockchip_i2s_tdm: select REGMAP_MMIO [ Upstream commit b8284f2b73f8de157be52b48d9968645f4ad6f7c ] rockchip_i2s_tdm calls __devm_regmap_init_mmio_clk, which drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO. rockchip_i2s_tdm.c:1304:(.text+0x14b1b6): undefined reference to `__devm_regmap_init_mmio_clk' The driver can be built into vmlinux while REGMAP_MMIO is a module, in which case the symbol is not there at link time. Select rather than depend on: REGMAP_MMIO has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_SOC_ROCKCHIP_I2S_TDM unselectable. Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=y and CONFIG_REGMAP_MMIO=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: 081068fd6414 ("ASoC: rockchip: add support for i2s-tdm controller") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261103132537.3717496-3-jude.gyimah87@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit f2baab15b5797edfa5715619daa0d9f57f8f39d9 Author: Jude Gyimah Date: Tue Nov 3 14:25:33 2026 +0100 ASoC: rockchip_i2s: select REGMAP_MMIO [ Upstream commit 1c57404bf9bad3e05d5686d91c208bf4e2b733d8 ] rockchip_i2s calls __devm_regmap_init_mmio_clk, which drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO. rockchip_i2s.c:(.text+0x418): undefined reference to `__devm_regmap_init_mmio_clk' The driver can be built into vmlinux while REGMAP_MMIO is a module, in which case the symbol is not there at link time. Select rather than depend on: REGMAP_MMIO has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_SOC_ROCKCHIP_I2S unselectable. Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_I2S=y and CONFIG_REGMAP_MMIO=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: 4495c89fcf26 ("ASoC: add driver for Rockchip RK3xxx I2S controller") Signed-off-by: Jude Gyimah Link: https://patch.msgid.link/20261103132537.3717496-2-jude.gyimah87@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 157964fe20203b4f0b88afdd3a83c278143728f5 Author: Chris Mason Date: Wed Oct 28 10:42:30 2026 -0600 nvmet-rdma: disconnect a queue on device removal [ Upstream commit a4387799d4228866dc1746b466cd17e1c638d050 ] cma_remove_one() sends DEVICE_REMOVAL to the owner of every cm_id on the device and then waits, without timeout, until they're all destroyed. nvmet_rdma_device_removal() does nothing for a queue cm_id and leaves the queues to nvmet_rdma_remove_one(), which only works if that runs first. As a module it does, nvmet-rdma registers after rdma_cm. Built in, both register at the same initcall level and drivers/Makefile lists nvme/ ahead of infiniband/, so cma_remove_one() runs first and waits for cm_ids that only the later callback would destroy. Since the RDMA CM drops all later events for a cm_id once it has sent DEVICE_REMOVAL, a peer closing its connection doesn't help either. One connection from anyone who can reach the port hangs "rdma link delete" until something else ends the queue. Call nvmet_rdma_queue_disconnect() for the queue. It unlists the queue and queues the release work, which destroys the cm_id. Don't wait for it, rdma_destroy_id() waits for the handler to return, which was the deadlock before commit f1d4ef7d8883. Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Chris Mason Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 2b8b2393dc2cb5288a73151554482af824b9c6e7 Author: Chris Mason Date: Wed Oct 28 10:42:29 2026 -0600 nvmet-rdma: queue the release work under the mutex [ Upstream commit 80095787f776967361cca76357f19e5445e0cd75 ] nvmet_rdma_remove_one() takes the queue mutex, unlists each queue of the device and queues its release work, then flushes nvmet-wq. So a queue that still holds objects on the device must either be on the list or have its release work queued. nvmet_rdma_queue_disconnect() breaks that: it unlists the queue under the mutex, drops it, and only then calls __nvmet_rdma_queue_disconnect() to queue the work. A device removal in that window finds nothing to wait for, and the release work then destroys the QP and CQ share on a freed device. Queue the work before dropping the mutex, as nvmet_rdma_remove_one() itself does. That's safe now that rdma_disconnect() no longer sleeps on an iWARP event that needs the same mutex. Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Chris Mason Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 4260713a910c2a1b6b048ed22571fcf3b9cbe410 Author: Chris Mason Date: Wed Oct 28 10:42:28 2026 -0600 nvmet-rdma: take a device off the list last [ Upstream commit 86ae3841aea4e29d7ac08d5614ca3823dc8dfbc9 ] nvmet_rdma_remove_one() disconnects the queues of a device and flushes nvmet-wq, but since commit a3dd7d0022c3 it returns right away if the device isn't on device_list. nvmet_rdma_free_dev(), run by the release work of the last queue, takes the device off that list first and frees the SRQs and the PD afterwards. A device removal in between finds nothing on the list, returns, and the RDMA core frees the device under ib_dealloc_pd(). Free the SRQs and the PD first and unlist the device last, so the remove callback finds it and its flush waits for the release work. Fixes: a3dd7d0022c3 ("nvmet-rdma: Don't flush system_wq by default during remove_one") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Chris Mason Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 1f9b5f3a4c149a0075e7aa047ffbdbf1a14ba91f Author: Josef Bacik Date: Wed Oct 28 10:42:20 2026 -0600 nvmet-tcp: limit the connections accepted per work run [ Upstream commit a029f1b2fb13e6ac6e1c2f27fba1d80b6e7cac51 ] nvmet_tcp_accept_work() loops until there's nothing left to accept, and anyone opening and closing connections fast enough keeps it running indefinitely, since tearing down a dead connection takes long enough for more to arrive. Whoever flushes nvmet_wq waits for it: removing any other port of the target does in nvmet_port_release(), and so does unloading the rdma and fc modules. Accept a bounded number of connections per run and requeue the work. A flush doesn't wait for work queued behind it. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 5742b12229f3a1e7a48e8028a54c339cc5b8b638 Author: Chris Mason Date: Wed Oct 28 10:42:27 2026 -0600 nvmet-rdma: disconnect only established queues [ Upstream commit 000a9f4492abad6008682b55571ddc31941963e3 ] Over iWARP, rdma_disconnect() sleeps in iw_cm_disconnect() until the ESTABLISHED event of the connection has been handled, and iw_cm handles all events of all connections one at a time on iw_cm_wq. nvmet_rdma_destroy_port_queues(), nvmet_rdma_remove_one() and nvmet_rdma_delete_ctrl() walk the queue list with nvmet_rdma_queue_mutex held and call rdma_disconnect() for each, while nvmet_rdma_cm_handler() takes the same mutex. If the walk sleeps on a queue whose ESTABLISHED is queued behind another queue's event, both are stuck and iWARP connection handling is dead until reboot. A peer sets that up by connecting in a loop, or over siw by asking for MPA peer-to-peer mode and then staying silent, which delays ESTABLISHED indefinitely. Only call rdma_disconnect() for a queue in NVMET_RDMA_Q_LIVE, which the handler sets when it gets ESTABLISHED. A queue that never got there is left to the release work: ib_drain_qp() moves the QP to the error state, which ends the connection, and rdma_destroy_id() tells the peer. Over IB and RoCE the skipped call did nothing more than that. Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal") Fixes: fcf73a804c7d ("nvmet-rdma: fix use-after-free when a port is removed") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Chris Mason Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 2c418b63b23b8c3c9fa55591814a31673556d0da Author: Josef Bacik Date: Wed Oct 28 10:42:07 2026 -0600 nvmet-auth: keep the old keys if the new ones fail [ Upstream commit 41ad4af45ac90259c652135b24539a08a92a7491 ] AUTH_Negotiate on the admin queue has nvmet_setup_auth() reload the host's keys, and it frees the old host key first. If decoding the new secret fails, or an allocation does, the controller is left without a host key, which means no authentication at all: nvmet_check_auth_status() passes everything and I/O queue Connects no longer ask for it. configfs accepts any string starting with "DHHC-1:" and a digit, so one typo while changing a secret opens the namespaces to any connected admin queue. Decode the new keys first and only then replace the old ones. Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 31bc1461961ceb4a3df33a7560cf4a2c77e9d1ff Author: Josef Bacik Date: Wed Oct 28 10:41:52 2026 -0600 nvmet-tcp: ask for the TLS record type on every receive [ Upstream commit 77f72de389e3774dc95d7cd03a98a73e47013abd ] nvmet_tcp_alloc_cmd() points recv_msg.msg_control at recv_cbuf once. The first receive that stores a record type there advances msg_control and leaves msg_controllen at 0 for the lifetime of the command. From then on nvmet_tcp_try_recv_data() sees the record type of that first receive: if it was an alert, all later data is dropped as alerts and the queue stalls, if it was data, a later alert can't be reported and tls_sw_recvmsg() fails with -EIO. Set up the control buffer before each receive, like the other receive paths do. Fixes: a1c5dd8355b1 ("nvmet-tcp: control messages for recvmsg()") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 5a58596dddf0872e66646c0f8be95f0e6ea283a9 Author: Josef Bacik Date: Wed Oct 28 10:41:49 2026 -0600 nvme-loop: delete the controller if a reset fails [ Upstream commit bc2170d365861d29dce20f982093873baad09804 ] If the reconnect of a reset fails, nvme_loop_reset_ctrl_work() tears the controller down by hand with nvme_uninit_ctrl(). Since that was split from nvme_stop_ctrl() it no longer removes the namespaces, which hold references to the controller. A reset while the target no longer accepts the host (allow_any_host 0) is enough to get there: a sysfs reset hangs in kernfs_drain(), an ioctl reset leaves a controller stuck in CONNECTING with its block devices, the cntlid can't be reused, and module unload deletes the controller a second time and hits a use-after-free. Do what the other fabrics drivers do and call nvme_delete_ctrl(). The delete path quiesces the admin queue and only unquiesces it if the queue is live, which it isn't after a failed reset, so unquiesce it unconditionally before destroying it so a stuck request can't block the freeze. Fixes: d09f2b45f346 ("nvme: split nvme_uninit_ctrl into stop and uninit") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit ea7c82feb7a5365c35e2b0ac1bcb78e312410426 Author: Eric Dumazet Date: Fri Oct 30 10:23:03 2026 +0100 ipmr, ip6mr: queue netlink route queries out of band [ Upstream commit 787268686c64be60023743b527645a907e38ccca ] ipmr_get_route() and ip6mr_get_route() queue synthetic skbs on the unresolved MFC entry to answer RTM_GETROUTE requests once the route is resolved. These skbs carry a fake IP header with version 0, and ipmr_cache_resolve(), ipmr_destroy_unres(), ip6mr_cache_resolve() and ip6mr_destroy_unres() rely on this in-band tag to tell them apart from regular packets queued by the input and output paths. The IP version is only validated once, in ip_rcv_core() and ip6_rcv_core(). A netfilter hook running later, for instance an nftables payload statement in a PREROUTING chain owned by an unprivileged user namespace, can rewrite the first header byte to zero. The SRv6 End.DX6 action also passes the decapsulated packet to ip6_mr_input() without checking that the inner header version is 6. If no MFC entry exists, the packet is queued and later handled as a netlink request: its payload is treated as an nlmsghdr and written to, mr_fill_mroute() may call skb_put() on a nonlinear skb (hitting SKB_LINEAR_ASSERT()), and the skb is unicast to a netlink portid taken from stale IPCB/IP6CB bytes in skb->cb[]. ipmr_cache_report() also relies on the same tag since commit 94a6736bb5ab ("ipmr: only copy pktinfo to cache reports"). Stop trusting packet contents: queue route queries on a dedicated nl_queries list in the unresolved MFC entry, and pass an explicit nl_query flag from the callers. The per-entry limit of four queued skbs now applies to both lists combined, as before. The synthetic header keeps version 0, since it is copied into the NOCACHE report delivered to the mroute socket. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Fixes: 7bc570c8b4f7 ("[IPV6] MROUTE: Support multicast forwarding.") Reported-by: Katherine Leaver Signed-off-by: Eric Dumazet Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261030092303.2749386-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 5e6438c362d527bfe10b4a472f0ca0bd6435857e Author: Alexander Goodkind Date: Thu Oct 29 18:05:17 2026 -0700 net: ethernet: mediatek: preserve sibling PPE bindings [ Upstream commit 34cc22a9ce6ae0228dcd09a57df23aea62e22b04 ] __mtk_ppe_check_skb() clears entry->hash for flows bound to other hardware slots in the same software hash bucket. mtk_flow_offload_stats() then skips their hardware counter updates. L2 cleanup also frees sibling subflows without invalidating their hardware rules. Restrict both cleanup paths to entries assigned to the inspected slot. Two UDP trials reproduced the counter failure on a GL-MT3000/MT7981 running unmodified OpenWrt 25.12.5 with Linux 6.12.94: 1. Start a UDP connection. 2. Add a control connection in a different hash bucket. 3. Add a connection in the first connection's hash bucket. AI code review of the original patch identified the cleanup problem in L2 subflows. Full ARM64 builds with allmodconfig and allyesconfig passed before and after the patch using GCC 14.2.0 and W=1, without new warnings. The builds used CONFIG_WERROR=n because the unmodified ARM64 kernel already emits warnings. Hardware testing has not run for this revision. Fixes: c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management") Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Link: https://github.com/openwrt/openwrt/pull/26107 Signed-off-by: Alexander Goodkind Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261030010517.45639-1-alex@goodkind.io Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 9d3738f43d7f7f820a12da2a2366f6cd20808a78 Author: Florian Fainelli Date: Wed Oct 28 16:50:59 2026 -0700 net: dsa: b53: Enable IGMP and MLD control packet CPU copies [ Upstream commit 3362cb822ea750399a15b741713181fd8560bd17 ] IGMPv2 reports and MLDv1 reports are addressed to the multicast group itself. Once the first listener is installed in the ARL table, subsequent reports can follow that entry without reaching the CPU. The bridge then fails to learn additional listeners, although static MDB forwarding works. Enable the high-level protocol classifiers so that IGMP and MLD control packets are copied to the CPU independently of the multicast ARL lookup. Retain normal L2 forwarding by clearing the CPU-only forwarding modes, and preserve unrelated protocol-control fields. Handle the BCM5395's 16-bit register and different classifier fields separately from the 32-bit layout on the BCM531xx, BCM5301x and newer integrated RoboSwitch families, including BCM7445, BCM7278 and BCM4908. Export the helper and call it from bcm_sf2_sw_setup() as well, since SF2 uses its own setup operation instead of b53_setup(). This also restores the classifiers after the switch reset on resume. Leave older devices with different IGMP controls untouched, and propagate register access failures during setup. The SF2 setup integration and BCM4908 chip gate were updated with assistance from OpenAI Codex in response to review feedback. Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB") Signed-off-by: Florian Fainelli Link: https://patch.msgid.link/20261028235100.3892374-2-florian.fainelli@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 6a64bb3dc5284db14a5603156a919a48c732c3f9 Author: ChunYuZhiQiang Date: Tue Oct 27 14:50:12 2026 +0800 can: dev: can_tdc_fill_info(): don't read automatic TDCV if interface is down [ Upstream commit f5128a76726105f398d7ee70ee523dd4f68d62f4 ] The automatic TDCV readback calls into the driver via do_get_auto_tdcv(). Some drivers, such as xcan_get_auto_tdcv(), read controller registers without taking a runtime PM reference, so calling this while the interface is down can touch registers whose clocks are gated. Gate do_get_auto_tdcv() on netif_running() in can_tdc_fill_info() and adjust can_tdc_get_size() and can_data_bittiming_get_size() so that only the automatic TDCV size is skipped when the interface is down. The other TDC parameters are still reported, as they are meaningful while the interface is down. This is a defensive hardening based on code inspection; the automatic TDCV path has not been triggered on hardware. Signed-off-by: ChunYuZhiQiang Reviewed-by: Vincent Mailhol Fixes: e8060f08cd69 ("can: netlink: add can_priv::do_get_auto_tdcv() to retrieve tdcv from device") Link: https://patch.msgid.link/20261027065012.191348-2-chunyuzhiqiang@yinhe.ht [mkl: fix open parenthesis alignment] Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin commit 1e008a59213e7909bf574df13099aefb10178fb9 Author: Cunhao Lu <1579567540@qq.com> Date: Fri Jul 31 17:45:01 2026 +0800 can: skb: make CAN skb allocation failure paths IRQ-safe [ Upstream commit d4b616a38118e81cfb206babd052db260d7abf6c ] The CAN skb allocation helpers are used from hardware interrupt receive handlers. If can_skb_ext_add() fails, they release the newly allocated skb with kfree_skb(), which is not safe in hardware interrupt context. Use dev_kfree_skb_any() for the allocation failure paths in alloc_can_skb(), alloc_canfd_skb(), and alloc_canxl_skb(). Fixes: 96ea3a1e2d31 ("can: add CAN skb extension infrastructure") Signed-off-by: Cunhao Lu <1579567540@qq.com> Link: https://patch.msgid.link/tencent_C825C17D442F801351CE2FBC4984064B4605@qq.com Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin commit 81a842885c20b0594b29f9ee31e05771982615c0 Author: James Fantin-Hardesty Date: Fri Oct 30 13:18:53 2026 -0600 nvmet: fix arbitration burst field mask [ Upstream commit 6976a9b8dc71bb3b6e5dd563e35510461bea29d4 ] The Arbitration Burst (AB) field of the Arbitration feature is CDW11 bits 2:0 (NVMe Base Specification 2.1, Feature 01h), but nvmet incorrectly masks it with 0x3. Use 0x7 for both set and get. Fixes: a0ed77d4c9a7 ("nvmet: Implement arbitration feature support") Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: James Fantin-Hardesty Signed-off-by: Keith Busch Signed-off-by: Sasha Levin commit 0a987038ea68d3c14ea905c817855b2e58ace158 Author: Kyle Zeng Date: Fri Oct 30 08:58:43 2026 +0100 tcp: wait for TIME_WAIT teardown before freeing per-netns ehash [ Upstream commit 647b81ddefc6364290e67bf33c89d54971f8995e ] inet_twsk_kill() removes a TIME_WAIT socket from the established hash before it finishes using the ehash lock, hashinfo and bind tables, and before it drops the death-row reference. A running timer can therefore unhash its socket before inet_twsk_purge() reaches it. The purge cannot synchronize with that timer, and tcp_sk_exit_batch() can free the private ehash and hashinfo while inet_twsk_kill() is still using them. An unprivileged reproducer using user and network namespaces, a private TCP ehash and a FIN_WAIT2 timer triggers a KASAN slab-use-after-free in inet_twsk_kill(). The allocation and free stacks point to inet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free(). Wait for an RCU grace period after purging the whole batch, if one netns in the batch uses a private ehash. TIME_WAIT removal runs with bottom halves disabled, so this also waits for removers that were already invisible to the purge. Keep the wait under tcp_exit_batch_mutex, before freeing any private hashinfo. The same window exists with the shared tcp_hashinfo. There, the hashinfo memory stays valid, but tcp_sk_exit_batch() can decrement tcp_death_row.tw_refcount from 2 to 1 before inet_twsk_kill() drops its own reference. This triggers the WARN_ON_ONCE() in tcp_sk_exit_batch(), then a refcount_t "decrement hit 0" warning from inet_twsk_kill(). Adding a grace period for the shared case would be costly on busy hosts. It is not needed: struct net is freed by a later cleanup_net(), after the synchronize_rcu() in ops_undo_list(), so inet_twsk_kill() can safely drop the last tw_refcount reference itself. Use refcount_dec_if_one() and only warn if tw_refcount is not 1 after a grace period. Fixes: d1e5e6408b30 ("tcp: Introduce optional per-netns ehash.") Signed-off-by: Kyle Zeng [edumazet: only call synchronize_net() if one netns in the batch uses a private ehash, use refcount_dec_if_one() to avoid a false WARN with the shared ehash] Signed-off-by: Eric Dumazet Reviewed-by: Jiayuan Chen Reviewed-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261030075843.2567707-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 0a83d0186d5a474235f6e11975ee0fd0d54ff021 Author: Niklas Cassel Date: Thu Oct 22 11:22:01 2026 +0200 null_blk: don't finish zones to set them read-only or offline [ Upstream commit 973bf587d79f061beffdd392e77012a07f25fcd6 ] null_set_zone_cond() calls null_finish_zone() to release the zone resources held by a zone before setting it read-only or offline. For an empty or closed zone, null_finish_zone() first runs the zone resource checks, which can close an unrelated implicitly open zone, or fail. As the error is ignored, a failure for a closed zone leaks nr_zones_closed, permanently lowering the effective active zone limit. Setting a zone read-only or offline requires no zone resources, so release the zone resources held by the zone directly instead, using a new helper, null_release_zone_resources(). Fixes: d3a5738849e0 ("null_blk: support read-only and offline zone conditions") Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20261022092158.2248831-7-cassel@kernel.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 1b84a03eec687e231c7de5b9f5f34bb234e207c7 Author: Niklas Cassel Date: Thu Oct 22 11:22:00 2026 +0200 null_blk: fix opening closed zones at the active zone limit [ Upstream commit 6f2b59737bf9cf3623719857ac149f0d431db109 ] When the open zone limit is reached, null_check_open() closes an implicitly open zone only if the active zone limit is not reached. Closing an implicitly open zone does not change the number of active zones, so this check is wrong. For an empty zone, the active zone limit was already checked by null_check_zone_resources(). For a closed zone, the check makes writing to, opening or finishing the zone fail with BLK_STS_ZONE_OPEN_RESOURCE at the active zone limit, whereas ZBC-3 (4.5.3.2.7.2) and NVMe ZNS (2.1.1.4.1) require closing an implicitly open zone instead. Remove the check, and update the comment above null_check_zone_resources() accordingly. Fixes: dc4d137ee3b7 ("null_blk: add support for max open/active zone limit for zoned devices") Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20261022092158.2248831-6-cassel@kernel.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit a1456df5609409ae4ea15f572c3d96062ed2d2a0 Author: Nguyen Dinh Phi Date: Fri Oct 30 14:43:50 2026 +0800 vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT [ Upstream commit c0ef6144b4d60afb90bc6d8db3ffdac043cd6ffc ] The timeval validation checks tv_usec < USEC_PER_SEC but not tv_usec >= 0, so a negative tv_usec makes the timeout computation wrap into a bogus value, later tripping "schedule_timeout: wrong timeout value" instead of being rejected. Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Signed-off-by: Nguyen Dinh Phi Reviewed-by: Stefano Garzarella Reviewed-by: Bobby Eshleman Link: https://patch.msgid.link/20261030064428.73930-1-phind.uet@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 7efa36da3a581ab93fe4f20333e4c5f44f518e43 Author: Yunye Zhao Date: Mon Nov 2 21:37:40 2026 +0800 virtio_blk: freeze the virtqueue layout at probe time [ Upstream commit d53c1a12ff1cfdb12770ddcfdf5603915d0ba0d8 ] init_vq() reads the writable num_request_queues and poll_queues module parameters both at probe and when recreating virtqueues after suspend or reset. However, virtio-blk does not update the blk-mq hardware queue count or queue maps on restore. Increasing poll_queues can therefore remove the completion callback from a virtqueue still used for interrupt-driven I/O, leaving requests uncompleted. Reducing the effective request queue count through num_request_queues can instead leave existing hardware contexts indexing beyond the reallocated vblk->vqs array. Determine the virtqueue count and the split between interrupt-driven and polling queues once at probe, and reuse this layout when recreating the virtqueues. Changes to these module parameters then affect only subsequently probed devices. Fixes: 0989c41bed96 ("virtio-blk: add num_request_queues module parameter") Signed-off-by: Yunye Zhao Reviewed-by: Stefan Hajnoczi Link: https://patch.msgid.link/20261102133740.88919-1-yunye.zhao@linux.alibaba.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit e8cf9ee52705642317184804acff781c9fd0727e Author: Shao Mingyin Date: Sat Oct 31 22:16:10 2026 +0800 zloop: reject mismatched conventional zone files on restore [ Upstream commit 09c2e203e0ea8b68e7c9500401fa0ab60baf1a9d ] When restoring a zloop device, zloop_init_zone() checks that the size of each conventional zone file matches the configured zone size. The check prints an error and then jumps to out_fput, which releases the zone file and returns the value left in "ret" by the preceding vfs_getattr() call, that is, zero. zloop_ctl_add() therefore treats the zone as initialized and continues with a zone->file pointer that was already released; any I/O to that zone then dereferences it. Return -EINVAL, like the sequential zone path does for the same kind of inconsistency. While at it, print the zone size that is actually compared instead of the zone capacity, which may be smaller and only made the message confusing. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Signed-off-by: Shao Mingyin Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://patch.msgid.link/20261031221610676B5VoVcwMgkoDNVZH2bVDO@zte.com.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 38a0bef2e81b1518866bc7cd36c01d889c7c130d Author: Shao Mingyin Date: Sat Oct 31 22:17:37 2026 +0800 zloop: fix the error code in the blk_mq_alloc_disk message [ Upstream commit 703f6aee8d8d1cb6227af56169be6b1dc4d3c4d5 ] When blk_mq_alloc_disk() fails, "ret" still holds the zero returned by the preceding blk_mq_alloc_tag_set() call, so the error message always reports "err=0". Save PTR_ERR(zlo->disk) in "ret" before printing it, like the blk_mq_alloc_tag_set() and add_disk() failure paths do. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Signed-off-by: Shao Mingyin Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://patch.msgid.link/20261031221737569WQ3bg8y80Ht7JdTCWwlkL@zte.com.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 66e7924a5f11c2806586b497acb2a83391018aa4 Author: Avi Weiss Date: Sat Oct 31 12:20:24 2026 +0200 block: report the correct discard alignment in sysfs [ Upstream commit 2516f0413f8704a7370ef8a2eeae26c9bc438978 ] disk_discard_alignment_show() reports the physical I/O alignment offset instead of the discard alignment. Devices can specify these offsets independently, so the discard_alignment sysfs attribute can report the wrong value. Use bdev_discard_alignment() for the whole-disk attribute, as is already done for partitions. Fixes: 4e1462ffe899 ("block: remove queue_discard_alignment") Signed-off-by: Avi Weiss Reviewed-by: Christoph Hellwig Link: https://patch.msgid.link/20261031102023.3644494-2-thnkslprpt@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit c48b839c32a3f45e1cdfe86ab21be2585f3420bd Author: Zizhi Wo Date: Mon Nov 2 16:04:42 2026 +0800 block: partitions: reject GPT entries with starting_lba > ending_lba [ Upstream commit 7e3801d12ebabaa3db6e2685ccc80b6e6f6d1ff7 ] A GPT entry whose starting_lba is greater than its ending_lba is accepted, and the kernel creates a partition with a bogus size. The bogus sector count defeats the end-of-device check, so I/O through that partition is not confined to it and can access sectors outside the partition on the same disk. is_pte_valid() only rejects an entry when its type is NULL or when starting_lba or ending_lba is greater than lastlba; it never checks that starting_lba <= ending_lba. For a reversed entry both field checks still pass, but efi_partition() computes size = ending_lba - starting_lba + 1 in u64, which underflows to a huge value. That value also wraps in the end-of-device check in blk_add_partition() (from + size) and does not fit the signed i_size, which turns negative. Reject entries with starting_lba > ending_lba in is_pte_valid(), matching the head-level check against last_usable_lba < first_usable_lba. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Zizhi Wo Reviewed-by: Christoph Hellwig Link: https://patch.msgid.link/20261102080442.3775061-1-wozizhi@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit f593b1e6e6a556bc769f8d1b82952bd953eb2233 Author: Shao Mingyin Date: Mon Oct 26 19:55:19 2026 +0800 virtio-blk: Fix zone append sector reporting in batched completion [ Upstream commit 08a6572441a4e646c96c2b8d8ead9eea0e458332 ] For zone append, the block layer copies req->__sector back into the bio in blk_zone_append_update_request_bio(), so the driver must update req->__sector with the sector reported by the device. virtblk_request_done() does that, but the batched completion path used by virtblk_poll() only unmaps and cleans up the requests before calling blk_mq_end_request_batch(). A zone append completed through polling therefore keeps the sector that was assigned at submission time, and the file system or application sees the wrong LBA for the written data. Move the sector update into a helper and call it from both completion paths. Fixes: 95bfec41bd3d ("virtio-blk: add support for zoned block devices") Signed-off-by: Shao Mingyin Acked-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Christoph Hellwig Link: https://patch.msgid.link/202610261955196384aSLGuy3_0MiTvlYXVdiC@zte.com.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 98bf8743f89b64e90cf57f41339b704ce7196ccd Author: Jianan Huang Date: Fri Oct 23 17:26:11 2026 +0800 blk-mq: reset queue state on scheduler teardown [ Upstream commit 3a9892bca4dd0182db61702e131cad569b1d71e6 ] We observed I/O timeouts with requests stalled in per-CPU software queues. The affected queue had no elevator, but QUEUE_FLAG_SQ_SCHED remained set. A failed elevator switch can leave this state when falling back to none without clearing the flag. With empty hctx dispatch lists, a queue-wide restart on CPU4 would skip requests pending in ctx5/ctx7: CPU4: blk_mq_run_hw_queues(q) sq_hctx = hctx4 hctx4: no pending requests -> selected hctx5: 9 reads in ctx5 -> skipped hctx7: 3 writes in ctx7 -> skipped The pending requests may remain undispatched until another event runs their hardware queues. Clear the flag and restore nr_requests and async_depth to the driver queue depth in the common scheduler teardown path, covering both scheduler exit and failed initialization. Fixes: 4d337cebcb1c ("blk-mq: avoid to touch q->elevator without any protection") Assisted-by: LLM Signed-off-by: Jianan Huang Reviewed-by: Christoph Hellwig Link: https://patch.msgid.link/20261023092611.116795-1-jnhuang95@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 5aed9c2e16c302a57a49094edfaa4ce62b1f9f61 Author: John Ogness Date: Fri Oct 30 15:03:55 2026 +0106 printk: Avoid multiple unregistration in unregister_console_locked() [ Upstream commit 8a7f26aa072a4e63bc3b1adfe649546709db722e ] unregister_console_locked() is called from within hlist_for_each_entry_safe(console_list) loops. This would be safe if unregister_console_locked() only unregistered the specified console. After all, that is what the _safe variant is for. However, unregister_console_locked() calls printk_kthreads_check_locked(), which can unregister _multiple_ consoles if kthreads fail to start. This could lead to hlist_for_each_entry_safe() use-after-free scenarios because not only was the list entry removed, but possibly the following entry as well (the @n temporary storage of the next entry). Move the call to printk_kthreads_check_locked() outside of unregister_console_locked(). Add comments to both functions to clarify if they are safe to be used in hlist_for_each_entry_safe(console_list) loops. Reported-by: Sashiko Closes: https://lore.kernel.org/lkml/87ik31iz4x.fsf@jogness.linutronix.de Fixes: 76f258bf3f2a ("printk: nbcon: Introduce printer kthreads") Signed-off-by: John Ogness Reviewed-by: Petr Mladek Tested-by: Derek Barbosa Link: https://patch.msgid.link/20261030135802.663893-1-john.ogness@linutronix.de Signed-off-by: Petr Mladek Signed-off-by: Sasha Levin commit 0319d5f83009c9f5163df84690135c0fd55f2cea Author: Josef Bacik Date: Tue Oct 27 18:43:14 2026 +0000 ext2: only flush DIRSYNC directories on every change [ Upstream commit 3f57fc2c49ed05ccfc56e4dc9eda41be95925bbd ] Every change of an ext2 directory is written to disk before the system call returns, whether the directory is DIRSYNC or not: its pages with filemap_write_and_wait() and its inode with sync_inode_metadata(). Writes which reach the device for 2000 files, and 200 directories, in a directory without DIRSYNC, with the flusher turned off: create rename unlink mkdir before 4000 8000 4000 800 after 0 0 0 0 In a directory with chattr +D the numbers are those of "before", before and after. commit bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC directories") moved the flush from ext2_commit_chunk() to the new ext2_handle_dirsync(). The IS_DIRSYNC() check which was around it didn't move along. Fix by putting the check into ext2_handle_dirsync(). Fixes: bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC directories") Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-b4-ext2-dirsync-v1-1-3dcd012d518d@toxicpanda.com Signed-off-by: Jan Kara Signed-off-by: Sasha Levin commit 7738c87c414ed16c8e5daf6d3b96cf2f9e613dbc Author: Jia Jia Date: Fri Oct 23 18:40:35 2026 +0800 vhost-scsi: fix page reference leak in misaligned I/O fallback [ Upstream commit 058fc59326af3350c6e830858e56d2aeecabe0a2 ] iov_iter_get_pages2() returns a byte count that excludes the offset into the first page, but also returns a reference to that page in pages[]. On the misaligned-I/O fallback, vhost_scsi_revert_map_iov_to_sgl() puts pages already added to the SG list. The cleanup loop starts at pages[npages], but accounts for its first page as PAGE_SIZE bytes rather than PAGE_SIZE - offset. If the remaining data starts at a non-zero offset, it can finish one page early and leave a page reference behind. Use PAGE_SIZE - offset for the first remaining page and clear offset for later pages, as in the mapping loop. Without this, each affected request leaks one page reference. Fixes: bca939d5bcd0 ("vhost-scsi: Dynamically allocate scatterlists") Reviewed-by: Mike Christie Signed-off-by: Jia Jia Signed-off-by: Michael S. Tsirkin Message-ID: <20261023104035.6686-1-physicalmtea@gmail.com> Signed-off-by: Sasha Levin commit a13e04cd7811ce469811ccdb47cea2b1868b1ffb Author: Mingbing Zhai Date: Fri Oct 16 10:54:29 2026 +0800 virtio_balloon: initialize wakeup_lock before virtqueues are set up [ Upstream commit 161aa708b02cc997a51701c342f3cebade0b5164 ] Since c578123e63da ("virtio_balloon: Treat stats requests as wakeup events") the stats_request() virtqueue callback takes vb->wakeup_lock via start_wakeup_event(). init_vqs() registers that callback and even primes and kicks the stats queue, so the lock is reachable from irq context as soon as init_vqs() returns, long before the driver sets DRIVER_OK: vring_interrupt() dispatches to the callback without any DRIVER_OK check unless CONFIG_VIRTIO_HARDEN_NOTIFICATION is set, and that option depends on BROKEN. syzbot hit it from a threaded irq: INFO: trying to register non-static key in stats_request ... assign_lock_key register_lock_class lock_acquire rt_spin_lock start_wakeup_event drivers/virtio/virtio_balloon.c:150 [inline] stats_request drivers/virtio/virtio_balloon.c:435 The lock is only initialized near the end of virtballoon_probe(), after init_vqs() and several steps that can still fail and unwind through del_vqs(), where a racing interrupt still finds the callback registered. Until then it is whatever kzalloc() left in vb: lockdep complains about the unregistered lock class, and wakeup_signal_mask and processing_wakeup_event get updated from irq context while probe is still running. The rt_spin_lock() in the report is just spin_lock() on PREEMPT_RT; any PROVE_LOCKING build takes the same path. stop_update_lock(), which the same callback also acquires, is already initialized before init_vqs(); do the same for wakeup_lock. Fixes: c578123e63da ("virtio_balloon: Treat stats requests as wakeup events") Reported-by: syzbot+13df72e0dc4be5c62215@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=13df72e0dc4be5c62215 Signed-off-by: Mingbing Zhai Signed-off-by: Michael S. Tsirkin Message-ID: <20261016025429.901-1-zhaimingbing@cmss.chinamobile.com> Signed-off-by: Sasha Levin commit 87922f82a7703d693772e8cb71f10744ba9e0360 Author: Linfeng Sun Date: Sun Oct 11 18:28:24 2026 +0800 vhost-vdpa: initialize state before publishing cdev [ Upstream commit 4b03d1e7f13613af708441a061556de99891a516 ] Initialize the completion and as hash buckets before cdev_device_add() makes the device accessible. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Assisted-by: OpenAI-Codex:GPT-5.6 Signed-off-by: Linfeng Sun Signed-off-by: Michael S. Tsirkin Message-ID: <20261011-fix-null-pointer-in-vhost_vdpa_release-v2-1-66ba929971ce@gmail.com> Signed-off-by: Sasha Levin commit 685a15010de7b40cdf2a6a0bc2d8704bc83c6a0c Author: Linfeng Sun Date: Sun Oct 11 15:33:30 2026 +0800 vhost: reject backend enable without a kick file [ Upstream commit 509f6bd229e94fc39506e01be692c4aa22338b49 ] Enabling a backend without VHOST_SET_VRING_KICK dereferences a NULL vq->kick in vhost_poll_start(). Reject the request with -EINVAL. Fixes: 264ee5aa81ec ("tools/virtio: Add --reset") Assisted-by: OpenAI-Codex:GPT-5.6 Signed-off-by: Linfeng Sun Signed-off-by: Michael S. Tsirkin Message-ID: <20261011-fix-null-pointer-in-vhost_test_set_backend-v1-1-60b2f12d64c6@gmail.com> Signed-off-by: Sasha Levin commit db9af3f03bafcb1bdcc28a79600d2a32692c4d63 Author: Linfeng Sun Date: Sat Oct 10 20:22:58 2026 +0800 vhost-scsi: reject delayed virtqueue setup [ Upstream commit a543346b96a174fcee6812ac2764acc8dc993358 ] vhost_scsi_set_endpoint() allocates command pools only for I/O virtqueues that are already set up, but publishes the backend for every virtqueue. Userspace can complete a skipped queue after attaching the endpoint, then kick it with scsi_tags uninitialized and trigger the alloc_hint warning in sbitmap_get(). Delayed virtqueue setup is not supported. Leave skipped I/O virtqueues inactive and reject changes to the vring size or addresses while an endpoint is attached. Userspace must clear the endpoint before changing the vring configuration. I found this bug myself, though the patch was written with AI assistance. Fixes: 25b98b64e284 ("vhost scsi: alloc cmds per vq instead of session") Assisted-by: OpenAI-Codex:GPT-5.6 Signed-off-by: Linfeng Sun Signed-off-by: Michael S. Tsirkin Message-ID: <20261010-fix-warning-in-sbitmap_get-v3-1-33de562d1359@gmail.com> Signed-off-by: Sasha Levin commit 015e69a1d74eefffdb9badbed7c922cb57cd9592 Author: sungbyeongchan Date: Thu Oct 8 14:04:23 2026 +0900 virtio_ring: use shadow flags when detaching split descriptors [ Upstream commit e498eb93f961db1a1dfdabd373500f0d4019c9a4 ] Split virtqueues save descriptor flags and next indexes in desc_extra before publishing descriptors to the device. The detach path uses the shadow next index, but decides whether to continue by rereading the NEXT flag from the shared descriptor. Use the shadow flags for the continuation decision as well. This keeps all detach metadata in the same driver-owned snapshot and avoids an unnecessary shared-ring read. Fixes: 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra for split virtqueue") Acked-by: Michael S. Tsirkin Assisted-by: LLM Signed-off-by: sungbyeongchan Signed-off-by: Michael S. Tsirkin Message-ID: <20261008050423.32221-1-tjdqudcks0424@naver.com> Signed-off-by: Sasha Levin commit 1b5fe4af3f29146eec764f5c40175056d69f8bbd Author: Linfeng Sun Date: Fri Oct 9 17:09:12 2026 +0800 vhost-scsi: validate event queue descriptor direction [ Upstream commit 3d8c5b714c186d08c8fe8c8cfd1f9b89525ab067 ] vhost_get_vq_desc() returns the number of device readable (output) and device writable (input) iovec segments. A guest can submit an eventq descriptor chain that fills vq->iov with output segments, setting out to ARRAY_SIZE(vq->iov) and in to zero. When the host later queues a vhost-scsi event, vhost_scsi_do_evt_work() uses out as the index of the first input segment. This accesses one element beyond vq->iov and triggers an array-index-out-of-bounds report. With panic_on_warn enabled, the report panics the host. The event queue accepts device writable buffers only. Reject chains that contain output segments or lack an input segment before using out as an index. The input check prevents the out-of-bounds access, while the output check validates the eventq descriptor direction. I found the descriptor direction issue myself, though the patch was written with AI assistance. The out-of-bounds read with an output-only chain was separately reported by Jia Jia. Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support") Reported-by: Jia Jia Assisted-by: OpenAI-Codex:GPT-5 Signed-off-by: Linfeng Sun Message-ID: <20261009-fix-arrary-index-out-of-bounds-in-vhost_scsi_complete_events-v2-1-1f7689a54735@gmail.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin commit fce55a4307e4261a3f0cf790be5d5bc3532429a5 Author: Shuai Zhang Date: Mon Nov 2 17:48:00 2026 +0800 power: sequencing: qcom-wcn: increase WCN7850 power-up delay [ Upstream commit bd60a639b621453fe37b780df4b6d3a13f981f13 ] When the WCN7850 is powered up from the Bluetooth side first, i.e. BT_EN is asserted while WLAN_EN is still low, the chip starts from a cold state and is not ready to accept the first HCI command 50 ms after BT_EN goes high. The first command (0xfc00, read QCA version) is lost, hci_qca does not resend it and fails after the 2 s command timeout: Bluetooth: hci0: Reading QCA version information failed (-110) When WLAN is powered first, 50 ms is sufficient, so the failure only shows up in the BT-first ordering. Measured on the affected board by which enable pin rose first: pwup_delay_ms BT-first boots with -110 50 9 9 75 23 0 100 21 0 300 20 0 Raise the power-up delay of WCN7850 to 100 ms. The delay is shared by the Bluetooth and WLAN targets, so WLAN power-up also waits 50 ms longer. Fixes: 2f1630f437df ("power: pwrseq: add a driver for the PMU module on the QCom WCN chipsets") Signed-off-by: Cheng Jiang Signed-off-by: Shuai Zhang Reviewed-by: Dmitry Baryshkov Link: https://patch.msgid.link/20261102094800.3225454-1-shuai.zhang@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 0a6ee97ea602e4983229ba3295c088163136b8d3 Author: Eric Dumazet Date: Fri Oct 30 09:33:58 2026 +0100 xfrm: iptfs: fix skb leak on error in __input_process_payload() [ Upstream commit 64e45ed926cdd017c9816c8006d9117a7194c7e9 ] syzbot reported a memory leak of the received skb (and its sec_path extension) in the IP-TFS receive path. __input_process_payload() parses the inner packets of an IP-TFS payload and queues them on @sublist, which is only sent after the parsing loop. Three error paths inside the loop (skb_copy_seq_read() failure, invalid inner IPv4 header length, unknown IP version) jump to the "done" label, which is placed after the code sending @sublist. Any skb already queued on @sublist is then neither delivered nor freed. This includes skbs added by iptfs_reassem_cont() before the call, newly allocated inner packets, and, since the received skb can be reused for the first inner packet, the received skb itself. Move the "done" label before the trim/send code, so that inner packets parsed before the error are delivered as on the normal exit path. The received skb is then still freed (or consumed) as before when it was not reused. Fixes: 6c82d2433671 ("xfrm: iptfs: add basic receive packet (tunnel egress) handling") Reported-by: syzbot+a3f21220cbbb6e14ee2e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/6ae4102e.9c6421ad.36baac.0005.GAE@google.com/ Signed-off-by: Eric Dumazet Acked-by: Steffen Klassert Link: https://patch.msgid.link/20261030083358.2653599-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit c4e6a85413f76a2152679567c59aef5168ea9d09 Author: Jia Jia Date: Mon Oct 12 18:39:54 2026 +0800 vhost-scsi: do not count PI bytes in the data length [ Upstream commit 1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d ] vhost_scsi_handle_vq() moves pi_bytesout or pi_bytesin into the protection sgl and subtracts those bytes from exp_data_len. The length passed to TCM is still exp_data_len + prot_bytes. prot_bytes comes from virtio_scsi_cmd_req_pi. With VIRTIO_SCSI_F_T10_PI negotiated, vhost reads that header and does not check that the CDB is a READ or WRITE. sbc_check_prot() replaces data_length from the CDB only when the protect field is non-zero. target_cmd_size_check() leaves a write's data_length unchanged when the CDB size is smaller, so a command that does not get that replacement keeps a data_length larger than the data sgl. The KASAN report is a MODE SELECT whose header had pi_bytesout set. The data sgl held only the parameter list. spc_emulate_modeselect() walked data_length and read the next physical page. Pass the data sgl length. Protected READ and WRITE still take their length from the CDB in sbc_check_prot(). KASAN reports: BUG: KASAN: use-after-free in spc_emulate_modeselect+0x145/0x380 [target_core_mod] Read of size 1 spc_emulate_modeselect __target_execute_cmd target_execute_cmd vhost_scsi_write_pending transport_generic_new_cmd __target_submit target_queued_submit_work process_one_work worker_thread kthread ret_from_fork ret_from_fork_asm Fixes: 9f977ef7b671 ("vhost-scsi: Include prot_bytes into expected data transfer length") Signed-off-by: Jia Jia Signed-off-by: Michael S. Tsirkin Message-ID: <20261012103954.136698-1-physicalmtea@gmail.com> Signed-off-by: Sasha Levin commit 5accdcc5fc3098e80f5175819c1a1d8771008302 Author: Eric Dumazet Date: Fri Oct 30 13:09:56 2026 +0100 soreuseport: annotate data-races around reuse->socks[] and num_socks [ Upstream commit 213d491308b99d026514c93980cf8dd572226b1b ] reuseport_select_sock() and reuseport_migrate_sock() read reuse->num_socks and reuse->socks[] locklessly under RCU, while writers holding reuseport_lock can change them. Readers snapshot num_socks once, then index socks[] with it. Meanwhile, writers can perform several operations, storing into slots below the reader's stale count: - __reuseport_detach_sock() moves the last socket into slot i. - __reuseport_add_sock() then writes the new socket at the (now smaller) num_socks index. - reuseport_stop_listen_sock() calls __reuseport_detach_sock() then __reuseport_add_closed_sock(), which writes slot max_socks - num_closed_socks - 1. This can be the slot a reader still considers part of the listener region when the array is full. - __reuseport_detach_closed_sock() can then rewrite that slot. All pointers stored in socks[] remain valid for the RCU grace period, but without annotations the compiler is allowed to tear or reload these accesses. For instance, reuseport_select_sock_by_hash() could reload reuse->socks[i] between the sk_state/sk_incoming_cpu checks and the return, returning a socket that did not pass them. Use WRITE_ONCE() for all socks[] stores done while the array is visible to readers, and for num_socks updates (readers already use READ_ONCE()). Use READ_ONCE() in the two lockless readers. Fixes: ef456144da8e ("soreuseport: define reuseport groups") Link: https://lore.kernel.org/netdev/20260902071900.395567-1-ruanjinjie@huawei.com/ Cc: Kuniyuki Iwashima Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Reviewed-by: Jiayuan Chen Link: https://patch.msgid.link/20261030120956.3026324-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit c221d089e0cee4d5f6413c215ddff387beb2bc61 Author: Yifan Zhang Date: Tue Nov 3 10:45:19 2026 +0800 ksmbd: require NUL-terminated EA names [ Upstream commit e49296d51ccbf2ad0ed0484db1382f1d7217bd6e ] smb2_set_ea() verifies that the byte reserved for the declared EA-name terminator lies inside the request, but it does not verify that the byte is zero. With SMB debug logging enabled, the name is passed to %s and the diagnostic reads beyond the request allocation. KASAN reports: BUG: KASAN: slab-out-of-bounds in string Read of size 1 string vsnprintf _printk smb2_set_ea smb2_set_info Reject an EA entry whose declared terminator byte is nonzero. Return -EBADMSG for the malformed buffer, and map that error to STATUS_EA_LIST_INCONSISTENT for both SET_INFO and CREATE. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Suggested-by: Namjae Jeon Signed-off-by: Yifan Zhang Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit d3d8e7e445634f324c6597908075ca98bf0af033 Author: Bart Van Assche Date: Thu Oct 29 11:00:39 2026 -0700 mctp i3c: Fix locking in an error path [ Upstream commit 750eb5ab457e62e221a9c8521e2274f14c85b387 ] If netdev_alloc_skb() fails, mctp_i3c_read() jumps to a label that unlocks mi->lock although that mutex has not been locked yet. Fix this by returning -ENOMEM directly. This bug has been detected by the Clang thread-safety analyzer. Cc: Leo Yang Cc: Paolo Abeni Cc: Jeremy Kerr Cc: Matt Johnston Cc: netdev@vger.kernel.org Fixes: 2d2d4f60ed26 ("mctp i3c: fix MCTP I3C driver multi-thread issue") Signed-off-by: Bart Van Assche Acked-by: Matt Johnston Link: https://patch.msgid.link/71e0a880ffe7a83237e501b07884bf54343e76ca.1793296780.git.bvanassche@acm.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 4ae9aecbe6fe121a5d731b0c167eb45fb51833d9 Author: Ville Syrjälä Date: Fri Oct 23 19:57:51 2026 +0300 drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start() [ Upstream commit 01aa63eade529680cb28fce40f2357bf392a249f ] intel_vrr_dcb_vmin_vblank_start() may evaluate intel_vrr_dcb_vmin_vblank_start_next() twice, and given that this is doing hardware access under the hood isn't really desired. Even worse, the double evaluation might even cause intel_vrr_dcb_vmin_vblank_start() itself to finally return -EINVAL (if we race against the DMC hard enough), which we definitely never want to do. Eliminate the double evaluation, guaranteeing a sane final return value at the same time. Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20261023165803.31016-2-ville.syrjala@linux.intel.com Fixes: c4aba65c26fd ("drm/i915/display: Wait for VRR PUSH status update") Reviewed-by: Jani Nikula (cherry picked from commit 9defa95510abce51f68d926b445567784a0a6701) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin commit be44e671393848ef95c720e553e7698c738f5117 Author: Yehyeong Lee Date: Tue Oct 20 09:50:27 2026 +0900 wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response [ Upstream commit f17e2eda1630ab375ac71a91252694a485addef7 ] nxpwifi_ret_11ax_cfg() walks the TLVs the firmware returns and copies an HE capability into fixed-size buffers without bounding any length. A response shorter than the fixed part wraps the u16 walk length, and header->len is used as a memcpy length without being checked against the destination. Reject a response too short for the fixed part, reject a TLV longer than the bytes left, and reject an HE capability that does not fit its destination. Select the destination buffer first, by band, then validate and copy that one. The lengths come from device firmware, so this is not a demonstrated out-of-bounds write. The driver has not appeared in a released kernel, so there is no stable tag. Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") Signed-off-by: Yehyeong Lee Reviewed-by: Jeff Chen Signed-off-by: Jeff Chen Signed-off-by: Sasha Levin commit 5245678057666f51be8c5fdeaee6d37d0f695625 Author: Yehyeong Lee Date: Tue Oct 20 09:50:26 2026 +0900 wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset [ Upstream commit 1cb78390d1c6c7908ab9838238a702799e0f7e9f ] The send side writes the extension ID as the first payload byte of the TLV in nxpwifi_cmd_11ax_cfg(), but nxpwifi_ret_11ax_cfg() reads it one byte later and copies the HE capability from the same wrong offset. The capability test runs on the wrong byte and the copy reads one byte past the declared payload. Read the extension ID and copy the capability from the first payload byte. A zero-length extension TLV has no payload to read an extension ID out of, so skip it. Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") Cc: stable@vger.kernel.org Signed-off-by: Yehyeong Lee Reviewed-by: Jeff Chen Signed-off-by: Jeff Chen Stable-dep-of: f17e2eda1630 ("wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response") Signed-off-by: Sasha Levin commit e848bb63d24d5ef03d90b1f1de07a91d1fd40cfb Author: Yehyeong Lee Date: Tue Oct 20 09:50:25 2026 +0900 wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer [ Upstream commit 6a5cf549f4dcbd502db8cd00c5f49d20a2b9648f ] nxpwifi_wait_queue_complete() clears curr_cmd->data_buf when a synchronous command is interrupted, but nxpwifi_process_cmdresp() still hands that field to the response handler. The three handlers in 11ax.c store through it without checking, so a late response oopses. Check the buffer first and return 0 when it is NULL, as the sta_cmd.c handlers that commit 068986fd6f2a5 ("wifi: nxpwifi: detach sync command buffer on interrupted wait") covers already do. This is a local denial of service: it needs an interrupted synchronous command and a late response, both on the local host. Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") Cc: stable@vger.kernel.org Signed-off-by: Yehyeong Lee Reviewed-by: Jeff Chen Signed-off-by: Jeff Chen Stable-dep-of: f17e2eda1630 ("wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response") Signed-off-by: Sasha Levin commit 2f993b0a555d1c76d548989b64a1da8a0682cd1d Author: Danish Khateeb Date: Thu Oct 22 07:18:37 2026 -0500 selftests/mm: merge: keep the far mremap() targets in the carveout [ Upstream commit 332c1bd17422c1aa59e18513042e56ea5aac4051 ] The merge tests map their areas at fixed addresses within a 30-page PROT_NONE carveout. Several mremap() tests move an area 1000 or 2000 pages away to separate it from the others, but those targets are outside the carveout, and MREMAP_FIXED unmaps whatever is mapped there. Under virtme-ng, the shared libraries are packed right above the carveout and the dynamic linker starts about 4 MiB above it. The moves then replace part of its text with an anonymous mapping, and the test crashes in its next lazily bound call: merge[6980]: segfault at 7f7ebb3c1e60 ip 00007f7ebb3c1e60 sp 00007ffd35fbaec8 error 14 Two to four of the mremap() tests then fail with "Test terminated unexpectedly by signal 11", depending on the exact layout. On a host where libc is mapped at a 2 MiB aligned address, the targets happen to land above the dynamic linker and the tests pass. Since the areas are all within the first 30 pages, moving one by 30 pages is enough to keep it apart from the others. Add FAR_PAGES for that distance, move areas by FAR_PAGES or 2 * FAR_PAGES pages, and make the carveout 3 * FAR_PAGES pages so that it covers every target. Link: https://lore.kernel.org/20261022121837.28723-1-danishkhateeb03@gmail.com Fixes: 4e25f85b9f85 ("tools/testing/selftests: add mremap() unfaulted/faulted test cases") Signed-off-by: Danish Khateeb Signed-off-by: Andrew Morton Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Gregory Price (Meta) Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Jann Horn Cc: Pedro Falcato Cc: David Hildenbrand Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Shuah Khan Signed-off-by: Sasha Levin commit 6648daa69c802b096a22922c87cbd6dca4bb766f Author: Xu Yunxiang Date: Tue Nov 3 03:03:49 2026 +0800 bpf: Propagate scalar precision through stack arguments [ Upstream commit d537252cc8a53b6ed6a3e7d0d895cb1cdd3ba42c ] Outgoing stack arguments retain scalar verifier state separately from registers and ordinary spills. State comparison uses their precision marks, but propagate_precision() does not carry those dependencies from a reused state to the current path's ancestors. A path can consequently reuse a state without making earlier checkpoints distinguish scalar values that will later be used as memory offsets. Seed the existing backtracking batch with precise scalar argument slots from every frame. Incoming arguments live in the caller's outgoing slots, so include caller frames as well as the current frame. Also cover scalar argument slots in bpf_mark_all_scalars_precise(), so conservative fallback preserves the same invariant. Keep its existing ancestor-only traversal and leave pointer and uninitialized slots alone. AI assistance was used in preparing this patch. Fixes: 0f6bd5e7a804 ("bpf: Support stack arguments for bpf functions") Signed-off-by: Xu Yunxiang Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261102190350.788433-2-xyx2021@mail.ustc.edu.cn Signed-off-by: Sasha Levin commit 4373cf52166e170c8e4f24919240fbc6d8d346ab Author: Alexei Starovoitov Date: Sat Oct 31 21:55:35 2026 +0000 bpf: Emit timed may_goto for JITed progs only [ Upstream commit 1ddffb57b36239e84b8224b12e34b87f6031b29c ] The timed form of may_goto calls arch_bpf_timed_may_goto(). This function takes its argument and returns its result in BPF_REG_AX, in a register of the cpu. Only JITed code can call it. The verifier emits the timed form when the arch has a JIT that supports it. It does not look at the prog. With CONFIG_BPF_JIT_ALWAYS_ON=n the interpreter can run such a prog: the JIT is off, or it fails. The interpreter calls the function like a helper. The function takes what the C code left in that register for a pointer, and bpf_check_timed_may_goto() reads and writes through it. Emit the timed form only when the prog asks for a JIT, and make the JIT mandatory for such a prog. All other progs get the form that counts down from BPF_MAX_LOOPS. One test of verifier_may_goto_1 shows the insns of the timed form. Load it only when progs are JITed. Fixes: e723608bf428 ("bpf: Add verifier support for timed may_goto") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261031215543.682284-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit a5d89d6c1d1ca8084394400336dee8c3a98f0d3b Author: Kevin Dewald Date: Mon Nov 2 09:00:00 2026 -0800 Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery [ Upstream commit 60b10121db602a43ada3dbc39792bbf93d25991b ] Stop Discovery moves the discovery to DISCOVERY_STOPPING, and stop_discovery_complete() only moves it on to DISCOVERY_STOPPED when stopping succeeded. When it fails, for example because LE Set Scan Enable times out, nothing moves the discovery out of DISCOVERY_STOPPING: Stop Discovery is rejected, as the discovery is not active anymore, and the LE scan timeout was cancelled before the scan was disabled. Until the controller is powered off, every Start Discovery then fails with Busy, and hci_update_passive_scan_sync() skips background scanning, so devices set to auto-connect are not connected anymore. Move the discovery back to DISCOVERY_FINDING when stopping it failed while its inquiry or active LE scan is still running, so that it can be stopped again. Only change the state while the discovery is still stopping, as Inquiry Cancel may already have stopped it, for example when only the passive scan could not be disabled, and a new Start Discovery may have followed. Do this under hci_dev_lock(), like the command completions that change these flags, and before replying, so that a client acting on the reply sees the new state. Only cancel the LE scan timeout once the scan is disabled, so that the discovery still ends on its own, except when suspending, where it is still cancelled first. A timed out LE Set Scan Enable can still complete afterwards, which cancels the timeout as well, so also stop the discovery when its scan is disabled while the timeout is pending, or while the timeout work waits for the lock. Fixes: 0e05bba6f6f8 ("Bluetooth: Update stop_discovery to use HCI request") Assisted-by: Claude:claude-opus-5.5 Signed-off-by: Kevin Dewald Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 3ecf360ec91ddc6c924d48b8b6e9fed35a2c9d20 Author: Yifan Zhang Date: Mon Nov 2 19:58:37 2026 +0800 Bluetooth: validate retained LE Set CIG Parameters command length [ Upstream commit ed4d302af778b9e2ead28134a2196c09a4ad248a ] hci_cc_le_set_cig_params() validates the controller response but not the parameters of the previously sent command. A short command can claim a large num_cis without containing the corresponding cis[] array. A complete successful response then makes the handler read beyond the command skb while looking up each CIS ID. KASAN reports: BUG: KASAN: slab-out-of-bounds in hci_cc_le_set_cig_params Read of size 1 hci_cc_le_set_cig_params hci_cmd_complete_evt hci_event_packet Obtain the retained parameter length and require both the fixed header and the complete CIS array before using the command data. The reproducer no longer triggers a KASAN report with this change. Fixes: 71e9588435c3 ("Bluetooth: ISO: use correct CIS order in Set CIG Parameters event") Closes: https://lore.kernel.org/linux-bluetooth/179317463153.87610.8996555110609321376@stu.pku.edu.cn/ Signed-off-by: Yifan Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit fd56be1b68e9811f710cb0e23989c2bcb352570b Author: Yifan Zhang Date: Mon Nov 2 19:58:37 2026 +0800 Bluetooth: validate retained LE Create CIS command length [ Upstream commit 1eb52f35fc8fb06ab7f2973fff29cba81f96b947 ] hci_cs_le_create_cis() retrieves the parameters of the previously sent command without their length. It then trusts num_cis and walks the flexible cis[] array when a controller reports a failed command. A five-byte HCI command containing only num_cis can therefore make the handler read beyond the command skb. KASAN reports: BUG: KASAN: slab-out-of-bounds in hci_cs_le_create_cis Read of size 2 hci_cs_le_create_cis hci_cmd_status_evt hci_event_packet Add a length-returning saved-command helper and require the fixed header and complete CIS array before walking it. The reproducer no longer triggers a KASAN report with this change. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Closes: https://lore.kernel.org/linux-bluetooth/179317462624.87574.6271582002629080499@stu.pku.edu.cn/ Signed-off-by: Yifan Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 1b8a7dcd921603b1aa206be54cec42e2a45b31e8 Author: Cen Zhang Date: Fri Oct 30 22:27:45 2026 +0800 Bluetooth: hci_core: Initialize advertising RPA work only once [ Upstream commit a7c5c18b7cc30dcd2a9ae5a0fb38378d3998417e ] hci_add_adv_instance() also updates existing instances and calls INIT_DELAYED_WORK() on their rpa_expired_cb every time, even when the work is pending or running. cancel_delayed_work_sync() then no longer finds the work, so hci_remove_adv_instance() can free the instance under it: hdev->workqueue MGMT_OP_ADD_EXT_ADV_PARAMS adv_instance_rpa_expired() hci_dev_lock(hdev) hci_add_adv_instance() INIT_DELAYED_WORK() mgmt_pending_new() fails hci_remove_adv_instance() cancel_delayed_work_sync() returns without waiting kfree(adv) hci_dev_unlock(hdev) adv->rpa_expired = true The work has been initialized on every update since it was added. Initialize it only when the instance is allocated. KASAN report as below: BUG: KASAN: slab-use-after-free in adv_instance_rpa_expired+0x139/0x160 Write of size 1 at addr ffff888108d84b2e by task kworker/u17:0/504 Workqueue: hci0 adv_instance_rpa_expired Call Trace: adv_instance_rpa_expired+0x139/0x160 Allocated by task 560: hci_add_adv_instance+0x68d/0x9d0 add_ext_adv_params+0x4d4/0xb60 hci_sock_sendmsg+0x128b/0x22e0 Freed by task 594: kfree+0x307/0x580 hci_remove_adv_instance+0x230/0x540 add_ext_adv_params+0xa43/0xb60 hci_sock_sendmsg+0x128b/0x22e0 Last potentially related work creation: insert_work+0x37/0x210 __queue_work+0xaba/0x1270 call_timer_fn+0x171/0x500 The buggy address belongs to the object at ffff888108d84800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 814 bytes inside of freed 1024-byte region [ffff888108d84800, ffff888108d84c00) Fixes: a73c046a2869 ("Bluetooth: Implement Set ADV set random address") Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 98a7bce33a513c549b723f5fc7b2756b229e6ccd Author: Kevin Dewald Date: Thu Oct 29 13:28:32 2026 -0700 Bluetooth: MGMT: Clear disabled connection parameters when loading none [ Upstream commit d90f24dc389b9a7524aaac109021d1530fa180f0 ] Load Connection Parameters only clears the disabled connection parameters when it loads more than one entry, so that loading a single entry can update the parameters of one device without dropping the others. Loading no entries does not clear them either, though, which is what bluetoothd does when it starts without stored connection parameters. Pair Device adds disabled connection parameters for the device it pairs with, so these now survive bluetoothd restarts, and new connections to the device keep using the parameters they were created with instead of the defaults set since, e.g. the connection interval from main.conf. Clear the disabled connection parameters unless a single entry is loaded, as was done for any number of entries before. Fixes: 0ece498c27d8 ("Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection") Assisted-by: Claude:claude-opus-5.5 Signed-off-by: Kevin Dewald Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 3107440d0fd075c6a12292421cd970454ab95dd7 Author: Cen Zhang Date: Thu Oct 29 21:12:29 2026 +0800 Bluetooth: hci_sync: Copy the resolving-list IRK under RCU [ Upstream commit 9ff737119177a6c1ce6083ef8c0fc06355f11869 ] hci_le_add_resolve_list_sync() copies the peer IRK into the LE Add Device To Resolving List command after hci_find_irk_by_addr() has returned. The finder ends its RCU read-side section before returning the borrowed entry, and neither the request worker nor interleave_scan_work() holds hdev->lock here. The resolving-list membership check between the lookup and the copy takes hdev->lock and may sleep on it, which widens the window. When LL privacy programs a peer with address resolution enabled, MGMT_OP_LOAD_IRKS can free its IRK before the copy: Request worker Management / RCU reclamation hci_le_add_resolve_list_sync() irk = hci_find_irk_by_addr() load_irks() hci_dev_lock(hdev) hci_smp_irks_clear(hdev) list_del_rcu(), kfree_rcu() hci_dev_unlock(hdev) grace period ends, irk is freed resolving-list membership check memcpy(cp.peer_irk, irk->val, 16) Copy the IRK value in an RCU read-side section right after the lookup, as hci_le_set_privacy_mode_sync() does for the identity address. The section ends before hdev->lock is taken and before the synchronous HCI command is sent. KASAN reported this on a test kernel with scheduling hooks, whose frames appear in the trace. The report predates the hdev->lock taken by the membership check. KASAN report as below: ================================================================== BUG: KASAN: slab-use-after-free in hci_le_add_resolve_list_sync+0x8d9/0x910 Read of size 16 at addr ffff88810d21452d by task kworker/u17:0/504 CPU: 2 UID: 0 PID: 504 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #2 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: hci0 interleave_scan_work Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? hci_le_add_resolve_list_sync+0x8d9/0x910 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20d/0x410 ? hci_le_add_resolve_list_sync+0x8d9/0x910 kasan_report+0xe0/0x110 ? hci_le_add_resolve_list_sync+0x8d9/0x910 hci_le_add_resolve_list_sync+0x8d9/0x910 ? __pfx_hci_le_add_resolve_list_sync+0x10/0x10 ? pmbd_probe_hit_cookie+0xe7/0x1c0 ? srso_alias_return_thunk+0x5/0xfbef5 ? pmbd_probe_hit_cookie+0xee/0x1c0 ? __pfx_pmbd_probe_hit_cookie+0x10/0x10 hci_le_add_accept_list_sync+0x18e/0x820 ? conn_params_copy+0x36e/0x650 ? __pfx_hci_le_add_accept_list_sync+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? conn_params_copy+0x3a0/0x650 hci_passive_scan_sync+0x95f/0x1f10 ? __pfx_hci_passive_scan_sync+0x10/0x10 ? debug_object_deactivate+0x2f8/0x3c0 ? pwq_dec_nr_in_flight+0x880/0xdf0 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0x17b/0x2f0 ? process_one_work+0x895/0x19c0 interleave_scan_work+0x11b/0x470 process_one_work+0x908/0x19c0 ? __pfx_process_one_work+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 worker_thread+0x65c/0xe40 ? __pfx_worker_thread+0x10/0x10 kthread+0x34f/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf80 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 535: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x251/0x610 hci_add_irk+0xb6/0x220 load_irks+0x5f9/0x840 hci_sock_sendmsg+0x128b/0x22e0 __sys_sendto+0x425/0x470 __x64_sys_sendto+0xe5/0x1c0 do_syscall_64+0x115/0x6a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 0: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 __rcu_free_sheaf_prepare+0x65/0x2a0 rcu_free_sheaf+0x1f/0xe0 rcu_core+0x661/0x1d10 handle_softirqs+0x201/0x930 __irq_exit_rcu+0x110/0x1e0 irq_exit_rcu+0xe/0x20 sysvec_apic_timer_interrupt+0x6c/0x80 asm_sysvec_apic_timer_interrupt+0x1a/0x20 The buggy address belongs to the object at ffff88810d214500 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 45 bytes inside of freed 64-byte region [ffff88810d214500, ffff88810d214540) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d214 flags: 0x200000000000000(node=0|zone=2) page_type: f5(slab) raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810d214400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810d214480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810d214500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810d214580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810d214600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 82e4991c747bf17247795d579a768e29b9d623f0 Author: Cen Zhang Date: Thu Oct 29 21:12:28 2026 +0800 Bluetooth: SMP: Protect LTK encryption with RCU [ Upstream commit add463a65802bb117e4a17b8c00d747fa70399fc ] smp_ltk_encrypt() checks the security level of the LTK returned by hci_find_ltk() and then starts encryption with its EDIV, Rand, value and key size. The finder ends its RCU read-side section before returning the borrowed entry, and neither caller holds hdev->lock: the SMP Security Request handler runs from the receive path, and setsockopt(BT_SECURITY) reaches smp_conn_security() with only the socket and channel locks held. MGMT_OP_LOAD_LONG_TERM_KEYS can therefore free the LTK in between: Socket security request Management / RCU reclamation smp_ltk_encrypt() key = hci_find_ltk() load_long_term_keys() hci_dev_lock(hdev) hci_smp_ltks_clear(hdev) list_del_rcu(), kfree_rcu() hci_dev_unlock(hdev) grace period ends, key is freed smp_ltk_sec_level(key) hci_le_start_enc(hcon, key->ediv, key->rand, key->val, ...) Keep an RCU read-side section across the lookup and every use of the key. hci_le_start_enc() copies the key into the command and queues it with a GFP_ATOMIC allocation, so the whole sequence can stay inside the section. KFENCE reported this on a test kernel where the socket thread was paused after the lookup until the RCU callback had freed the key. KFENCE report as below: ================================================================== BUG: KFENCE: use-after-free read in smp_ltk_encrypt.isra.0+0xf3/0x370 Use-after-free read at 0x00000000c45332eb (in kfence-#128): smp_ltk_encrypt.isra.0+0xf3/0x370 smp_conn_security+0x489/0x9d0 l2cap_sock_setsockopt+0x1bbe/0x2300 do_sock_setsockopt+0x1fb/0x430 __sys_setsockopt+0x106/0x180 __x64_sys_setsockopt+0xc2/0x160 do_syscall_64+0x115/0x6a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f kfence-#128: 0x00000000d45af9b0-0x0000000053c1365e, size=72, cache=kmalloc-96 allocated by task 533 on cpu 0 at 50.484258s (0.449177s ago): hci_add_ltk+0x1f5/0x3a0 load_long_term_keys+0x6ea/0x930 hci_sock_sendmsg+0x128b/0x22e0 sock_write_iter+0x4c0/0x550 vfs_write+0x637/0x1010 ksys_write+0x1b7/0x200 do_syscall_64+0x115/0x6a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f freed by task 0 on cpu 0 at 50.846944s (0.093664s ago): __rcu_free_sheaf_prepare+0x261/0x2a0 rcu_free_sheaf_nobarn+0x1d/0x50 rcu_core+0x661/0x1d10 handle_softirqs+0x201/0x930 __irq_exit_rcu+0x110/0x1e0 irq_exit_rcu+0xe/0x20 sysvec_apic_timer_interrupt+0x6c/0x80 asm_sysvec_apic_timer_interrupt+0x1a/0x20 pv_native_safe_halt+0xf/0x20 default_idle+0x9/0x10 default_idle_call+0x6c/0xb0 do_idle+0x3a7/0x650 cpu_startup_entry+0x54/0x60 rest_init+0x15e/0x2b0 start_kernel+0x412/0x4b0 x86_64_start_reservations+0x18/0x30 x86_64_start_kernel+0x111/0x120 common_startup_64+0x13e/0x158 CPU: 2 UID: 0 PID: 534 Comm: l2cap-ltk-actor Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #5 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 ================================================================== Fixes: 988c5997d320 ("Bluetooth: Use the LTK after receiving a LE Security Request") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit d4c257ffbad059e17eed623bf84708793fe0fc55 Author: Cen Zhang Date: Thu Oct 29 21:12:27 2026 +0800 Bluetooth: SMP: Protect link keys during LTK derivation [ Upstream commit ebc4f217c1fbe8364b5ef2ad8e3a8e9a1b2701a7 ] sc_generate_ltk() reads the type and value of the peer link key after hci_find_link_key() has returned. The finder ends its RCU read-side section before returning the borrowed entry, and the SMP receive path does not hold hdev->lock: l2cap_recv_acldata() releases it before the PDU is dispatched. The L2CAP connection and channel locks held by SMP do not serialize with management link-key removal. When BR/EDR Secure Connections pairing derives an LTK from the stored link key, MGMT_OP_LOAD_LINK_KEYS can free that key mid-derivation: HCI RX worker (SMP) Management / RCU reclamation sc_generate_ltk() key = hci_find_link_key() load_link_keys() hci_dev_lock(hdev) hci_link_keys_clear(hdev) list_del_rcu(), kfree_rcu() hci_dev_unlock(hdev) grace period ends, key is freed read key->type smp_h6() or smp_h7() reads key->val Hold an RCU read-side section from the lookup until the type and value have been consumed. smp_h6() and smp_h7() only run the synchronous AES-CMAC library code, which neither sleeps nor allocates. Release the section before sc_add_ltk(), which allocates with GFP_KERNEL. KASAN reported this on a test kernel whose scheduling hook paused the receive worker after the lookup; the hook frames appear in the trace. KASAN report as below: ================================================================== BUG: KASAN: slab-use-after-free in smp_distribute_keys+0x2983/0x2b70 Read of size 1 at addr ffff88810618e9a6 by task kworker/u17:0/500 CPU: 0 UID: 0 PID: 500 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: hci1 hci_rx_work Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? smp_distribute_keys+0x2983/0x2b70 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20d/0x410 ? smp_distribute_keys+0x2983/0x2b70 kasan_report+0xe0/0x110 ? smp_distribute_keys+0x2983/0x2b70 smp_distribute_keys+0x2983/0x2b70 ? __pfx_smp_distribute_keys+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? pmbd_gate_maybe+0x47/0x60 ? srso_alias_return_thunk+0x5/0xfbef5 ? pmbd_probe_hit_cookie+0xe7/0x1c0 ? srso_alias_return_thunk+0x5/0xfbef5 ? pmbd_probe_hit_cookie+0xee/0x1c0 ? __pfx_pmbd_probe_hit_cookie+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __asan_memset+0x23/0x50 ? smp_recv_cb+0x12e2/0x8f30 ? srso_alias_return_thunk+0x5/0xfbef5 smp_recv_cb+0x12e2/0x8f30 ? __pfx_smp_recv_cb+0x10/0x10 ? __pfx___might_resched+0x10/0x10 ? __pfx_sched_balance_find_src_group+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_lock+0x182c/0x2590 ? l2cap_recv_frame+0x9ef/0x8830 ? __pfx___mutex_lock+0x10/0x10 ? __lock_acquire+0x466/0x2260 ? __pfx_l2cap_chan_hold_unless_zero+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? l2cap_recv_frame+0x13cc/0x8830 ? __pfx_smp_recv_cb+0x10/0x10 l2cap_recv_frame+0x13cc/0x8830 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_lock+0x182c/0x2590 ? __pfx_l2cap_recv_frame+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? find_held_lock+0x2b/0x80 ? l2cap_recv_acldata+0x1eb/0x10e0 ? __pfx___mutex_lock+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_unlock_slowpath+0x147/0x920 ? __pfx_l2cap_conn_hold_unless_zero+0x10/0x10 ? __pfx_hci_conn_enter_active_mode+0x10/0x10 ? l2cap_recv_acldata+0x13d/0x10e0 ? srso_alias_return_thunk+0x5/0xfbef5 l2cap_recv_acldata+0xe9f/0x10e0 ? srso_alias_return_thunk+0x5/0xfbef5 hci_rx_work+0x5a6/0xf00 ? srso_alias_return_thunk+0x5/0xfbef5 process_one_work+0x908/0x19c0 ? __pfx_process_one_work+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 worker_thread+0x65c/0xe40 ? __pfx_worker_thread+0x10/0x10 kthread+0x34f/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf80 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 500: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x251/0x610 hci_add_link_key+0x474/0x840 hci_link_key_notify_evt+0x492/0xce0 hci_event_packet+0x894/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 Freed by task 0: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 __rcu_free_sheaf_prepare+0x65/0x2a0 rcu_free_sheaf+0x1f/0xe0 rcu_core+0x661/0x1d10 handle_softirqs+0x201/0x930 __irq_exit_rcu+0x110/0x1e0 irq_exit_rcu+0xe/0x20 sysvec_apic_timer_interrupt+0x6c/0x80 asm_sysvec_apic_timer_interrupt+0x1a/0x20 The buggy address belongs to the object at ffff88810618e980 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 38 bytes inside of freed 64-byte region [ffff88810618e980, ffff88810618e9c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10618e flags: 0x200000000000000(node=0|zone=2) page_type: f5(slab) raw: 0200000000000000 ffff8881000428c0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810618e880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810618e900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810618e980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810618ea00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810618ea80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== Fixes: b5ae344d4c0f ("Bluetooth: Add full SMP BR/EDR support") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f30f763d43ffa614e431d8733bb6f8460f14cab0 Author: Cen Zhang Date: Thu Oct 29 21:12:26 2026 +0800 Bluetooth: hci_core: Keep link-key filtering inside RCU [ Upstream commit 281ddc4e01ab54cab07995f2a1b72cf81bf90eb5 ] hci_find_link_key() must keep the matching link key allocated while it checks the key against the blocked-key list. It currently leaves the key-list RCU read-side section before passing k->val to hci_is_blocked_key(). That helper's own RCU section protects the blocked-key list, but it cannot keep an unlinked link key from being reclaimed. The SMP receive path calls the finder without hdev->lock: Secure Connections key distribution over BR/EDR reaches it through smp_distribute_keys() and sc_generate_ltk(). With a stored peer link key and a link-key entry in the blocked-key list, MGMT_OP_LOAD_LINK_KEYS can free the selected key before the comparison: HCI RX worker (SMP) Management / RCU reclamation hci_find_link_key() rcu_read_lock() select k rcu_read_unlock() load_link_keys() hci_dev_lock(hdev) hci_link_keys_clear(hdev) list_del_rcu(), kfree_rcu() hci_dev_unlock(hdev) grace period ends, k is freed hci_is_blocked_key(hdev, ..., k->val) memcmp() reads the freed key Keep the RCU read-side section active through the blocked-key comparison and the warning that prints k->bdaddr, and release it before returning on both matched-key paths. hci_find_ltk() already handles its blocked-key check this way. KASAN reported this on a test kernel whose scheduling hook paused the receive worker after the lookup until the key had been freed. KASAN report as below: ================================================================== BUG: KASAN: slab-use-after-free in hci_is_blocked_key+0x2db/0x300 Read of size 1 at addr ffff88810b5f89a7 by task kworker/u17:0/502 CPU: 1 UID: 0 PID: 502 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #5 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: hci1 hci_rx_work Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? hci_is_blocked_key+0x2db/0x300 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20d/0x410 ? hci_is_blocked_key+0x2db/0x300 kasan_report+0xe0/0x110 ? hci_is_blocked_key+0x2db/0x300 hci_is_blocked_key+0x2db/0x300 hci_find_link_key+0x12e/0x400 smp_distribute_keys+0x1830/0x2950 ? trace_hardirqs_on+0x18/0x160 ? srso_alias_return_thunk+0x5/0xfbef5 ? queue_delayed_work_on+0xb3/0xf0 ? __pfx_smp_distribute_keys+0x10/0x10 ? __pfx_smp_send_cmd.isra.0+0x10/0x10 ? __cancel_work+0x1b0/0x290 ? __entry_text_end+0x1020f7/0x1020f9 ? lockdep_hardirqs_on_prepare+0xea/0x1a0 ? srso_alias_return_thunk+0x5/0xfbef5 ? __asan_memset+0x23/0x50 ? smp_recv_cb+0x12c7/0x8d80 ? srso_alias_return_thunk+0x5/0xfbef5 smp_recv_cb+0x12c7/0x8d80 ? __pfx_smp_recv_cb+0x10/0x10 ? __pfx___might_resched+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? stack_depot_save_flags+0x29/0x9a0 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_lock+0x182c/0x2590 ? kasan_save_stack+0x42/0x60 ? l2cap_recv_frame+0x9ef/0x8830 ? __kasan_slab_free+0x5f/0x80 ? kmem_cache_free+0x242/0x580 ? kfree_skbmem+0x15e/0x1d0 ? sk_skb_reason_drop+0x12f/0x490 ? hci_event_packet+0x556/0xc70 ? hci_rx_work+0x367/0xf00 ? process_one_work+0x908/0x19c0 ? worker_thread+0x65c/0xe40 ? __pfx___mutex_lock+0x10/0x10 ? __lock_acquire+0x466/0x2260 ? __pfx_l2cap_chan_hold_unless_zero+0x10/0x10 ? l2cap_recv_frame+0x13cc/0x8830 ? __pfx_smp_recv_cb+0x10/0x10 l2cap_recv_frame+0x13cc/0x8830 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_lock+0x182c/0x2590 ? __pfx_l2cap_recv_frame+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? find_held_lock+0x2b/0x80 ? l2cap_recv_acldata+0x1eb/0x10e0 ? __pfx___mutex_lock+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __mutex_unlock_slowpath+0x147/0x920 ? __pfx_l2cap_conn_hold_unless_zero+0x10/0x10 ? __pfx_hci_conn_enter_active_mode+0x10/0x10 ? l2cap_recv_acldata+0x13d/0x10e0 ? srso_alias_return_thunk+0x5/0xfbef5 l2cap_recv_acldata+0xe9f/0x10e0 ? srso_alias_return_thunk+0x5/0xfbef5 hci_rx_work+0x5a6/0xf00 ? srso_alias_return_thunk+0x5/0xfbef5 process_one_work+0x908/0x19c0 ? __pfx_process_one_work+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 worker_thread+0x65c/0xe40 ? __pfx_worker_thread+0x10/0x10 kthread+0x34f/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf80 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 504: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x251/0x610 hci_add_link_key+0x474/0x840 hci_link_key_notify_evt+0x492/0xce0 hci_event_packet+0x894/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 Freed by task 29: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 __rcu_free_sheaf_prepare+0x65/0x2a0 rcu_free_sheaf_nobarn+0x1d/0x50 rcu_core+0x661/0x1d10 handle_softirqs+0x201/0x930 run_ksoftirqd+0x33/0x60 smpboot_thread_fn+0x3bd/0x9a0 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 The buggy address belongs to the object at ffff88810b5f8980 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 39 bytes inside of freed 64-byte region [ffff88810b5f8980, ffff88810b5f89c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b5f8 flags: 0x200000000000000(node=0|zone=2) page_type: f5(slab) raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810b5f8880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810b5f8900: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff88810b5f8980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810b5f8a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810b5f8a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== Fixes: 600a87490ff9 ("Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 3a1e4350f4a31391775cc7294fb916c4f7bdc284 Author: Ismail Tarim Date: Fri Oct 30 01:40:15 2026 +0300 Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() [ Upstream commit 3b70dd827b27bfadd89e7b1a2d422b04da38797c ] btmtk_usb_isointf_init() submits the ISO interrupt IN URB and then sends the vendor command 0xfd98. If that command fails, the function returns an error without killing the URB it has just submitted. The caller then leaves BTMTK_ISOPKT_RUNNING clear, so the driver treats the ISO path as inactive while its RX URB is still in flight, and btmtk_usb_suspend() skips killing it. Kill the anchored URBs on this path, as the URB submission failure path already does. The return value of __set_mtk_intr_interface() is also ignored: a failure to select the ISO alternate setting or to find its endpoints is logged, but the function goes on to submit the URB. Return the error instead. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Signed-off-by: Ismail Tarim Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 4ff26acdf4f67010c7777edd81976dabd6fb65ae Author: Tobias Wilken Date: Wed Oct 21 08:58:33 2026 +0200 Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller [ Upstream commit 7eac80614300563470cffabf4df2b63616787ee7 ] Since MGMT_OP_SET_POWERED runs through hci_cmd_sync, powering on a controller that is blocked by rfkill fails with -ERFKILL from hci_dev_open_sync(), and mgmt_set_powered_complete() reports it with mgmt_status(err). mgmt_errno_status() has no case for -ERFKILL, so userspace gets MGMT_STATUS_FAILED instead of MGMT_STATUS_RFKILLED. Before that conversion, power on went through hci_power_on(), whose error path mgmt_set_powered_failed() still maps -ERFKILL to MGMT_STATUS_RFKILLED. bluetoothd relies on that status: for RFKILLED it sets the adapter PowerState to "off-blocked" and returns org.bluez.Error.Blocked for the Powered property, for any other status it returns org.bluez.Error.Failed. With the controller soft blocked, "bluetoothctl power on" printed "Failed to set power on: org.bluez.Error.Failed" and btmon showed "Set Powered (0x0005) Status: Failed (0x03)". With this change it prints org.bluez.Error.Blocked and btmon shows "Status: RFKilled (0x12)". Map -ERFKILL to MGMT_STATUS_RFKILLED in mgmt_errno_status(). Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Assisted-by: LLM Signed-off-by: Tobias Wilken Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit d5fed67b97fa3ab5b2f7a92038d176b3600cb2f1 Author: Shuai Zhang Date: Tue Aug 18 19:41:16 2026 +0800 Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping [ Upstream commit c0bb764fc082672678d371c375597a6a9f614cf9 ] The kernel sets HCI_AUTO_OFF when a controller is first registered and starts a 2-second timer. On slower boots bluetoothd and the HCI_AUTO_OFF timer can race: hci_power_off() is already queued while bluetoothd is still in the middle of its adapter setup sequence. hci_cmd_sync_clear() then cancels any pending mgmt commands with -ECANCELED, including the MGMT_OP_REMOVE_ADV_MONITOR sent by reset_adv_monitors() early in the setup sequence. When auto_off=1, hci_dev_close_sync() skips __mgmt_power_off() entirely, so there is no fallback path to reply to the cancelled commands. mgmt_remove_adv_monitor_complete() silently returns on -ECANCELED, leaving the command with no reply. Since bluez's mgmt queue is strictly serialised, this stalls all subsequent commands indefinitely, leaving bluetoothd unable to register the adapter. Fix by mapping -ECANCELED to MGMT_STATUS_CANCELLED in mgmt_errno_status() and replying to the cancelled command in mgmt_remove_adv_monitor_complete() instead of returning early. Signed-off-by: Shuai Zhang Signed-off-by: Luiz Augusto von Dentz Stable-dep-of: 7eac80614300 ("Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller") Signed-off-by: Sasha Levin commit 553700d685448f63f2d50622b68f1dff81e0bdf8 Author: Cen Zhang Date: Thu Oct 22 20:05:56 2026 +0800 Bluetooth: hci_sync: Protect resolving-list lookups [ Upstream commit f05bd61a3213613de7848c8df2865492d5225023 ] The host resolving list is updated under hdev->lock, and each bdaddr_list_with_irk entry must remain alive throughout a lookup. hci_le_del_resolve_list_sync() and hci_le_add_resolve_list_sync() traverse that list without taking the lock. On an LE privacy-capable controller with a programmed entry, passive scan reconciliation can reach hci_le_del_resolve_list_sync() while a privileged HCI_RAW client sends LE Clear Resolving List. The raw command does not take req_lock, and its successful completion runs on the controller workqueue independently of request work: Request work Raw HCI / event work hci_le_del_resolve_list_sync() lookup loads a list node hci_sock_sendmsg() queue LE Clear Resolving List hci_cc_le_clear_resolv_list() take hdev->lock unlink and free the node release hdev->lock read the node's address/type The clear can free the node after the lookup loads it and before its address/type read, causing a use-after-free. The report below shows this access with the delete helper on the faulting stack. The add helper uses the same unprotected lookup. Take hdev->lock around each resolving-list membership lookup and retain only a boolean result. This serializes traversal with clear completion and keeps entry pointers inside the protected section. Release the lock before issuing a synchronous HCI command, whose completion also needs the lock. KASAN report as below: ================================================================== BUG: KASAN: slab-use-after-free in hci_bdaddr_list_lookup_with_irk+0x106/0x120 Read of size 1 at addr ffff88810b036e16 by task kworker/u17:0/495 CPU: 2 UID: 0 PID: 495 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #3 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: hci0 hci_cmd_sync_work Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? hci_bdaddr_list_lookup_with_irk+0x106/0x120 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20d/0x410 ? hci_bdaddr_list_lookup_with_irk+0x106/0x120 kasan_report+0xe0/0x110 ? hci_bdaddr_list_lookup_with_irk+0x106/0x120 hci_bdaddr_list_lookup_with_irk+0x106/0x120 hci_le_del_resolve_list_sync.isra.0+0xd6/0x3f0 ? __pfx_hci_le_del_resolve_list_sync.isra.0+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 hci_le_del_accept_list_sync.isra.0+0x11c/0x290 ? __pfx_hci_le_del_accept_list_sync.isra.0+0x10/0x10 ? hci_passive_scan_sync+0x551/0x1e80 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x280 hci_passive_scan_sync+0x71c/0x1e80 ? __pfx_hci_passive_scan_sync+0x10/0x10 ? find_held_lock+0x2b/0x80 ? hci_lookup_le_connect+0xe1/0x3c0 ? srso_alias_return_thunk+0x5/0xfbef5 ? find_held_lock+0x2b/0x80 ? hci_update_passive_scan_sync+0x437/0x950 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x280 hci_update_passive_scan_sync+0x461/0x950 hci_cmd_sync_work+0x1b3/0x450 ? srso_alias_return_thunk+0x5/0xfbef5 process_one_work+0x908/0x19c0 ? __pfx_process_one_work+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 worker_thread+0x65c/0xe40 ? __pfx_worker_thread+0x10/0x10 kthread+0x34f/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf80 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 495: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x251/0x610 hci_bdaddr_list_add_with_irk+0x183/0x3e0 hci_cc_le_add_to_resolv_list+0x18c/0x240 hci_cmd_complete_evt+0x373/0xab0 hci_event_packet+0x4e8/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 Freed by task 497: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 kfree+0x307/0x580 hci_bdaddr_list_clear+0x134/0x230 hci_cc_le_clear_resolv_list+0x13d/0x240 hci_cmd_complete_evt+0x373/0xab0 hci_event_packet+0x4e8/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 The buggy address belongs to the object at ffff88810b036e00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 22 bytes inside of freed 64-byte region [ffff88810b036e00, ffff88810b036e40) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b036 flags: 0x200000000000000(node=0|zone=2) page_type: f5(slab) raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810b036d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88810b036d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810b036e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810b036e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810b036f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== Disabling lock debugging due to kernel taint Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f18a5502805a29ce6a0d314031a83a4d3869483d Author: Cen Zhang Date: Thu Oct 22 20:16:36 2026 +0800 Bluetooth: hci_sync: Copy the LE accept list under hdev->lock [ Upstream commit 674006912777747170ad70d7727804ad4f2d047f ] The LE accept-list mirror consists of bdaddr_list entries that are added, removed and freed under hdev->lock. The ordinary branch of hci_update_accept_list_sync() traverses this list without that lock. The request worker's req_lock does not serialize raw HCI completions, and the RCU sections protect connection and pending-action lookups, not the accept-list nodes. Changing connectability can reach this iterator through set_connectable_sync(), hci_update_connectable_sync(), hci_update_passive_scan_sync() and hci_passive_scan_sync(). With a populated mirror, a privileged raw HCI sender can issue HCI_OP_LE_CLEAR_ACCEPT_LIST while request work is reconciling it: Request work HCI event work select b and successor t hci_cc_le_clear_accept_list() hci_dev_lock(hdev) hci_bdaddr_list_clear() unlink nodes and kfree(b) hci_dev_unlock(hdev) read b->bdaddr_type The clear completion can therefore free the selected node before its field read, or the saved successor before the iterator advances. KASAN reported a one-byte read of bdaddr_type from the freed node. Copy each entry's address and type under hdev->lock and reconcile the private array instead. Release the mutex before issuing synchronous commands, since their completion handlers also acquire it. Free the copy after iteration and use the existing error path to disable accept-list filtering if allocation fails. This change has not been runtime-tested. KASAN report as below: ================================================================== BUG: KASAN: slab-use-after-free in hci_passive_scan_sync+0x1cc4/0x1f80 Read of size 1 at addr ffff888105ee6c56 by task kworker/u17:1/499 Workqueue: hci0 hci_cmd_sync_work Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? hci_passive_scan_sync+0x1cc4/0x1f80 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20d/0x410 ? hci_passive_scan_sync+0x1cc4/0x1f80 kasan_report+0xe0/0x110 ? hci_passive_scan_sync+0x1cc4/0x1f80 hci_passive_scan_sync+0x1cc4/0x1f80 ? pmbd_gate_site_armed+0x31/0x1c0 ? __pfx_hci_passive_scan_sync+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? pmbd_probe_hit_cookie+0x10/0x1c0 ? __pfx_pmbd_probe_hit_cookie+0x10/0x10 ? hci_update_passive_scan_sync+0x43f/0x9e0 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x280 hci_update_passive_scan_sync+0x473/0x9e0 hci_update_connectable_sync+0x13c/0x250 set_connectable_sync+0x39/0xb0 hci_cmd_sync_work+0x1b3/0x450 ? srso_alias_return_thunk+0x5/0xfbef5 process_one_work+0x908/0x19c0 ? __pfx_process_one_work+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 worker_thread+0x65c/0xe40 ? __pfx_worker_thread+0x10/0x10 kthread+0x34f/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf80 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 511: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x251/0x610 hci_bdaddr_list_add+0x179/0x390 hci_cc_le_add_to_accept_list+0x189/0x2d0 hci_cmd_complete_evt+0x373/0xab0 hci_event_packet+0x4e8/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 Freed by task 511: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 kfree+0x307/0x580 hci_bdaddr_list_clear+0x134/0x230 hci_cc_le_clear_accept_list+0x80/0x1f0 hci_cmd_complete_evt+0x373/0xab0 hci_event_packet+0x4e8/0xc70 hci_rx_work+0x367/0xf00 process_one_work+0x908/0x19c0 worker_thread+0x65c/0xe40 kthread+0x34f/0x460 ret_from_fork+0x659/0x940 ret_from_fork_asm+0x1a/0x30 The buggy address belongs to the object at ffff888105ee6c40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 22 bytes inside of freed 32-byte region [ffff888105ee6c40, ffff888105ee6c60) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888105ee69c0 pfn:0x105ee6 flags: 0x200000000000200(workingset|node=0|zone=2) page_type: f5(slab) raw: 0200000000000200 ffff888100042780 ffffea0004187150 ffffea00042534d0 raw: ffff888105ee69c0 000000000040003f 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888105ee6b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888105ee6b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff888105ee6c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff888105ee6c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888105ee6d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ================================================================== Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3") Assisted-by: LLM Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 1f29c19894159355ece978fa0d2be004f8e2db95 Author: Chris Lu Date: Thu Oct 22 11:21:50 2026 +0800 Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD [ Upstream commit 855c9a54608f1e94f4c52afe3790def30534155a ] The ISO data transfer size is spelled out twice: as a raw byte pair in the vendor command sent by btmtk_usb_isointf_init(), and as MTK_ISO_THRESHOLD for the padding in btmtk_isopkt_pad(). Build the command payload from the macro so the size is stated once, and update the setting for current MediaTek controllers. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Signed-off-by: Chris Lu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 5a2513f719d0777c78e923b3349c98742e67a2df Author: Chris Lu Date: Thu Oct 22 11:21:49 2026 +0800 Bluetooth: btmtk: bound the ISO payload length by the controller's MTU [ Upstream commit d015faf684129a276f2137ad2e11c6c985294648 ] btmtk_recv_isopkt() bounds the Data_Total_Length reported by the controller with skb_tailroom(skb) < hci_skb_expect(skb). That keeps the reassembly inside the skb, but it enforces no protocol limit: the head allocation is rounded up to the next kmalloc bucket and skb_tailroom() reports what the bucket can hold rather than what was requested, which is several hundred bytes more. An oversized length therefore passes, and the parser keeps pulling bytes out of the following transfers to fill it, swallowing the real ISO packets they carry until the frame is handed to hci_recv_frame(). The controller reports the largest ISO_Data_Packet_Length it will send in LE Read Buffer Size [v2], which hci_cc_le_read_buffer_size_v2() keeps in hdev->iso_mtu. Once that is available, bound the length by it and size the receive skb to hold that much plus the 4-byte header. HCI_MAX_ISO_SIZE is kept only as a fallback for the window before the command completes. Keep the skb_tailroom() test as well, because a fragment started before hdev->iso_mtu was populated sits in an skb sized for the fallback. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Co-developed-by: Hao Qin Signed-off-by: Hao Qin Co-developed-by: Wenlong Tian Signed-off-by: Wenlong Tian Signed-off-by: Chris Lu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit d94dcbdeb868dada11c86a6c87899f6e7ab45027 Author: Chris Lu Date: Thu Oct 22 11:21:48 2026 +0800 Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding [ Upstream commit 8524c3588fbb9d5c1b876e6f908c42926845650d ] The ISO interrupt IN endpoint delivers a fixed-size transfer that holds one HCI ISO packet and zero-fills the remainder. That padding belongs to the transfer rather than to the stream, so it has to be dropped instead of reported to the host. btmtk_recv_isopkt() keeps parsing it: the zero bytes read as an ISO header with handle 0 and a Data_Total_Length of zero, and each one is passed to hci_recv_frame() as a complete frame. A single transfer yields a long run of them, which is what fills the HCI log with malformed ISO packets, and iso_recv() drops the SDU it is reassembling whenever handle 0 belongs to a live CIS/BIS. A zero Data_Total_Length carries no ISO Data Load, so such a packet is never part of the stream. Check for the zero-filled remainder before starting to parse the next frame, rather than after assembling a 4-byte header: a remainder shorter than HCI_ISO_HDR_SIZE would otherwise be held across calls as a partial header, corrupting the next transfer's framing. This also means a fully zero-filled remainder no longer costs an skb allocation that gets immediately freed. Reaching a zero Data_Total_Length any other way is then a genuine error, not padding. This was observed on MT7925, but btmtk_recv_isopkt() is shared by every MediaTek USB controller that supports ISO data. Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions") Co-developed-by: Hao Qin Signed-off-by: Hao Qin Co-developed-by: Wenlong Tian Signed-off-by: Wenlong Tian Signed-off-by: Chris Lu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit d67e72c5f8defd753b0edb682265c8209ec86eae Author: Luiz Augusto von Dentz Date: Thu Oct 22 17:03:37 2026 -0400 Bluetooth: hci_sync: Update the CIS host feature when enabling LE [ Upstream commit e24bfbc5e20711dafa0cdc2b3325c69de1cff068 ] The Connected Isochronous Stream (Host Support) feature bit is only set during init, based on LE being enabled at that time. If LE is enabled afterwards without the init being repeated, as happens when the controller is still auto powered on after registration, the bit stays cleared and controllers enforcing it reject LE Create CIS with Command Disallowed. Update the bit whenever LE Host Supported is written, so it follows the LE state. Fixes: 709788b154ca ("Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings") Assisted-by: OpenCode:claude-opus-5.5 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 798e4ba5822dfe707527c0050c8f55db332355cf Author: Luiz Augusto von Dentz Date: Wed Oct 21 13:49:35 2026 -0400 Bluetooth: L2CAP: Hold incoming data until encryption key size is known [ Upstream commit 5d005ded2cb14531c4d4ab5d02383407c75dbee6 ] Once encryption is enabled on an ACL link, the encryption key size is read from the controller, using hdev->min_enc_key_size in the meantime. Data received before the reply is processed with that key size, so a peer starting SMP over BR/EDR right after encryption, which it may do, gets its Pairing Request rejected with "Encryption Key Size" whenever the pending security level is FIPS, as that requires a 16 octet key: > HCI Event: Encryption Change (0x08) plen 4 > ACL Data RX: Handle 1 flags 0x02 dlen 11 BR/EDR SMP: Pairing Request (0x01) len 6 @ MGMT Event: Authentication Failed (0x0011) plen 8 Status: Authentication Failed (0x05) < HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2 > HCI Event: Command Complete (0x0e) plen 7 Key size: 16 < ACL Data TX: Handle 1 flags 0x00 dlen 6 BR/EDR SMP: Pairing Failed (0x05) len 1 Reason: Encryption key size (0x06) Mark the connection with HCI_CONN_ENC_KEY_SIZE_PEND while the key size is read and hold incoming L2CAP data back in pending_rx meanwhile, processing it once the reply is handled. Found with mgmt-tester "Pairing Acceptor - SMP over BR/EDR 2" under User Mode Linux time travel, where the emulated peer always replies before the key size is read. Fixes: e3f6a257a73d ("Bluetooth: Use actual encryption key size for SMP over BR/EDR") Assisted-by: OpenCode:claude-opus-5.5 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 245ac1600098ddae0cceb262b86d5e2c732cf8d8 Author: Luiz Augusto von Dentz Date: Fri Oct 23 17:19:10 2026 -0400 Bluetooth: hci_core: Convert hci_conn flags to a bitmap [ Upstream commit 1eebde8ecede18e351ccf438f17b53d3b62a75a9 ] struct hci_conn stores its flags in a single unsigned long, but the HCI_CONN_* enum already has 33 entries (up to HCI_CONN_PA_SYNC_FAILED = 32), so on 32-bit architectures set_bit()/test_bit() on the highest flags access memory past the flags field, aliasing the adjacent conn_reason field. Fix this by declaring flags with DECLARE_BITMAP() sized by a new __HCI_CONN_NUM_FLAGS terminator so it can accommodate any number of flags. Assisted-by: OpenCode:claude-opus-5.5 Signed-off-by: Luiz Augusto von Dentz Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known") Signed-off-by: Sasha Levin commit 34ae51981efbb7437319eda98bfc7a56684235d1 Author: Frédéric Danis Date: Thu Oct 1 15:51:08 2026 +0200 Bluetooth: MGMT: Add management security level changed event [ Upstream commit 1b723bd2945df4c75d7a4a4525660704ef8f4df8 ] Add an event on device security level or encryption type change to let user space know which level is currently in use. Reset security level to 0 on disconnection so further connections will correctly report security level changes. This will be used for BlueZ qualification automation. Assisted-by: GPT:GPT-5.3-Codex Assisted-by: Copilot:claude-sonnet-5 Signed-off-by: Frédéric Danis Signed-off-by: Luiz Augusto von Dentz Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known") Signed-off-by: Sasha Levin commit 7ff86e93e031d7e1e165f275054ed804491669ab Author: Peng Fan Date: Sun Sep 20 10:26:02 2026 +0800 Bluetooth: use assign_bit() where applicable [ Upstream commit c4154fc34772134b0dbd14ab0134ba10b90c52cc ] Convert open-coded if/else with set_bit/clear_bit the assign_bit API. Done with Coccinelle semantic patch: // set_bit -> clear_bit => assign_bit @@ expression cond, bit, addr; @@ -if (cond) - set_bit(bit, addr); -else - clear_bit(bit, addr); +assign_bit(bit, addr, cond); @@ expression cond, bit, addr; @@ -if (cond) - clear_bit(bit, addr); -else - set_bit(bit, addr); +assign_bit(bit, addr, !cond); Signed-off-by: Peng Fan Signed-off-by: Luiz Augusto von Dentz Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known") Signed-off-by: Sasha Levin commit bc0f66fb717ef24ac0de2259ce2b01321d7368cf Author: Kevin Dewald Date: Fri Oct 23 12:14:37 2026 -0700 Bluetooth: hci_event: Clear explicit connect state on LE connection [ Upstream commit f5cd268af1c6f87fb3847e98274e22b8c6324aa4 ] Since commit 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events when connecting LE"), create_le_conn_complete() only runs once the LE Connection Complete event has been handled, and le_conn_complete_evt() has already removed the connection parameters from pend_le_conns by then. hci_connect_le_scan_cleanup() looks the parameters up in pend_le_conns, so after a successful connection it no longer clears explicit_connect, nor deletes the parameters that were only created for the explicit connect. The parameters of every device connected through an explicit connect, such as an L2CAP or ATT connect or MGMT Pair Device, are thus left with explicit_connect set. MGMT Remove Device for all devices then keeps them as HCI_AUTO_CONN_EXPLICIT instead of freeing them, and if the device was set to auto-connect and is disconnected, they also stay on pend_le_conns: the kernel keeps scanning for the device and connects to it as soon as it advertises, although no one asked for it any more. Do the cleanup in le_conn_complete_evt() instead, where the explicit connect request is fulfilled: clear explicit_connect, delete the parameters if they only existed for it, and put report parameters back on pend_le_reports. Auto-connect parameters are added back to pend_le_conns on disconnection, as before. Update the comment in hci_explicit_conn_params_set() that names hci_connect_le_scan_cleanup() as the only place deleting them. Fixes: 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events when connecting LE") Assisted-by: Claude:claude-opus-5.5 Signed-off-by: Kevin Dewald Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit b8047c121b46f17e450c3c1aa530f93aed9f0999 Author: Catherine L Date: Fri Oct 23 11:30:26 2026 +0530 Bluetooth: btintel: fix buffer over-read in fw payload [ Upstream commit f92b7bca985205082c86140d0bd7c86c5be00efc ] The firmware decoder cast fw_ptr + frag_len to struct hci_command_hdr and read cmd->plen before confirming the header and payload still fit in the remaining firmware buffer. Add explicit bounds checks before each dereference: 1. Reject if the command header is not fully contained in remain. 2. Reject if the full command including payload exceeds remain. 3. Log the offending fragment length and remaining size before returning -EINVAL. Fixes: fbbe83c52bc0d ("Bluetooth: btintel: Create common function for firmware download") Signed-off-by: Catherine L Tested-by: Kiran K Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 400485e80568b395bcf4ec94e6d85aad9aa7d162 Author: Akhil Arul Date: Fri Oct 23 21:46:09 2026 +0530 Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained [ Upstream commit 19b4e5701712f74d005cc66a36374559e8dfd281 ] hci_recv_frame() drops a frame unless HCI_UP or HCI_INIT is set, but the check is not synchronized with hci_dev_close_sync(). A driver can pass the check, then close clears HCI_UP, flushes rx_work and starts drain_workqueue(), and the late queue_work() of rx_work hits the draining workqueue: workqueue: cannot queue hci_rx_work on wq hci0 WARNING: kernel/workqueue.c:2352 at __queue_work+0x2c0/0x780 Call Trace: queue_work_on+0xb2/0xc0 hci_recv_frame+0x18f/0x330 vhci_write+0x174/0x240 vfs_write+0x271/0x680 ksys_write+0x7c/0x110 Skipping the queue_work() while HCI_CMD_DRAIN_WORKQUEUE is set, as done for tx_work, does not work for rx_work: the flag covers the whole close, and events still have to be received in that window, for the commands sent by hdev->shutdown() and for the reset done with HCI_QUIRK_RESET_ON_CLOSE. Run hci_recv_frame() under rcu_read_lock() and wait with synchronize_rcu() once HCI_UP has been cleared, so that every caller which still saw HCI_UP has queued its work before the workqueue is drained, and later callers drop the frame. HCI_INIT does not reopen that window. Apart from the HCI_QUIRK_RESET_ON_CLOSE reset, which runs after drain_workqueue() has returned, it is only set by hci_dev_init_sync() during open, and open and close are serialized by hci_req_sync_lock. So once the grace period has ended, nothing can pass the check and queue rx_work until the drain is over. Tested in qemu with the syzbot C reproducer, one run per boot: the warning showed up on 12 of 30 boots before and on none of 42 boots after. Bringing a vhci controller up and down 50 times behaves the same with and without this change. Fixes: 76727c02c1e1 ("Bluetooth: Call drain_workqueue() before resetting state") Reported-by: syzbot+2344fb8002f3ef5b1712@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=2344fb8002f3ef5b1712 Signed-off-by: Akhil Arul Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 914f2656359cdbfc0aa044e6c9c0465d9394a864 Author: Binbin Deng <18983559317@163.com> Date: Mon Oct 19 18:56:24 2026 +0800 Bluetooth: hci_core: Initialize LTK before publication [ Upstream commit 4335849380aa1081ee9a1c2b934cbdda0961fa57 ] hci_add_ltk() publishes a newly allocated LTK on hdev->long_term_keys before initializing its address, type, value, authentication state, encryption size, EDIV, and random value. hci_find_ltk() and the debugfs long_term_keys_show() traverse this list under RCU and can therefore see a zero or partially initialized key before those stores complete. The race is reachable by racing an LTK addition with another CPU looking up or dumping long-term keys. For example, userspace can issue MGMT_OP_LOAD_LONG_TERM_KEYS while another process reads the corresponding debugfs file. Initialize all fields of a new LTK before list_add_rcu() makes it visible to RCU readers. Existing LTKs remain published and continue to be updated in place. Found during a static-analysis-assisted audit: candidate sites were surfaced by a Coccinelle rule, and the reader/writer paths were confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was not observed at runtime; it is identified by code inspection only. Fixes: 970d0f1b2803 ("Bluetooth: Convert LTK list to RCU") Assisted-by: GLM-5.3 coccinelle Signed-off-by: Binbin Deng <18983559317@163.com> Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 7c0e73cd48a348c4b9d0c7a1d4a86bcfc96573ce Author: Binbin Deng <18983559317@163.com> Date: Mon Oct 19 16:17:11 2026 +0800 Bluetooth: hci_core: Initialize link key before publication [ Upstream commit ae9c8df1ffb84560ac01cbdc26cfb19027f4d25f ] hci_add_link_key() allocates a new link key with kzalloc(), inserts it into hdev->link_keys with list_add_rcu(), and only then initializes its address, value, type, and PIN length. RCU readers such as hci_find_link_key() and the debugfs link_keys_show() do not take hci_dev_lock, so they can traverse the new entry during that initialization window and observe a zero or partially initialized key. This can be triggered by racing a link-key update with another CPU looking up or dumping keys. In particular, userspace can issue MGMT_OP_LOAD_LINK_KEYS while another process reads the corresponding debugfs file. Complete all fields of a newly allocated key before publishing it with list_add_rcu(). Existing keys remain visible and keep their current in-place update behavior. Found during a static-analysis-assisted audit: candidate sites were surfaced by a Coccinelle rule, and the reader/writer paths were confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was not observed at runtime; it is identified by code inspection only. Fixes: 0378b5977013 ("Bluetooth: Convert link keys list to use RCU") Signed-off-by: Binbin Deng <18983559317@163.com> Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 2c1eff1ee9d3f6ff3f063952429993edbf2bc97e Author: Binbin Deng <18983559317@163.com> Date: Mon Oct 19 19:16:11 2026 +0800 Bluetooth: hci_core: Initialize IRK before publication [ Upstream commit f0cf5a24cefeb629876bd15d668ff062c8655e28 ] hci_add_irk() initializes the identity address and address type of a newly allocated IRK, publishes it on hdev->identity_resolving_keys, and only then initializes its value and RPA. RCU readers such as hci_find_irk_by_rpa() and the debugfs identity_resolving_keys_show() can traverse the new entry during that window and see a zero or partially initialized IRK. The race is reachable by racing an IRK addition with another CPU resolving or dumping IRKs. In particular, userspace can issue MGMT_OP_LOAD_IRKS while another process reads the corresponding debugfs file or triggers RPA resolution. Initialize the IRK value and RPA before publishing a newly allocated IRK. Existing IRKs remain published and continue to be updated in place. Found during a static-analysis-assisted audit: candidate sites were surfaced by a Coccinelle rule, and the reader/writer paths were confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was not observed at runtime; it is identified by code inspection only. Fixes: adae20cb2d20 ("Bluetooth: Convert IRK list to RCU") Assisted-by: GLM-5.3 coccinelle Signed-off-by: Binbin Deng <18983559317@163.com> Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit fd18c8c5143e60db3cab8bd7f03fb26c2cbc2d1b Author: Luiz Augusto von Dentz Date: Thu Oct 15 11:37:52 2026 -0400 Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate [ Upstream commit fb1baa000d7a0b597ab9eb29b179b03e70e5f6ee ] The LE Set Default Rate Parameters command is rejected with Invalid HCI Command Parameters (0x12) because the Supervision_Timeout of 120 ms is exactly the minimum recommended by HOGP v1.2: Greater than or equal to (1 + Peripheral Latency) x Subrate max x Connection Interval max x 2 But the Core spec treats the equality as invalid: BLUETOOTH CORE SPECIFICATION Version 6.3 | Vol 4, Part E 7.8.158. LE Set Default Rate Parameters command If Connection_Interval_Max x Subrate_Max x (Max_Latency + 1) is greater than or equal to Supervision_Timeout x 40, the Controller shall return the error code Invalid HCI Command Parameters (0x12). With the current values 0x78 x 4 x 1 = 480 >= 0x0c x 40 = 480. Fix this by using 2 s as the default Supervision_Timeout, which is 10x lower than the 20 s used for non-SCI connections while still well above the minimum required, and make sure it remains above the minimum in case interval_max is raised to match the controller's minimum supported connection interval. Fixes: 2f8784cfe8a9 ("Bluetooth: Add support for Shorter Connection Interval (SCI) feature") Assisted-by: OpenCode:claude-opus-5.5 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 8f6106e508dfa884896829d8f5861e6d4ad1e99c Author: Alexandre Mergnat Date: Mon Nov 2 15:54:18 2026 +0000 regulator: mt6363: Fix VEMC voltage selection [ Upstream commit a8d72f246edb9323f6e0ae8283676a323b7847eb ] VEMC encodes its voltage as a range and a trim value. The custom getter looks up the range with if (rdesc->linear_range_selectors_bitfield[range] != calsel) so it stops at the first non-matching range and the reported voltage is wrong for every range setting. With hardware trap 1, the custom getter and setter apply MT6363_RG_VEMC_VOSEL_1_MASK, the trap 1 range field, to the trap 0 trim register and keep the trap 0 range field. Voltage changes are then not applied and the reported voltage does not reflect the trap 1 settings. Apart from the trap handling, both callbacks reimplement the regulator core pickable regmap helpers, which work for VEMC once the descriptor holds the range field and trim register of the hardware trap. Select that field and register at probe and use the helpers instead of fixing the copies. Keep the setter as a wrapper for the TMA unlock and relock around the write, which the helper does not do. A trap value other than 0 or 1, or a failed trap read, now fails the probe instead of the VEMC voltage get and set. Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Signed-off-by: Alexandre Mergnat Link: https://patch.msgid.link/20261102-rgp-67-mt6363-regulator-fixes-v1-2-420789a3113e@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit cf13b22ab76265e3db21b77fa689542b6d5a82e5 Author: Alexandre Mergnat Date: Mon Nov 2 15:54:17 2026 +0000 regulator: mt6363: Use 8-bit register values [ Upstream commit 7318d3833067e4edb7c2a9bc244e8818b1597ff2 ] The registers are 8 bits wide, but the regulator regmap uses 16-bit values, so every access also covers the next register. On little-endian CPUs, each regmap_write() also writes zero to the next register: disabling VS2 or a VBUCK rail through its clear register 0x212 also clears the enable bits of VS1, VS3 and three VSRAM rails in 0x213. Change the regmap values to 8 bits. Store the BUCK and TMA keys as __le16 so that the low byte goes to the first key register on any CPU, as it did on little-endian CPUs. Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Signed-off-by: Alexandre Mergnat Link: https://patch.msgid.link/20261102-rgp-67-mt6363-regulator-fixes-v1-1-420789a3113e@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 020d3d5866dcbd27f2d15a7d1da816ce3030bc09 Author: GIBEOM LEE (이기범) Date: Mon Nov 2 01:44:04 2026 +0900 regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs [ Upstream commit 8aed8b66751e006589b6a9474af757d1ba04a857 ] VSRAM_CPUB, VSRAM_CPUM, VSRAM_CPUL and VSRAM_APU have a register of their own for the enable (bit 0) and low power (bit 1) bits, which the header defines as MT6363_RG_LDO_VSRAM_*_ADDR. The driver does not use it: MT6363_LDO_L() takes the registers of the BUCK1 group, which is right only for the VSRAM_{DIGRF,MDFE,MODEM} LDOs of MT6363_LDO_L_SC(). Bit 0 of the BUCK1 enable register is VS1 and bit 1 of the BUCK1 low power register is VS3. So disabling one of these LDOs disables VS1, their state is the state of VS1, and asking for their low power mode puts VS3 in it. The LDOs themselves are never switched. Use the register of the LDO, as MediaTek's driver does. Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: GIBEOM LEE (이기범) Tested-by: Alexandre Mergnat Link: https://patch.msgid.link/20261101164405.1743177-3-rtx4060@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 6420b2a5fc52ed075bf9ac3841ba4a073a2be1b9 Author: Alexei Starovoitov Date: Mon Nov 2 05:59:12 2026 +0000 bpf: Don't trust pointers spilled in slots that a callee can write [ Upstream commit cdefba74b53fb9b482355ebde1654800aea45dae ] arg_track follows pointers to the stack through registers and spills. Scalar evolution and the removal of dead slots rely on it to know which slots an insn reads and writes. arg_track assumes that a call does not change the pointers that are spilled in the frame of the caller. But a static subprog or a callback can store a pointer to other memory there, and the caller can use it: *(u64 *)(r10 - 16) = fp-8 r1 = fp-16, r2 = map_value call sub ; *(u64 *)(r1 + 0) = r2 r7 = *(u64 *)(r10 - 16) ; verifier: map_value. arg_track: fp-8 *(u64 *)(r10 - 8) = fp-24 *(u64 *)(r7 + 0) = 0 ; arg_track: fp-8 is overwritten r8 = *(u64 *)(r10 - 8) ; verifier: fp-24. arg_track: none loop: r1 = *(u64 *)(r10 - 24) ; the counter of the loop ... *(u64 *)(r8 + 0) = 4096 ; arg_track: not a write to fp-24 Scalar evolution does not see the last store. It gives the counter the range of a loop that only increments it. The prog loads, and it accesses a map value out of bounds. Valid progs are rejected as well. The store through r7 makes fp-8 dead, and a later read of fp-8 fails with "slot poisoned by dead code elimination". When a static subprog or a callback can get a pointer to the frame of its caller, join every slot of that frame with "not a pointer to the stack". Reads and possible writes through a filled pointer are still seen, but no store through it is a certain write. It has to be every slot: the callee reaches the whole frame from one pointer, and callees are analyzed after the caller. The price is precision: an 8-byte load through a filled pointer gives a value that can point to any frame. For a spilled copy of r10 this needs "bpf: Fix the join of fp+0 with a value that is not a pointer to stack". In selftests, Cilium and sched_ext the stack marks change in 4 of 12522 progs. Verdicts, insns and states do not change in any prog. one_fp_clear_stack_threshold and two_fp_clear_stack_threshold expect the fake offset fp+0 in the log now. Fixes: bf0c571f7feb ("bpf: introduce forward arg-tracking dataflow analysis") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261102055913.3598414-4-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 7316e4a3bb4944b7b499098a01177cff844a18b0 Author: Alexei Starovoitov Date: Thu Sep 24 03:10:29 2026 +0000 bpf: Prepare static analysis passes for callx instruction [ Upstream commit 373e3fd0bff0e276fd76c86c830cdb16a3457776 ] BPF_JMP | BPF_CALL | BPF_X (callx) will be an indirect call of static subprog with address in dst_reg. The passes that run before the main verifier pass don't know which subprog callx calls. Teach them to treat callx as a call with unknown callee: - const_fold: callx clobbers R0-R5 like any other call. Otherwise bpf_prune_dead_branches() could rewrite a live conditional jump. - live regs: callx uses R1-R5 and dst_reg, defines R0-R5. - stack liveness: func instances are keyed by (callsite, depth) and cannot describe a callsite with multiple callees. Don't create instances for callees of callx. If any callx argument is derived from fp mark stack of all frames as read at callx insn and keep slots of outer frames alive 'before' the callsite while the callee is verified. Same as for callbacks that are not known statically. The callee is analyzed as standalone instance. - backtracking: treat callx as a call of static subprog, same as BPF_PSEUDO_CALL. callx is still rejected as unknown opcode. No functional change. Signed-off-by: Alexei Starovoitov Acked-by: Eduard Zingerman Link: https://patch.msgid.link/20260924031042.1690890-5-alexei.starovoitov@gmail.com Stable-dep-of: cdefba74b53f ("bpf: Don't trust pointers spilled in slots that a callee can write") Signed-off-by: Sasha Levin commit d14b93bbd071a71eb42c104507ce071a529e4278 Author: Yonghong Song Date: Sat Sep 12 12:52:32 2026 -0700 bpf: Rename bpf_call_summary::num_params to arg_slot_cnt [ Upstream commit c6ff4e06033fede2fd1d41232ae942add649b759 ] The field 'num_params' counts the argument registers and outgoing stack slots a helper or kfunc call takes. The next patch gives a 16-byte parameter two slots, so the name stops describing what the field holds. Rename 'num_params' to 'arg_slot_cnt'. No functional change. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20260912195232.988528-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov Stable-dep-of: cdefba74b53f ("bpf: Don't trust pointers spilled in slots that a callee can write") Signed-off-by: Sasha Levin commit 4575f5424d7c2c1dade63f790d14e80181f4267b Author: Alexei Starovoitov Date: Mon Nov 2 05:59:10 2026 +0000 bpf: Fix the join of fp+0 with a value that is not a pointer to stack [ Upstream commit 6185d4fc6e64439cad415d9bf527f8ffb3fa3db4 ] arg_track follows pointers to the stack through registers and spills. Scalar evolution and the removal of dead slots rely on it to know which slots an insn reads and writes. Where two paths meet, a register can be fp-N on one path and not a pointer to the stack on the other path. There is no value for that. The join adds a fake second offset, fp+0: with two offsets no store through the register is a certain write. But for fp+0 the fake offset is the offset itself: join(fp-8, none) = {fp-8, fp+0} two offsets join(fp+0, none) = {fp+0} one offset: "exactly fp+0" Then a store counts as a certain write to the stack, but at run time it can go to other memory: r7 = r10, or r7 = map_value + 8 ; arg_track: exactly fp+0 *(u64 *)(r10 - 8) = fp-24 *(u64 *)(r7 - 8) = map_value ; arg_track: fp-8 is overwritten r8 = *(u64 *)(r10 - 8) ; fp-24 or map_value. arg_track: none loop: r1 = *(u64 *)(r10 - 24) ; the counter of the loop ... *(u64 *)(r8 + 0) = 4096 ; arg_track: not a write to fp-24 Scalar evolution does not see the last store. It gives the counter the range of a loop that only increments it. The prog loads, and it accesses a map value out of bounds. Valid progs are rejected as well. The store through r7 makes fp-8 dead, and a later read of fp-8 fails with "slot poisoned by dead code elimination". When the single offset is 0, drop the offsets. The result is a pointer to an unknown slot of the frame, and all updates through it are weak. Veristat sees no difference in selftests, Cilium and sched_ext. Fixes: bf0c571f7feb ("bpf: introduce forward arg-tracking dataflow analysis") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261102055913.3598414-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit e3a26e033d352c085f02949f200f98274f37f847 Author: Jerome Brunet Date: Fri Oct 30 18:14:56 2026 +0100 ASoC: meson: axg-fifo: request the irq with the clock enabled [ Upstream commit 82fa7bfab6b961a03d6575348334e0ec15fdc712 ] The fifo irq handler accesses registers which need pclk, but the irq is requested before pclk is enabled on open and freed after it is disabled on close. Request the irq after enabling pclk and masking the fifo irqs. Free it before disabling pclk. Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver") Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-30e88a8a-f33a-40f0-92aa-9ea62c5b7299 Signed-off-by: Jerome Brunet Link: https://patch.msgid.link/20261030-asoc-axg-fifo-irq-clock-v1-1-f8c170ac8b0d@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit d4d807353bf3760122340065bad5a2d0a86c06a9 Author: Shubhang Kaushik (Ampere) Date: Sun Nov 1 21:00:12 2026 -0800 sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs [ Upstream commit 4c2e0751d5e6d181a5b9b2a8ada869b5bee66a83 ] scx_bpf_destroy_dsq() takes the target user DSQ's raw spinlock. However, it is in scx_kfunc_ids_any, which is also registered for BPF_PROG_TYPE_TRACING. For an active root scheduler without ops.sub_attach, the compatibility path in scx_prog_sched() lets an unassociated tracing program resolve to that scheduler. The tracing program can then call scx_bpf_destroy_dsq() while the target DSQ lock is already held. For example, a scheduler which mixes FIFO and priority-queue insertions into a user DSQ triggers scx_error() from scx_dispatch_enqueue() while holding that DSQ's lock. scx_claim_exit() emits sched_ext_exit before the lock is released: scx_dispatch_enqueue() raw_spin_lock(&dsq->lock) scx_error() scx_claim_exit() trace_sched_ext_exit() tracing BPF program scx_bpf_destroy_dsq(dsq_id) destroy_dsq() raw_spin_lock_irqsave(&dsq->lock) The tracing program recursively acquires the same raw spinlock and locks up the CPU. Because the tracepoint runs before scx_finish_exit(), disable_irq_work is not queued and the scheduler cannot enter its normal disable path. Reject scx_bpf_destroy_dsq() from tracing programs at verification time. The kfunc remains available to SCX struct_ops and syscall programs. Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class") Signed-off-by: Shubhang Kaushik (Ampere) Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit c6850945f8da9bc4940b2b1079cc130c0225b31d Author: Alexei Starovoitov Date: Mon Nov 2 06:42:30 2026 +0000 bpf: Don't move a MAP_FIXED address in arena_get_unmapped_area() [ Upstream commit 92b5ce3ca5b7c641e2678f92419aa7833951bc9d ] The user range of an arena must not cross a 4 GiB boundary. Thus arena_get_unmapped_area() asks the mm for 2 * len bytes and rounds the result up if necessary. This is correct only if the mm finds a free range. With MAP_FIXED the mm does no search and returns addr. For MAP_FIXED_NOREPLACE, do_mmap() also sets MAP_FIXED. With MAP_FIXED the arena is not at addr after round_up(). Thus mmap() removes mappings outside the range from addr to addr + len. It keeps a part of those in this range. Also, round_up() can wrap to address 0, and the test for address 0 is before it. The arch code gets twice the length of the mapping. Thus it can refuse a valid MAP_FIXED range. On s390 the arch code also grows the page table for the range. With the double length it can omit this step for a valid range. The test for a crossing is not exact. Because ret is a long, ret >> 32 extends the sign, but the other side is unsigned. The sides are never equal for an address with bit 63 set, and round_up() always runs. Such user addresses exist on s390. arena_map_alloc() does the same test with a u64. With MAP_FIXED, pass len to the mm. Return -EINVAL if the range crosses a boundary, as for address 0. Make ret unsigned, so that only these ranges get the error. On x86-64, if round_up() gives address 0 today, mmap() now fails with -EINVAL or with -ENOMEM from the mm. Today mmap() can also fail for the address after round_up(), for example with -ENOMEM, -EEXIST, -EPERM or -EBUSY. Without MAP_FIXED the mm must still find a free range of 2 * len bytes inside the address space of the task. The range after round_up() is inside it, and round_up() cannot wrap. An address with bit 63 set now moves only if its range crosses a boundary. For an arena, libbpf uses MAP_FIXED only with map_extra, and arena_map_alloc() refuses a map_extra range that crosses a boundary. A subsequent mmap() must use the range of the first mmap(). For mmap() of the map fd, this range comes from arena_get_unmapped_area(), thus it crosses no boundary. arena_map_alloc() still accepts a map_extra above TASK_SIZE, and mmap() of such an arena fails. Fixes: 317460317a02 ("bpf: Introduce bpf_arena.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261102064231.2153879-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 84310e6551207994609a494a4bf1096db3387d3c Author: Lorenzo Bianconi Date: Thu Oct 29 11:33:57 2026 +0100 net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume() [ Upstream commit 23d96de472f735858a7dd227c77aebff21ea09f5 ] The core soft reset issued by stmmac_init_dma_engine(), called from stmmac_hw_setup(), clears the MTL_EST registers. Nothing re-applies the taprio offload afterwards, so priv->est->enable stays true while the hardware EST block is left disabled: taprio keeps being reported as offloaded, the TX/XDP paths keep dropping frames larger than priv->est->max_sdu[], and the programmed base time is stale. Re-apply the offload from __stmmac_open() and stmmac_resume() after PTP has been brought up. The base time is recomputed from the reserved base time and the current PTP time, because the timestamp counter has been re-initialised and the previously programmed base time cannot be reused. Factor the recompute-and-program sequence into __stmmac_setup_est(), which must be called with est_lock held, and into stmmac_setup_est(), which takes the lock and re-applies the offload only when it is currently enabled and PTP has been brought up. Use the same helper in stmmac_adjust_time() so the PTP adjust path shares the base time computation. Only tc_taprio_configure() updates priv->est->enable: it is set when a REPLACE succeeds and cleared on DESTROY or a programming failure. The re-apply helpers leave it untouched, so the flag records that an offload is installed rather than the current hardware programming state. __stmmac_setup_est() only reprograms the EST block, and stmmac_setup_est() replays the FPE mapping afterwards. On a failed re-apply the open and resume callers abort, while stmmac_adjust_time() keeps the offload configured. The same reset also discards the FPE preemption programming, and on XGMAC stmmac_dma_tx_mode() overwrites the queue-to-traffic-class map. Save the preemptible traffic class mask in priv->est->pclass when a REPLACE succeeds and replay the FPE mapping from stmmac_setup_est() as well. Re-applying the offload is best-effort with respect to PTP: stmmac_setup_est() does nothing when PTP was not enabled (for example when clk_ptp_rate is 0), so a missing PTP reference clock does not by itself fail ndo_open(). If re-applying the EST or FPE programming fails while restoring the interface, the failure is fatal to the caller: __stmmac_open() aborts the open, and stmmac_resume() takes the same error path already used for a failed timestamp counter restore. Since __stmmac_open() and stmmac_resume() now trust priv->est->enable, also make tc_taprio_configure() consistent: hold est_lock across the whole validate-and-program sequence, build the gate list in a temporary buffer, and only commit it and enable EST after validation and hardware programming succeed. A REPLACE rejected during validation then leaves the currently installed schedule intact in both software and hardware, while a hardware or FPE mapping failure disables EST instead of leaving a stale enable flag behind. Reject cycle times whose seconds field would not fit in priv->est->ctr[1]. Fixes: b60189e0392f ("net: stmmac: Integrate EST with TAPRIO scheduler API") Signed-off-by: Lorenzo Bianconi Reviewed-by: Maxime Chevallier Tested-by: Maxime Chevallier Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-3-85b830a795a9@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 19672cba77668dc45e58d344df841bb355ad17af Author: Lorenzo Bianconi Date: Thu Oct 29 11:33:56 2026 +0100 net: stmmac: pass the desired EST enable state to est_configure() [ Upstream commit e4f5b46dfb8ac27a822fa0b411bd4526abf5ba97 ] Pass the desired EST enable state explicitly to est_configure() instead of having it derive from cfg->enable. This decouples the hardware programming state from the priv->est->enable flag, which records whether the taprio offload is attached. No functional change intended: the callers keep toggling priv->est->enable around the EST programming, as before. Reviewed-by: Maxime Chevallier Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-2-85b830a795a9@oss.qualcomm.com Signed-off-by: Paolo Abeni Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()") Signed-off-by: Sasha Levin commit 5895543f7a7d6777107c72e75ea8c11403f4cd47 Author: Lorenzo Bianconi Date: Thu Oct 29 11:33:55 2026 +0100 net: stmmac: initialize est_lock at probe time [ Upstream commit 98caed39c1db002b2c34b8040ab765c5fa9c6675 ] priv->est is allocated with devm_kzalloc() on the first TAPRIO REPLACE and priv->est_lock is initialized in the same place, which ties the validity of the lock to whether TAPRIO has ever been configured. The lock is also never destroyed. Initialize priv->est_lock in __stmmac_dvr_probe() next to priv->lock and destroy it in stmmac_dvr_remove(). This keeps the lock valid for the entire lifetime of the device, independent of the TAPRIO state, and removes the lazy initialization from the TAPRIO configuration path. No functional change intended. Reviewed-by: Maxime Chevallier Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-1-85b830a795a9@oss.qualcomm.com Signed-off-by: Paolo Abeni Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()") Signed-off-by: Sasha Levin commit f263217396911df917565c2f9ec8c458eaa2e44a Author: James Clark Date: Thu Oct 8 17:38:09 2026 +0700 net: stmmac: ptp: switch to gettimex64() interface [ Upstream commit d7804253678eb18d2be950e0542364b50be096a9 ] The stmmac PTP support currently implements the gettime64 callback to retrieve the hardware clock time. Update the implementation to provide the gettimex64 callback instead, adding support for the PTP_SYS_OFFSET_EXTENDED ioctl. The system clock readings are taken around the read of the nanoseconds register in get_systime(), so get_systime() gains a ptp_system_timestamp argument. Reviewed-by: Nicolai Buchwitz Assisted-by: LLM Signed-off-by: James Clark Reviewed-by: Vadim Fedorenko Link: https://patch.msgid.link/20261008103809.1848255-1-jjc@jclark.com Signed-off-by: Paolo Abeni Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()") Signed-off-by: Sasha Levin commit e10a25af27f8d03a4bc4daef3778887ff71637cc Author: Lorenzo Bianconi Date: Mon Sep 14 17:26:44 2026 +0200 net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume() [ Upstream commit 8181678a92f0143ad3dafcc2e811afa44ecb4fd6 ] stmmac_setup_ptp() returns void and swallows both PTP setup errors: the PTP reference clock enable and stmmac_init_timestamping() failures are logged but never propagated. When they fail, the MAC system time counter is left in its post-reset, non-running state, while the driver keeps operating as if timestamping were up. This matters for TAPRIO/EST qdisc offloading, which derives the EST base time from the hardware timestamp counter: arming the gate list against a non-advancing time base would leave the schedule permanently stuck. Make stmmac_setup_ptp() return an error code and propagate the failure in __stmmac_open(), stopping the DMA engines when PTP setup fails. In stmmac_resume(), re-initialise timestamping only when the PTP clock was registered before suspend, re-apply the platform clock rate configuration, and stop the DMA engines if re-initialisation fails. While at it, factor the hardware timestamping capability check into a stmmac_check_timestamp_cap() helper and apply it to the hwtstamp get path and the ethtool ts_info path. stmmac_setup_ptp() now enables the PTP reference clock and runs the platform ptp_clk_freq_config() callback before validating the resulting clock rate; if no valid rate is available, it disables the clock and returns success without registering the PTP clock. This keeps the interface operational on platforms with PTP-capable silicon but an unconfigured PTP clock, where timestamping cannot be enabled: instead of failing, the driver proceeds without setting up timestamping. Extend the timestamping gate on the set path (which keeps testing the core's basic/advanced timestamping capability) and the devlink registration with the PTP reference clock rate requirement. Gate the PTP reference clock enable/disable in the platform noirq suspend/resume callbacks on priv->ptp_enabled, keeping the clock reference balanced against the new early return in stmmac_release_ptp(). Reviewed-by: Maxime Chevallier Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260914-stmmac-ptp-error-propagate-v5-1-81149897e65d@oss.qualcomm.com Signed-off-by: Jakub Kicinski Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()") Signed-off-by: Sasha Levin commit a57916bfd34fff3c3a2c8ea79f2d28e202165b8b Author: Baochen Qiang Date: Thu Oct 29 10:18:42 2026 +0800 wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it [ Upstream commit 83d689bbe8f90ce39961bcc3a64f2ca2ec184019 ] ath12k_peer_assoc_h_eht() copies the peer's EHT PHY capabilities into the WMI peer assoc command as is, including the EHT-MCS15 support bits. Firmware rate control enables EHT-MCS15 for TX whenever those bits are set, without checking whether the local PHY supports MCS15. Currently WCN7850 firmware does not support EHT-MCS15 for TX and does not advertise it in its own EHT PHY capabilities. When connected to an AP that advertises MCS15 support, rate control may still select EHT-MCS15, and every PPDU at that rate is aborted by the PHY before it goes on the air. TX then stops for minutes while the association stays up, and frames sit in the queue until the firmware releases them as aged. Keep only the peer's MCS15 support bits that we also support ourselves to fix it. Chips that support MCS15 are not affected. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 17bbb8aa74fd ("wifi: ath12k: prepare EHT peer assoc parameters") Reported-by: Vladimir Petrzhikovskii Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222136 Tested-by: Vladimir Petrzhikovskii Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20261029-ath12k-mcs15-v1-1-3bcfab101f00@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit a8394c93b39fb5692990113601fc3dd0bd03b893 Author: Nguyen Ngoc Thang Date: Thu Oct 29 21:24:23 2026 +0700 net: phy: don't require RTNL to detach a PHY from an unregistered netdev [ Upstream commit d1cf56164dc25c2c54853b23eab42369f53c8329 ] phy_detach_internal() reads dev->hwprov with rtnl_dereference(), but MAC drivers commonly attach and detach PHYs while their net_device is not registered, without holding RTNL. Before register_netdev(), a failed phylink_connect_phy() or phy_attach_direct() unwinds through phy_detach_internal(). After unregister_netdev(), a driver's remove path may call phy_disconnect(). Both trip lockdep: WARNING: suspicious RCU usage drivers/net/phy/phy_device.c:1831 suspicious rcu_dereference_protected() usage! phy_detach_internal+0x6a5/0x830 drivers/net/phy/phy_device.c:1831 phylink_connect_phy+0x22e/0x2b0 drivers/net/phy/phylink.c:2452 ax88772_bind+0xbb1/0x1520 drivers/net/usb/asix_devices.c:925 usbnet_probe+0xbb3/0x27e0 drivers/net/usb/usbnet.c:1812 syzbot hits this with an emulated asix device. phy_eee_rx_clock_stop() fails on a USB MDIO error, so phylink_bringup_phy() fails and the PHY is detached from inside usbnet_probe(), before the netdev is registered. hwprov is only set through ethtool, under RTNL, on a registered device. reg_state also changes only under RTNL. So if the device is not registered, no one else can reach hwprov, and RTNL is not needed. Tell lockdep that. A detach from a registered device without RTNL still warns. Fixes: 35f7cad1743e ("net: Add the possibility to support a selected hwtstamp in netdevice") Reported-by: syzbot+583f42a41879bb60de32@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=583f42a41879bb60de32 Signed-off-by: Nguyen Ngoc Thang Reviewed-by: Kory Maincent Link: https://patch.msgid.link/20261029142423.93573-1-ngocthang2710.1999@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit f76908deda4db6e89a6a37e180e21b4ed7bc9a95 Author: Markus Stockhausen Date: Mon Aug 31 16:34:30 2026 +0200 net: phy: add phy_detach_internal() helper [ Upstream commit 2df76677c1c08f622cc577a49f0645a5976d7c91 ] For the upcoming MDIO bus notification enhancements the PHY detach path needs to inform the bus about these actions. Until now phy_detach() is used for the regular detach path as well as from the phy_attach_direct() error paths So in the future there must be a clear indication if a notification is needed (normal path) or not (cleanup path). Carve out the phy_detach() code into a new helper phy_detach_internal() and make phy_detach() a short stub that calls the new helper. Signed-off-by: Markus Stockhausen Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20260831143439.2404484-5-markus.stockhausen@gmx.de Signed-off-by: Jakub Kicinski Stable-dep-of: d1cf56164dc2 ("net: phy: don't require RTNL to detach a PHY from an unregistered netdev") Signed-off-by: Sasha Levin commit 2399250be44bf79dd681fcc02ec11afc1da9ce16 Author: Bryam Vargas Date: Wed Oct 28 23:47:13 2026 -0500 net/iucv: take a private, writable frame before rewriting it in place [ Upstream commit f38bce9af9e2a3cced7d303a1476f21c1f42bcb7 ] afiucv_hs_rcv() rewrites the frame in place -- EBCASC() on four name fields, then afiucv_swap_src_dest() swaps them and pushes an Ethernet header -- and can hand the same skb to dev_queue_xmit(), without making it private first, so a packet socket that also gets the frame reads the rewritten names. An ETH_P_ALL tap runs first and leaves af_iucv a cloned skb; a socket opened for ETH_P_AF_IUCV sits on a ptype_specific list, walked after ptype_base[], so deliver_skb() takes a reference and af_iucv runs on an skb that is shared but not cloned. Unshare, then cow, in that order: skb_cow() can reach pskb_expand_head(), which has BUG_ON(skb_shared()). skb_cow() tests skb_cloned(), which is what a rewrite of the data needs; skb_cow_head() tests only the header. Asking for ETH_HLEN also covers the unchecked push in afiucv_swap_src_dest(); on the ordinary path eth_type_trans() has already pulled that much, so it only compares. Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport") Closes: https://sashiko.dev/#/patchset/20260813-b4-disp-60433a46-v1-1-509e1200533e@proton.me?part=1 Signed-off-by: Bryam Vargas Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit e1618627070c70b3f7f1380d0dd4c8007c75702f Author: Guangshuo Li Date: Sat Oct 31 21:05:41 2026 +0800 gpio: mpc8xxx: Fix potential use-after-free of IRQ domain [ Upstream commit 9e4b35c95fede87bad36f68b7ff1eae94ea6b910 ] GPIO chip cleanup can call the to_irq callback while releasing requested GPIOs. Removing the IRQ domain first leaves that callback using a freed domain, both on removal and after an IRQ request failure. Register domain cleanup before GPIO chip registration so devres removes the chip before freeing the domain. This issue was found by our static analysis tool under development. Fixes: 257e10752c13 ("gpio: mpc8xxx: Use of_mm_gpiochip_remove") Signed-off-by: Guangshuo Li Link: https://patch.msgid.link/a4fec7fe970d6fc9135b488f57ba7e145b809359.1793377433.git.liguangshuo@mail.sdu.edu.cn Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 9ac888dbe7f134760dd3d9206ee0ae3d41b83fd2 Author: Daniel Machon Date: Thu Oct 29 12:48:10 2026 +0100 net: sparx5/lan969x: release the in-flight slot of a stale TX skb [ Upstream commit 873363ac591a1774aa3ced84f7ea3d93a3eb9b07 ] sparx5_ptp_txtstamp_request() counts every two step TX skb waiting for its timestamp in sparx5->ptp_skbs, and refuses new ones once SPARX5_MAX_PTP_ID are in flight. sparx5_ptp_txtstamp_old_release() frees the skbs that have waited longer than SPARX5_PTP_TIMEOUT. Before this patch, old_release() does not decrement ptp_skbs, so every skb whose timestamp never arrives, for example because the switch discarded the frame, keeps its slot forever. Once SPARX5_MAX_PTP_ID slots are lost, two step frames fail to transmit on every port of the switch. Return the number of released skbs from old_release() and subtract it from ptp_skbs in txtstamp_request(), under the ptp_ts_id_lock it already takes. This fixes the accounting only. A port's stale skbs are still aged out only when that port sends a two step frame, so a port that stops sending them keeps its stale skbs, and their slots, until it sends one again. That behaviour is unchanged by this patch. Found by an AI code review agent. Reproduced on a lan9696 board with a modified kernel that drops the TX timestamps of two step frames, after which two step timestamping stopped working on the port. With the fix, timestamping keeps working on that board and on a sparx5 PCB135 board. Fixes: 70dfe25cd866 ("net: sparx5: Update extraction/injection for timestamping") Signed-off-by: Daniel Machon Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261029-sparx5-ptp-stale-tx-slot-v1-1-ec15f391bbb7@microchip.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 7d5c860fa783c09139c47b597926b5eb165a9920 Author: Dmitry Baryshkov Date: Mon Oct 19 17:39:21 2026 +0300 regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI [ Upstream commit 053c50a7052549aab0d310ad505947db3e211592 ] The SAW voltage change runs on CPU 0 from an IPI, but it reaches the SAW registers through the syscon regmap, which is protected by a spinlock_t. That is a sleeping lock on PREEMPT_RT, and lockdep complains as soon as VDD_APCC actually changes voltage: BUG: Invalid wait context ... regmap_lock_spinlock+0x18/0x30 regmap_read+0x3c/0x78 spmi_saw_set_vdd+0x50/0x1ac __flush_smp_call_function_queue+0x1ac/0x334 Map the SAW with a regmap of our own that uses a raw spinlock, and fail the probe when that cannot be done instead of carrying an error pointer around as the SAW regmap. Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://patch.msgid.link/20261019-fix-qcom-saw-v1-3-9c7ba3fc2493@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit fc9fa365deac82a40fbc44863e62366f25af5f96 Author: Yuho Choi Date: Tue Sep 22 17:11:41 2026 -0400 virtio_blk: Reset device on probe error paths after DRIVER_OK [ Upstream commit f4f6e9a9cb349003d333f0776de94f12ac95b8d2 ] virtblk_probe() marks the device ready before revalidating zones and adding the disk, and either of those can fail. The out_cleanup_disk path they take goes on to delete the virtqueues, but nothing tells the device to stop first, so it is still live when the rings are freed. Reset the device at out_cleanup_disk, which is only reachable after virtio_device_ready(). virtblk_remove() and virtblk_freeze_priv() both reset before deleting the virtqueues for the same reason. Fixes: dbb301f91fc8 ("virtio_blk: add error handling support for add_disk()") Signed-off-by: Yuho Choi Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Message-ID: <20260922211207.523999-1-oss.patchbox@gmail.com> Signed-off-by: Sasha Levin commit 9a323a3ef0bcbae72bf2593058c029ba09dccbba Author: Jia Jia Date: Sat Sep 19 16:39:33 2026 +0800 vduse: avoid infinite loop when no affinity CPU is online [ Upstream commit cf0a5805d43236e308f14188f9737ddcf83fb53a ] If all CPUs in vq->irq_affinity are offline, cpumask_next() walks to the end of the mask, and the loop then resets the cursor to IRQ_UNBOUND and restarts the scan. When VDUSE_VQ_INJECT_IRQ is issued, the intersection of vq->irq_affinity and cpu_online_mask is empty, so the caller busy-loops in kernel context on its current CPU (e.g. CPU2). Replace the while loop in vduse_vq_update_effective_cpu() with cpumask_next_and_wrap() to find the intersection of vq->irq_affinity and cpu_online_mask in a single wrapped scan. If the intersection is empty, set curr_cpu to IRQ_UNBOUND and let the existing unbound workqueue handle injection, avoiding repeated rescans when all CPUs in the affinity are offline. Use cpus_read_lock()/cpus_read_unlock() to keep the selected CPU online. Fixes: 28f6288eb63d ("vduse: Support set_vq_affinity callback") Signed-off-by: Jia Jia Signed-off-by: Michael S. Tsirkin Message-ID: <20260919083933.104437-1-physicalmtea@gmail.com> Signed-off-by: Sasha Levin commit ca954b2729038abbd679a5a9af96e791502aeb73 Author: Sergii Ushakov Date: Fri Sep 18 15:51:20 2026 +0200 virtio-blk: clamp max_segments to virtqueue ring size [ Upstream commit 434d2bc41bd0c0ac576d4d259bd9f2ab49071174 ] In virtblk_add_req(), each request consumes 2 extra descriptors (out_hdr and in_hdr) in addition to the data scatter-gather segments. When a hypervisor (e.g. QNX Hypervisor) advertises VIRTIO_BLK_F_SEG_MAX with seg_max = 1024 alongside a 1024-entry split ring (vring.num = 1024) and VIRTIO_RING_F_INDIRECT_DESC disabled, lim->max_segments is set to 1024. When the block layer submits requests with 1023 or 1024 data segments, total_sg reaches 1025 or 1026. This exceeds vring.num (1024), causing virtqueue_add_split() to return -ENOSPC and permanently wedge the blk-mq queue. Furthermore, the Virtio specification (2.7.5.3.1) requires that a descriptor chain never exceed the Queue Size, and virtqueue_add_split() falls back to direct descriptors if indirect table allocation fails. Fix this by: 1. Rejecting queues with ring_size < 3 at probe, or ring_size < (queue_max_segments + 2) during resume/reset recovery in init_vq(). 2. Unconditionally clamping sg_elems to (ring_size - 2) across all virtqueues in virtblk_read_limits(). Reported-by: Stjepan Poljak Fixes: 0864b79a1533 ("virtio: block: dynamic maximum segments") Signed-off-by: Sergii Ushakov Signed-off-by: Michael S. Tsirkin Message-ID: <20260918135120.1261150-1-sergiiushakov@google.com> Signed-off-by: Sasha Levin commit 3cb11ec94e2476feee0ce108091b44954da74ace Author: Yu Zhang Date: Fri Sep 18 14:04:36 2026 +1000 vhost-vdpa: drop the parent's vq callback before the call fd is released [ Upstream commit c9c1c1b7b31fc8b9a5d6c04f5f0ae647d081a39d ] VHOST_SET_VRING_CALL releases the previous call eventfd inside vhost_vring_ioctl() -- it swaps the new context into vq->call_ctx.ctx and then eventfd_ctx_put()s the old one, which is a synchronous kfree(). The parent vdpa device is only told about the change afterwards, when vhost_vdpa_vring_ioctl() reaches ops->set_vq_cb(). Parent drivers cache the pointer handed to them in vdpa_callback::trigger and do not take a reference on it, so throughout that window the parent holds a dangling eventfd_ctx and may signal it. The documentation added with the field describes what signalling it means but says nothing about how long it stays valid. This is the same hazard that "vhost_vdpa: assign irq bypass producer token correctly" addressed for the irq bypass producer token, by moving vhost_vdpa_unsetup_vq_irq() ahead of the vhost_vring_ioctl() call. The producer token was only one of the two consumers of that pointer; the one the parent keeps via ->set_vq_cb() was left behind the free. With VDUSE the window is directly reachable from userspace, because the device emulation daemon can inject an interrupt at any time from a different fd, and neither side shares a lock with the other: VDUSE takes vq->irq_lock, vhost takes vhost_dev.mutex + vq->mutex. BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x76/0xe0 Write of size 4 at addr ffff8881084e8788 by task vduse_uaf/2987 _raw_spin_lock_irqsave+0x76/0xe0 eventfd_signal_mask+0x69/0x120 vduse_dev_ioctl+0x337/0x1a60 <- vduse_vq_signal_irqfd(), inlined __x64_sys_ioctl+0x120/0x170 <- VDUSE_VQ_INJECT_IRQ Allocated by task 2986: do_eventfd+0x50/0x200 __x64_sys_eventfd2+0x2e/0x40 kmalloc-64, freed 64-byte region [ffff8881084e8780, ffff8881084e87c0) One thread loops VHOST_SET_VRING_CALL on /dev/vhost-vdpa-N with a fresh eventfd and then unbinds it, while another loops VDUSE_VQ_INJECT_IRQ on /dev/vduse/. This reproduces in 5 out of 5 ten-second runs on v7.1.6 and 3 out of 3 on v7.2-rc6. With the patch there are no reports in 3 out of 3 runs on either, while the same workload still gets ~30000 interrupts per run delivered into live eventfds, so the path is still being exercised. Tell the parent to drop the callback before vhost_vring_ioctl() can free the eventfd, mirroring what is already done for the bypass producer, and restore it if the ioctl fails -- on failure the swap never happened, the old context is still installed, and leaving the parent without a callback would silently drop that vq's interrupts. Clearing the callback only stops a parent from starting to use the context; a handler that already loaded it can still be running. For parents with a real interrupt, wait for it with synchronize_irq() on the vq's irq. VDUSE does not implement get_vq_irq, so that case stays covered by the teardown above. Fixes: 5e68470f4e80 ("vdpa: Add eventfd for the vdpa callback") Signed-off-by: Yu Zhang Signed-off-by: Michael S. Tsirkin Message-ID: <20260918040436.47982-1-yuz08559@gmail.com> Signed-off-by: Sasha Levin commit 746f654a560e6bc059aab2ce9aea4369bae6fe43 Author: Linfeng Sun Date: Sun Sep 13 21:00:27 2026 +0800 vhost: reject invalid IOTLB update permissions [ Upstream commit b179f21d2d8a60ede29a00472bffdefb0284ef39 ] vhost_chr_write_iter() validates the type and size of an IOTLB update, but does not validate its permission field. An invalid permission can therefore reach perm_to_iommu_flags() and trigger its warning in vhost_vdpa_map(). Reject IOTLB UPDATE messages whose permission field is empty or contains bits outside VHOST_ACCESS_RW before dispatching them to a backend. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Linfeng Sun Signed-off-by: Michael S. Tsirkin Message-ID: <20260913-fix-vhost_chr_write_iter-v1-1-76bf1f436cfe@gmail.com> Signed-off-by: Sasha Levin commit 64607e57eb66ec37ffa69d28ec3463e5ab4a0050 Author: Xiang Mei Date: Sat Sep 12 14:54:01 2026 -0700 vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() [ Upstream commit 1f8824fe7f6eaaf2355404db08d3cd05a28aa576 ] genlmsg_reply() consumes the reply skb on every outcome: netlink_unicast() frees it whether it queues it, drops it, or bails out early. vdpa_nl_cmd_dev_config_get_doit() lets its return value fall through to the shared error label, which calls nlmsg_free(msg) again and double-frees the sk_buff on any reply failure. The failure is reachable unprivileged: VDPA_CMD_DEV_CONFIG_GET carries no GENL_ADMIN_PERM, so batching several requests into one sendto() on a socket with a shrunken SO_RCVBUF fills the receive queue, and netlink_attachskb() then takes its MSG_DONTWAIT path, freeing the skb and returning -EAGAIN. Set msg to NULL once genlmsg_reply() has consumed it so the shared exit path frees the skb only on the early error gotos that still own it; nlmsg_free(NULL) is a no-op. BUG: KASAN: slab-use-after-free in sk_skb_reason_drop (net/core/skbuff.c:1220) Read of size 4 at addr ffff88800d99d49c by task exploit/147 Call Trace: sk_skb_reason_drop (net/core/skbuff.c:1220) vdpa_nl_cmd_dev_config_get_doit (drivers/vdpa/vdpa.c:1324) genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114) genl_rcv_msg (net/netlink/genetlink.c:1194) netlink_rcv_skb (net/netlink/af_netlink.c:2556) genl_rcv (net/netlink/genetlink.c:1218) netlink_unicast (net/netlink/af_netlink.c:1345) netlink_sendmsg (net/netlink/af_netlink.c:1900) __sys_sendto (net/socket.c:2281) __x64_sys_sendto (net/socket.c:2284) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) The buggy address belongs to the object at ffff88800d99d3c0 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of freed 232-byte region [ffff88800d99d3c0, ffff88800d99d4a8) Fixes: ad69dd0bf26b ("vdpa: Introduce query of device config layout") Reported-by: co+6dcbccedc9ec6452@bugs.sh Closes: https://lore.kernel.org/all/ILTHcT8oe1HP47sY25JVxssvKmkCTjYlX9Hs%40bugs.sh/ Assisted-by: Claude:claude-opus-5 Signed-off-by: Xiang Mei Signed-off-by: Michael S. Tsirkin Reported-by: Paul Moses Message-ID: <20260912215401.126194-1-xmei5@asu.edu> Signed-off-by: Sasha Levin commit 030184a353ab2cf6129b1b543fc56478f06f9e65 Author: Maoxia <2312891301@qq.com> Date: Sun Sep 13 02:03:21 2026 +0800 virtio_pci: add missing newline to the pmcsr error message [ Upstream commit 104d58a6d2592898fbb6989732600b07d543a8e5 ] The error message emitted when the PCI power management control register cannot be read is not newline-terminated, so the next kernel message is appended to it on the same line. Add the missing '\n'. Fixes: dff4fa0e5785 ("virtio: Add support for no-reset virtio PCI PM") Signed-off-by: Maoxia <2312891301@qq.com> Signed-off-by: Michael S. Tsirkin Message-ID: Signed-off-by: Sasha Levin commit 5bdb6364085ca00854439fa75ff44204bd7bb537 Author: Linfeng Sun Date: Sat Sep 12 22:59:24 2026 +0800 vhost: fix dirty logging for in-order used ring entries [ Upstream commit bfcde6b64769bc168037b8bd882de4def4b2b3f4 ] With VIRTIO_F_IN_ORDER, one used ring element can represent multiple buffers, so vhost_add_used_n_in_order() can write consecutive elements to nonadjacent slots. Dirty logging combines the initial slot with a length based on the final position, which can miss written elements or log past the end of the ring. Replay nheads[] after the write barrier and log the written slots, coalescing adjacent elements and splitting at gaps and wraps. Fixes: 67a873df0c41 ("vhost: basic in order support") Signed-off-by: Linfeng Sun Message-ID: <20260912-fix-log_write-v1-1-72c23db01268@gmail.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin commit 890a41575b8f51096ca096f495f3273002b9b309 Author: Jia Jia Date: Tue Sep 15 17:42:44 2026 +0800 vhost-scsi: do not relock event vq mutex on send_evt fallback [ Upstream commit a016d03a9cfe29aeeba438f32f8e8f63291e3275 ] vhost_scsi_send_evt() is called with the event virtqueue mutex held. If the worker is gone, the fallback currently calls vhost_scsi_complete_events(), which tries to acquire the same mutex again and deadlocks the caller. Split event completion into a helper for callers that already hold the mutex and a locking wrapper for the event worker. Use the helper on the fallback path. Link: https://lore.kernel.org/all/20260905005352.1E5B01F00A3D@smtp.kernel.org/ Fixes: b1b2ce58ed23 ("vhost-scsi: Handle vhost_vq_work_queue failures for events") Signed-off-by: Jia Jia Reviewed-by: Mike Christie Signed-off-by: Michael S. Tsirkin Message-ID: <20260915094244.7900-3-physicalmtea@gmail.com> Signed-off-by: Sasha Levin commit f10967c81d74e76021d5b6876f1118283f1c949a Author: Jia Jia Date: Tue Sep 15 17:42:43 2026 +0800 vhost-scsi: preserve event ordering [ Upstream commit a9a428115b7d8aa45e12e41899f90f60551bfa82 ] vhost_scsi_send_evt() uses llist_add(), so pending events are LIFO. vhost_scsi_complete_events() walks the detached list directly. This can deliver a later hotplug or hotunplug event before an earlier one. Reverse the detached list before processing it. This keeps delivery in enqueue order. Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support") Signed-off-by: Jia Jia Reviewed-by: Mike Christie Signed-off-by: Michael S. Tsirkin Message-ID: <20260915094244.7900-2-physicalmtea@gmail.com> Signed-off-by: Sasha Levin commit f4ef474a111791116534703e1def811841aa8d88 Author: Linfeng Sun Date: Fri Sep 11 17:00:59 2026 +0800 vdpa: invalidate DMA mappings before releasing memory [ Upstream commit acbf36deb53d9e14e4768bf58883795a8232aa5b ] vdpa can release pinned pages and file references before the device stops using the corresponding mappings, allowing stale DMA to corrupt memory. Invalidate mappings before dropping their backing references. For set_map backends, publish an IOTLB without the invalidated range and keep the old references if that fails. Do this immediately even within a batch. Serialize vdpa_sim set_map updates with its worker so publishing a new map cannot race an active transfer. Abort mlx5 map replacement when resumable virtqueues cannot be suspended, since changing the memory region while those queues remain active would preserve the same stale DMA window. Reject zero-sized and wrapping invalidations before calculating their inclusive range end. I found this bug myself, though the patch was written with AI assistance. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Assisted-by: OpenAI-Codex:GPT-5 Signed-off-by: Linfeng Sun Message-ID: <20260911-fix-vdpa-iotlb-lifetime-v3-2-8766d371748e@gmail.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin commit 1f2cc552643f5b5d20e506b6651c8a552bf09f4c Author: Linfeng Sun Date: Fri Sep 11 17:00:58 2026 +0800 vdpa_sim: serialize IOTLB updates with dataplane access [ Upstream commit 8517ed4429a2eefd002dce00ea46e23e6714350b ] The simulator translates IOTLB entries into iovecs or bvecs under iommu_lock, then drops the lock before copying data. A concurrent DMA unmap can delete the mapping and release its pinned backing pages while the copy is still in progress, leading to a UAF in _copy_from_iter(). Use the existing simulator mutex to serialize DMA map changes with the full backend work function. Also make vhost-vdpa stop device access before unpinning the backing pages. Otherwise, waiting in the simulator DMA unmap callback happens after the pages have already been released and cannot protect their lifetime. Keep iommu_lock for the IOTLB table itself and avoid adding a second long-lived lock to the simulator. I found this bug myself, though the patch was written with AI assistance. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Assisted-by: OpenAI-Codex:GPT-5 Signed-off-by: Linfeng Sun Message-ID: <20260911-fix-vdpa-iotlb-lifetime-v3-1-8766d371748e@gmail.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin commit 848351773b705947be7cafbc8642975a7c05421e Author: Li RongQing Date: Thu Sep 10 20:39:03 2026 +0800 virtio_ring: reset IN_ORDER state in virtqueue_init() [ Upstream commit d7825623a9d4452f97da7ea0d84b2967d507ccf9 ] The IN_ORDER feature uses additional software state to track the next available descriptor and in-flight descriptor batches. virtqueue_init() resets the common virtqueue state, but free_head and batch_last.id are initialized only when the virtqueue is created. When an IN_ORDER virtqueue is reset, these fields can retain state from the previous queue instance. Reset free_head and invalidate batch_last when initializing an IN_ORDER virtqueue. Keep this in virtqueue_init() so the state is initialized consistently for both newly created and reset virtqueues. Fixes: f6a15d854986 ("virtio_ring: add in order support") Signed-off-by: Li RongQing Signed-off-by: Michael S. Tsirkin Message-ID: <20260910123903.1717-1-lirongqing@baidu.com> Signed-off-by: Sasha Levin commit aefce0726d5668749e0776b0c2cc7ff40ff84b51 Author: Karl Mehltretter Date: Wed Sep 9 08:49:38 2026 +0200 virtio-spi: Fix virtio_spi_config kernel-doc [ Upstream commit 62b0a9b11e94a4bc7f67c89348d0619cba82b54b ] struct virtio_spi_config contains max_cs_inactive_ns, but its kernel-doc describes max_cs_incative_ns. This leaves the real member undescribed and adds a nonexistent member to the generated documentation. Correct the spelling. Fixes: 6a1f3390fafe ("virtio-spi: Add virtio-spi.h") Assisted-by: LLM Signed-off-by: Karl Mehltretter Signed-off-by: Michael S. Tsirkin Message-ID: <20260909064938.90995-1-kmehltretter@gmail.com> Signed-off-by: Sasha Levin commit 23214889418d3269d355fb799c76b41a50d37b44 Author: Alex Austin Date: Mon Oct 26 12:30:23 2026 +0000 sfc: ptp: avoid racing PPS timestamp updates [ Upstream commit 23d23e6c6517d0fea4f64340a23e33c89f82c03c ] efx_ptp_pps_worker() can race with SIOCHWTSTAMP via efx_ptp_change_mode(). After the worker completes synchronization, the ioctl can start another synchronization and update host_time_pps while the worker copies it into the PPS event. This can report a partially updated timestamp. Serializing synchronization transactions alone does not protect this copy, which happens after phc_lock is released. Return the timestamp through the caller's own pps_event_time rather than the shared field in efx_ptp_data, so the worker reads storage no one else can write. Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP") Signed-off-by: Alex Austin Reviewed-by: Alejandro Lucero Reviewed-by: Pieter Jansen van Vuuren Link: https://patch.msgid.link/20261026123023.3566549-4-alex.austin@amd.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 28d50d6de488718bc3c935bd6a43eda0058d980a Author: Alex Austin Date: Mon Oct 26 12:30:22 2026 +0000 sfc: ptp: serialize host and MC synchronization transactions [ Upstream commit f707347b33feebdd67633bccea52f96807c18d6e ] efx_ptp_synchronize() clears the MC-ready DMA flag before efx_mcdi_rpc_start() acquires the MCDI interface, and processes results into ptp->timeset[] after efx_mcdi_rpc_finish() has released it. The PPS worker and the hwtstamp enable path can therefore clobber each other's handshake flag and timesets. Hold a PHC mutex across the whole transaction and over the clock operations, so efx_phc_settime() reads and adjusts atomically and current_adjfreq is consistently read and written under one lock. Also bail out when efx_mcdi_rpc_start() fails rather than finishing an RPC that was never acquired. Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP") Signed-off-by: Alex Austin Reviewed-by: Alejandro Lucero Reviewed-by: Pieter Jansen van Vuuren Acked-by: Edward Cree Link: https://patch.msgid.link/20261026123023.3566549-3-alex.austin@amd.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit aa50fb7ef857d4eb05f1b8789fb141d318f74fe6 Author: Alex Austin Date: Mon Oct 26 12:30:21 2026 +0000 sfc: ptp: drop the stale frequency reset in efx_ptp_start() [ Upstream commit 21d4917cfc8b6837c44d8aa186941a6a16ec17a0 ] FW does not touch the clock frequency state on MC_CMD_PTP_OP_DISABLE or MC_CMD_PTP_OP_ENABLE, so the driver doesn't need to either. Doing so just desyncs the driver's cached current_adjfreq from what FW still has programmed. Resetting current_adjfreq to 0 here means the first efx_phc_adjtime() call after efx_ptp_start() reprograms the NIC's clock frequency to 0, since efx_phc_adjtime() always sends current_adjfreq to FW alongside the time step. efx_ptp_start() runs on every SIOCSHWTSTAMP mode change, on ifup, and on the reset_required path in efx_ptp_worker(), so each of those silently drops any frequency correction the PTP servo had already applied. efx_ptp_start() is also reached from reset recovery, but that is fine: on an FLR or PCIe reset FW does not touch the NIC clock, and on a full MC reboot the clock is reset to 1970, so a stale current_adjfreq from before the reset is hardly consequential - especially as it is bound to MAX_PPB, 1000000 ppb. Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP") Signed-off-by: Alex Austin Link: https://patch.msgid.link/20261026123023.3566549-2-alex.austin@amd.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit f7545f38a529914a047830c2c28d7d7d27fa20b6 Author: Namjae Jeon Date: Mon Nov 2 20:47:51 2026 +0900 ntfs: don't allow resident values to overlap the attribute header [ Upstream commit 99afbf38a5c571157526b7b1c6d8dd7ad1a234d5 ] The resident value bounds check allows value_offset to point inside the attribute header. The reported image has an unnamed $DATA attribute with a value_offset of zero and a value_length of two, which passes lookup. Appending to this file makes ntfs_resident_attr_value_resize() shrink the attribute record to eight bytes. Moving the following attributes then overwrites the resident header fields, so the subsequent memset() uses a corrupted value_offset and writes outside the MFT record buffer. Require the resident value to start after the complete resident header. Both lookup paths then return -EIO for the corrupt record, before callers can resize or access its value. Fixes: 495e90fa3348 ("ntfs: update attrib operations") Reported-by: Robert Morris Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 3090f256cd949420a874ff3d7cee430b741eed12 Author: Vladimir Zapolskiy Date: Sun Nov 1 23:24:58 2026 +0200 drm/panel: visionox-r66451: Wait longer after the panel reset [ Upstream commit b4b2778d5e175b166e4a27e5df5d61da468ad004 ] The initialization sequence is sent 10ms after the panel reset is deasserted, however on the SM8350-HDK display card the panel does not answer a DCS read at that time, as a result the panel initialization commands are lost, and the panel does not exit sleep mode and the display stays black. With the first command sent about 15ms after the reset the panel comes up reliably, so wait 20ms after deasserting the reset. Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20261101212458.2431191-3-vz@kernel.org Signed-off-by: Sasha Levin commit 0eda19601797ab7352776516d54631cfb791722a Author: Vladimir Zapolskiy Date: Sun Nov 1 23:24:57 2026 +0200 drm/panel: visionox-r66451: Send the brightness value MSB first [ Upstream commit 00fe6be187ffde738fdb71ea7deb671fc939e583 ] The panel expects to get two bytes of the DCS Set Display Brightness command with the most significant byte first, and it uses the lower 12 bits of the value, use mipi_dsi_dcs_set_display_brightness_large() to correct the programmed brightness values. Tested on the SM8350-HDK display card, the display brightness increases gradually with: for v in $(seq 16 16 4095); do sleep 0.1; \ echo $v > /sys/class/backlight/ae94000.dsi.0/brightness; \ done while without the change the display is dark during all writes. Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20261101212458.2431191-2-vz@kernel.org Signed-off-by: Sasha Levin commit 7eae9defb3cc8726cff48c3c1f87741a0f239087 Author: Daejun Park Date: Fri Oct 30 12:52:44 2026 +0900 erofs: apply the stacked fs check to extra file-backed devices [ Upstream commit e9aeaa63fd94b0d2bb9b303be5774b33ca9c01cf ] erofs_fc_fill_super() rejects a file-backed mount whose image is on a file-backed EROFS or on a filesystem with s_stack_depth set. This bounds the nesting of reads. Extra devices given by device= are not checked. File-backed mounts can still nest through them without limit. Apply the same check to extra devices. Fixes: fb176750266a ("erofs: add file-backed mount support") Signed-off-by: Daejun Park Reviewed-by: Gao Xiang Signed-off-by: Gao Xiang (Docker) Signed-off-by: Sasha Levin commit 137d068cc7d8a95270d96b90addba9ff0f938dfe Author: Daniel Machon Date: Thu Oct 29 12:47:47 2026 +0100 net: lan966x: don't free XDP buffers in fdma tx clear with budget 0 [ Upstream commit 263a5514cb9535380734b5e300b298f82570eb57 ] lan966x_fdma_tx_clear_buf() runs from the NAPI poll and frees the buffers of completed tx DCBs with napi_consume_skb(), page_pool_recycle_direct() and xdp_return_frame_bulk(). netpoll calls the NAPI poll with a budget of 0 and hardirqs disabled. With a budget of 0, a driver cannot call any XDP or page pool API. Before this patch, the XDP_TX pages and ndo_xdp_xmit frames are freed regardless of the budget. With netconsole on the port that owns the FDMA NAPI, such a buffer is freed with hardirqs disabled, and __page_pool_put_page() warns via lockdep_assert_no_hardirq(). Leave the XDP buffers of completed DCBs in place when the budget is 0, and free them in the next NAPI poll. napi_consume_skb() already handles a budget of 0, so skbs are still freed. Found by an AI code review agent. Reproduced on a lan9668 board with a modified kernel that runs the NAPI poll with a budget of 0 and hardirqs disabled. With the fix the warning is gone. Fixes: 19c6f534f636 ("net: lan966x: Add support for XDP_TX") Signed-off-by: Daniel Machon Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261029-lan966x-fdma-tx-clear-budget-v1-1-38c52d7aab8c@microchip.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 4b6631bd4a43cfe3c4ae500927fc8704df152f62 Author: Giuseppe Piscitelli Date: Mon Oct 26 21:25:11 2026 +0100 ata: libata-core: Check device support before querying power state [ Upstream commit ec585ac78742527f80495dd8f451dcda7e9e7f59 ] The standby path queries the power state before checking whether the device accepts ATA power-management commands. This sends CHECK POWER MODE to ATAPI devices, including the QEMU DVD-ROM, which rejects it. Run the existing taskfile initialization and device-class check first, as the active-power path already does. Fixes: 9cec467d0502 ("ata: libata-core: Do not call ata_dev_power_set_standby() twice") Signed-off-by: Giuseppe Piscitelli Reviewed-by: Niklas Cassel Link: https://lore.kernel.org/r/20261026202513.669084-1-ooonea@gmail.com Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 7cc35170975c30596dd52a97db0d3c1db21403e6 Author: Lorenzo Bianconi Date: Tue Oct 27 14:48:41 2026 +0100 net: stmmac: fix XDP RX buffer DMA sync length [ Upstream commit 363ff816277d4c7064514b160e655bed1dfb3ed8 ] stmmac_rx() bounded the DMA sync length by the largest data_end seen before and after the XDP program and passed it to page_pool_put_page() on the XDP_CONSUMED path. bpf_xdp_adjust_tail() zeroes the grown area, which dirties the CPU cache, but a later negative adjust only moves data_end back. If the program grows and then shrinks the tail, both endpoints miss the zeroed range, so those dirty cache lines are not written back before the page is reused. The length was also wrong since commit 88095728511e ("net: stmmac: fix rx Scatter-Gather support") moved the page_pool DMA window to offset 0 and set max_len to dma_buf_sz + page_offset: the driver still subtracted buf->page_offset, so it synced [base, data_end - page_offset) instead of [base, data_end). On a non-coherent platform those dirty lines can be evicted after the device has DMA'd the next frame into the recycled page and corrupt it. Sync the whole page_pool DMA window on the XDP_CONSUMED path with page_pool_recycle_direct(), as the PASS path and page_pool allocation already do. The device only writes [page_offset, page_offset + dma_buf_sz), so syncing [base, base + max_len) covers every cache line it can touch, regardless of how the program adjusted the packet. Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action") Fixes: 88095728511e ("net: stmmac: fix rx Scatter-Gather support") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-6-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit bd007ea5aeda66d5c3033bea99cc3864c3f37102 Author: Lorenzo Bianconi Date: Tue Oct 27 14:48:40 2026 +0100 net: stmmac: fix VLAN tag stripping on short and non-linear RX frames [ Upstream commit 68bdbffcae08699af5c16f7a2ec61a5489b78dbe ] stmmac_rx_vlan() reads the VLAN header straight from skb->data and removes it with skb_pull(), assuming the header is fully present in the linear part of the skb. XDP can change the frame length and head layout before the tag is stripped. An XDP program can use bpf_xdp_adjust_tail() to shrink a frame to as little as ETH_HLEN while bytes 12-13 still contain a VLAN ethertype. The driver then reads h_vlan_TCI past skb->len and pops the tag, leaving less than ETH_HLEN in the skb. eth_type_trans() cannot pull the MAC header, so a malformed skb is passed up. The TCI is also read from the wrong place when the tag is not fully in the linear head, e.g. when it spans into a frag. Read h_vlan_proto after pulling ETH_HLEN into the linear part, and check it together with the device features. Only if the tag is actually going to be popped, pull VLAN_ETH_HLEN and re-derive the header pointer afterwards, as pskb_may_pull() may reallocate the skb head. Return an error so the callers can drop a frame that claims a VLAN tag but cannot provide the full header. This also drops and counts frames shorter than ETH_HLEN in rx_dropped, even when VLAN RX offload is disabled; bpf_xdp_adjust_head() and bpf_xdp_adjust_tail() cannot produce such a frame, so it only affects a runt that reaches the driver, and dropping it is safer than handing it to eth_type_trans(). Also move the XDP metadata written with bpf_xdp_adjust_meta() together with the MAC header when the tag is popped, so data_meta still points at the metadata after eth_type_trans() anchors mac_header, instead of at the first bytes of the destination MAC. Fixes: 5fabb01207a2 ("net: stmmac: Add initial XDP support") Reviewed-by: Nicolai Buchwitz Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-5-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit e04314bb574107b98d0eae6617e8a5af2ff4b453 Author: Lorenzo Bianconi Date: Tue Oct 27 14:48:39 2026 +0100 net: stmmac: copy XDP metadata in AF_XDP zero-copy RX [ Upstream commit 41d78e9ac0984f0e9577e5312e62400b5a6760c8 ] stmmac_construct_skb_zc() reserves headroom for the XDP metadata and records the length reported by the XDP program, but only copies the packet data starting at xdp->data. The bytes in [xdp->data_meta, xdp->data) are never copied into the new skb, so the skb advertises metadata that is not there: after eth_type_trans() anchors mac_header, data_meta points at uninitialized headroom instead of what the program wrote. Copy the metadata together with the packet data starting at xdp->data_meta, leaving skb->data at the start of the frame and the metadata immediately before it, and record its length. This keeps data_meta valid for the stack and TC BPF after eth_type_trans() anchors mac_header. Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-4-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 10f01285eb9db4a92ecb927273dd332e217265ac Author: Lorenzo Bianconi Date: Tue Oct 27 14:48:38 2026 +0100 net: stmmac: drop multi-buffer frames in XDP mode [ Upstream commit 52ffd771e0029c5ad0504b1b4a8b7f932b65eea3 ] stmmac_rx() runs the XDP program once per descriptor buffer and uses skb == NULL as the only marker for the start of a frame. A frame larger than one buffer is split by the hardware across several descriptors; GMAC4 enables jumbo frames unconditionally (GMAC_CONFIG_JE in GMAC_CORE_INIT), so an on-link peer can deliver such a frame even when the interface MTU is left at 1500. When an XDP verdict ends a non-last descriptor, skb is cleared and the next descriptor of the same hardware frame is parsed as a new frame. For XDP_CONSUMED this happens via read_again with len preserved, so stmmac_rx_buf1_len() then returns min(dma_buf_sz, plen - len) for the last descriptor, which can be as small as 0-3 bytes. buf1_len -= ETH_FCS_LEN underflows and xdp_prepare_buff() puts data_end far past data; on XDP_PASS this produces an skb whose length is close to 4G that reaches the network stack (skb->tail and skb->len are 32-bit and wrap below skb->end, so skb_over_panic() does not fire). A 4+ byte tail is instead offered to the XDP program and delivered as a standalone mid-payload Ethernet frame on XDP_PASS. XDP_TX/XDP_REDIRECT instead falls through to the next iteration, resetting the running length, so the tail is re-parsed as a full-size new frame. The same fault exists when a single descriptor uses its second buffer: buffer2 is now handed to the hardware for non-SPH frames on GMAC4/XGMAC, so a frame up to 2 * dma_buf_sz can land on a single descriptor while the XDP program still only sees the first buffer. XDP_TX then transmits a truncated frame, and XDP_PASS appends the second buffer only after the program has already run over the first one. XDP does not support scatter-gather frames until the multi-buffer rework, so drop the whole frame instead. When a non-last descriptor is seen while an XDP program is attached, mark the frame as errored and drain the remaining descriptors, including the last. A descriptor that uses its second buffer is dropped directly before the program runs as well; in XDP mode it is necessarily the last descriptor of the frame, so it does not need the error marker. Removing the re-parse lets both XDP verdict branches simply complete the packet via next. The buffers consumed by the discard path are no longer returned to the page pool, and the new SG and second-buffer drops do not return them either. They stay in rx_q->buf_pool[] and stmmac_rx_refill() reuses them in place, allocating only when a slot is empty. This is safe because the drop checks run before the buffer is synced for CPU access or prefetched. The discard-path change and the in-place reuse apply with or without an XDP program attached. The !error guard on the discard check also changes the accounting for errored multi-descriptor frames on dwmac100/dwmac1000: rx_errors is incremented once per frame instead of once per descriptor. This too is independent of XDP mode. Note: the subsequent "net: stmmac: rework stmmac_rx to support XDP rx multi-buff" accumulates the whole frame into a single xdp_buff and supersedes this patch; the fix is kept so the net portion of the series stands on its own. Fixes: 5fabb01207a2 ("net: stmmac: Add initial XDP support") Fixes: 88095728511e ("net: stmmac: fix rx Scatter-Gather support") Reviewed-by: Nicolai Buchwitz Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-3-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 9c9f4840f79ac076199347197cf75f0736f20a39 Author: Lorenzo Bianconi Date: Tue Oct 27 14:48:37 2026 +0100 net: stmmac: drop split frames on AF_XDP zero-copy RX [ Upstream commit 834ec95308320cbd8c162d86788ab95cc3fd6bf8 ] stmmac_rx_zc() assumes a 1:1 mapping between a received frame and an XSK pool buffer and drops any frame that spans more than one RX descriptor: /* XSK pool expects RX frame 1:1 mapped to XSK buffer */ if (likely(status & rx_not_ls)) { xsk_buff_free(buf->xdp); buf->xdp = NULL; dirty++; count++; goto read_again; } The non-last descriptors are freed and dropped, but the frame is not marked as errored. When the poll reaches the last descriptor of the same frame, error is still 0, so the fragment is handled as a complete frame: it is passed to the XDP program, copied into an skb on XDP_PASS, or converted for XDP_TX. The tail starts in the middle of the original payload at a predictable offset and, parsed as a fresh frame (len == 0), stmmac_rx_buf1_len() reports the full dma_buf_sz length for it even though the DMA engine only wrote the tail remainder into that buffer, so the reads extend past the received bytes and can reach beyond the end of the XSK pool buffer. GMAC4 always enables jumbo frames (GMAC_CONFIG_JE in GMAC_CORE_INIT), so an on-link peer can trigger such a split even when the interface MTU is left at 1500. Set error when the 1:1 mapping check drops a descriptor, so the remaining descriptors of the frame - including the last one - are drained and released with xsk_buff_free() instead of being processed as a new frame. Account every freed buffer with dirty and count the dropped frame once in the poll budget / rx_pkt_n. The direct 1:1 mapping drop also increments rx_dropped. Use a bit test instead of an equality test for discard_frame. Commit 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors in status") made dwmac4_wrback_get_rx_status() set discard_frame on RDES3_ERROR_SUMMARY and OR in csum_none on RDES1_IP_HDR_ERROR or RDES1_IP_PAYLOAD_ERROR, so it can return discard_frame | csum_none. The old "status == discard_frame" test missed that value and delivered frames with CRC, overflow, watchdog or giant errors to the stack in stmmac_rx() - or to XDP/XSK in stmmac_rx_zc() - when they also failed the IP checksum. The change therefore affects the regular RX path, not only zero-copy. The bit test is also required for the discard_frame | rx_not_ls value returned for non-last legacy descriptors below. Normalize the legacy normal and enhanced descriptor callbacks to report rx_not_ls together with discard_frame for non-last descriptors. This allows both stmmac_rx_zc() and stmmac_rx() to drain split frames on dwmac100 and dwmac1000 instead of reparsing the final fragment as a new packet. Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") Fixes: 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors in status") Reviewed-by: Nicolai Buchwitz Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-2-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit e0abe47f4db994354d5b8d54fc20540cdd13258c Author: James Hilliard Date: Tue Oct 27 14:48:36 2026 +0100 net: stmmac: take ownership of saved RX state at poll entry [ Upstream commit 26219e9402c22181f021034f127a8e278d40545f ] When a saved partial packet completes with a poll budget of one, the old loop can leave state_saved and state.skb pointing at an skb that has already been delivered or freed. The next poll then reuses that pointer, causing a use-after-free or double free. Take the saved state at poll entry and clear the stored ownership immediately. Save it again only if the packet remains incomplete, including when the next descriptor is still DMA-owned. Track the frame-in-progress flag independently of the status read from the next descriptor. The old code keyed the save on the status of the last descriptor looked at, so a loop stopped at a DMA-owned descriptor (rx status not yet valid) could drop the saved error/length bookkeeping in stmmac_rx_zc(). Drop the saved state both when the queue parameters are reset and when the ring is destroyed. stmmac_reset_rx_queue() is reached from __stmmac_open(), stmmac_xdp_open(), stmmac_resume() and stmmac_enable_rx_queue(); without draining it there, a partial frame saved before suspend (or before a queue is disabled and re-enabled) survives while cur_rx and dirty_rx are rewound to zero. On the resume path the ring is only re-armed in place: stmmac_clear_descriptors() sets the ownership bits and stmmac_init_dma_engine() restores the tail pointer, but the RX buffer addresses are not reprogrammed. The first poll would then resume the stale skb against a ring position that no longer matches the descriptors it was built from. __free_dma_rx_desc_resources() releases it on teardown. Apply the same state handling to stmmac_rx_zc(), which also leaves state_saved set when a saved frame finishes at the budget boundary. That path saves only error and length bookkeeping, not an skb pointer. Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support") Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") Signed-off-by: James Hilliard Reviewed-by: Nicolai Buchwitz Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-1-10eae8a093a8@oss.qualcomm.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 84691bd1f10ba5bacb0751cbef765ea0364a7776 Author: Niklas Cassel Date: Fri Oct 30 10:00:48 2026 +0100 ata: libata-eh: Retry non-NCQ commands when their sense data asks for it [ Upstream commit 597be4104c4045d73979c05307fa5fc778d1dbde ] When a failed command has valid sense data, ata_eh_analyze_tf() asks scsi_check_sense() whether the command should be retried, and sets ATA_QCFLAG_RETRY if it should. ata_eh_link_autopsy() then clears AC_ERR_DEV and AC_ERR_OTHER from qc->err_mask, relying on that decision. For an NCQ command, qc->err_mask still has AC_ERR_NCQ, so ata_eh_finish() honors ATA_QCFLAG_RETRY. For a non-NCQ command, whose sense data comes from REQUEST SENSE DATA EXT, qc->err_mask is now zero, and ata_eh_finish() completes the command with scmd->retries set to scmd->allowed, without looking at ATA_QCFLAG_RETRY. Such a command is thus never retried, even when its sense data asks for a retry, e.g. a transient error reported as ABORTED COMMAND. Make ata_eh_finish() honor ATA_QCFLAG_RETRY for commands with valid sense data. ata_eh_qc_retry() cannot be used for this: as qc->err_mask is zero, it increments scmd->allowed, so every retry would allow one more, and a persistent error would be retried forever. Instead, complete the command without touching scmd->allowed or scmd->retries, so that the SCSI midlayer retries it at most scmd->allowed times, like any other failed command. Fixes: 3852e3738266 ("libata: evaluate SCSI sense code") Reviewed-by: Igor Pylypiv Link: https://lore.kernel.org/r/20261030090047.407906-2-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit e8e461b783f29128013a531d430b6baf01318d3a Author: Igor Pylypiv Date: Thu Oct 29 11:44:45 2026 -0700 ata: libata-sata: allow re-enabling NCQ with the same queue_depth [ Upstream commit d7c5cc8cc21c1264cce07feb4a51be158688280e ] When ata_eh_speed_down() disables NCQ due to excessive errors, it sets ATA_DFLAG_NCQ_OFF without changing sdev->queue_depth. Userspace can re-enable NCQ by writing a queue depth > 1 to the sysfs queue_depth attribute, which invokes ata_change_queue_depth() to clear ATA_DFLAG_NCQ_OFF. However, ata_change_queue_depth() returns early if the requested queue_depth is equal to sdev->queue_depth before clearing ATA_DFLAG_NCQ_OFF. As a result, writing a different queue depth > 1 re-enables NCQ, whereas writing the current sdev->queue_depth value leaves ATA_DFLAG_NCQ_OFF set. Since ata_change_queue_depth() already checks whether queue_depth equals sdev->queue_depth before calling scsi_change_queue_depth(), remove the early check so that writing the current queue_depth > 1 clears ATA_DFLAG_NCQ_OFF and re-enables NCQ. Fixes: 45623d33bfc0 ("ata: libata-sata: Improve ata_change_queue_depth()") Signed-off-by: Igor Pylypiv Reviewed-by: Niklas Cassel Link: https://lore.kernel.org/r/20261029184445.1615717-1-ipylypiv@google.com Signed-off-by: Niklas Cassel Signed-off-by: Sasha Levin commit 22418c15c09362f66294bb97a59b78546d46c052 Author: Eric Dumazet Date: Wed Oct 28 19:08:20 2026 +0000 tcp: do not let tcp_collapse() drive sk_forward_alloc negative [ Upstream commit 031c403d13e5046750e2abebd4e770631e7c4627 ] tcp_collapse() charges each newly allocated skb with skb_set_owner_r() before the skbs it replaces are freed, without scheduling memory first. Since sk_mem_uncharge() reclaims eagerly, sk->sk_forward_alloc has no cushion and can become negative. This can be durable when the collapsed skbs had a high payload/truesize ratio or were partially read, because the new skbs can have a bigger total truesize than the old ones. A negative sk_forward_alloc then confuses tcp_wmem_schedule(), which can return a negative length to tcp_sendmsg_locked(), triggering a WARN_ON_ONCE(bytes > INT_MAX) in check_copy_size(). Call sk_forced_mem_schedule() before charging nskb. Fixes: 4890b686f408 ("net: keep sk->sk_forward_alloc as small as possible") Signed-off-by: Eric Dumazet Reviewed-by: Kuniyuki Iwashima Signed-off-by: Octavian Purdila Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit d901082ed3a244ab087a2a2829dd89e3cbb595a4 Author: Cen Zhang (Microsoft) Date: Wed Oct 28 12:00:18 2026 -0400 ipv6: fix fib6 walker UAF on NLM_F_REPLACE [ Upstream commit 23fec4bd76904e9df7a8cc0a81ceb14c36971da4 ] fib6_walker uses w->leaf to remember the next fib6_info to dump, so an RTM_GETROUTE dump can continue there on the next recvmsg(). This assumes that whoever removes a route from the tree also updates the walkers pointing at it. fib6_del_route() does: it moves w->leaf to the next route. The NLM_F_REPLACE branch of fib6_add_rt2node() does not: it removes the old route, fib6_add() frees it, and w->leaf keeps pointing at the freed object. The fn_sernum version check in fib6_dump_table() normally protects against resuming on a stale w->leaf, but it can be bypassed: ip6_link_failure() resets fn_sernum to -1 when the default route fails, which an unprivileged user in a user+net namespace can cause: 1) link failure fn_sernum = -1 2) dump pauses on route R 3) replace R fn_sernum changed, R freed 4) link failure fn_sernum = -1 5) dump resumes -1 == -1, reads freed R <- UAF BUG: KASAN: slab-use-after-free in rt6_fill_node+0x1c22/0x2cd0 Read of size 4 at addr ff11000011fa0064 by task poc/101 rt6_fill_node <- rt6_dump_route Fix by adjusting walkers separately for replacement and deletion. For replacement, add fib6_walkers_replace_leaf() points w->leaf at the new route. For deletion and ECMP sibling removal, fib6_walkers_skip_rt() calls fib6_walkers_replace_leaf() with the next route. Reset w->skip_in_node when updating w->leaf, and set w->state to FWS_U when no next route remains. Fixes: 4a287eba2de3 ("IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag") Cc: AutonomousCodeSecurity@microsoft.com Signed-off-by: Cen Zhang (Microsoft) Reviewed-by: Ido Schimmel Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit defc4b45be03b4ddd2b48cd24c2a6caecb77dfb1 Author: Shawn Guo Date: Wed Oct 28 20:34:48 2026 +0800 gpio: shared-proxy: Drop the vote when switching to input [ Upstream commit 925409db963dbae4628d522bc6b14985e749c08b ] A proxy that is the only one to have configured a shared line may reinitialize it. When it sets the direction to output, the proxy resets the vote tally, but when it sets the direction to input, it leaves any vote it cast in place, although an input line carries no value. That vote outlives its meaning. When the consumer releases the line, gpio_shared_proxy_free() tries to withdraw it by writing the default value, which gpiolib refuses on an input line: Failed to unset the shared GPIO value on release: -1 This happens, for instance, when a consumer votes for a change with gpiod_set_value() after setting the line to output and then switches it to input. Clear the vote when the proxy reinitializes the line as input, as the output path already does. No other proxy can hold a vote at that point: voting marks a proxy configured, and a proxy that frees the line drops its vote. Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver") Signed-off-by: Shawn Guo Link: https://patch.msgid.link/20261028123448.510401-5-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 8b12a5fffcec29ff0e40edd6624554fae5973aee Author: Shawn Guo Date: Wed Oct 28 20:34:47 2026 +0800 gpio: shared-proxy: Drive the default value when no votes are cast [ Upstream commit 0bc45604403176722e634e670f5e38de0aa42a9b ] A consumer that requests a shared line with GPIOD_ASIS never calls direction_output(), so def_val keeps its initial value of 0. If the line was left high, for instance by the bootloader, a later gpiod_set_value(0) from that consumer matches def_val and the proxy treats it as withdrawing a vote it never cast. It returns success without writing the hardware, and the line stays high. The consumer has no way to tell. Its request to drive the line low is silently ignored until it first votes for high and then withdraws that vote. When the requested value is the default and no votes are outstanding, write it to the hardware instead of returning early. With votes outstanding the request remains a no-op, as the line must stay at the voted value. Do this for all lines, not only GPIOD_ASIS ones. A line configured via direction_output() can be left at the non-default value as well: when a proxy releases the line and restoring the default fails, its vote is dropped regardless, leaving votecnt at 0 with the line at the voted value. The write lets any remaining user bring it back to the default. In the common case it is a redundant write of the value the line already has, and it only happens when a proxy that has not voted sets the default. Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver") Signed-off-by: Shawn Guo Link: https://patch.msgid.link/20261028123448.510401-4-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 8ff1f54370d6367d787113fc5c03d08ee473f4c0 Author: Shawn Guo Date: Wed Oct 28 20:34:46 2026 +0800 gpio: shared-proxy: Drop the vote of a released proxy on write failure [ Upstream commit 53b7b1201964f6f147fa0fa2f61194403a65cdf0 ] When a proxy that voted for a value change frees the line, it calls gpio_shared_proxy_set_unlocked() to withdraw its vote. If it is the last voter and restoring the default value fails, that function returns early, leaving votecnt incremented and voted_change set. The consumer is gone, but its vote is not. The line is held at the non-default value for all remaining users, since votecnt can never drop to zero again. And the proxy data outlives the request, so voted_change is still set when the line is requested again. If another user has reinitialized the line in between, resetting votecnt to 0, the stale proxy's next vote for the default value decrements votecnt from 0 and underflows it. Drop the vote unconditionally on release, after reporting the failure, since the consumer is going away regardless. Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver") Signed-off-by: Shawn Guo Link: https://patch.msgid.link/20261028123448.510401-3-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 56fe4c279e335488e7404391123e156ded074cd9 Author: Shawn Guo Date: Wed Oct 28 20:34:45 2026 +0800 gpio: shared-proxy: Fix race between concurrent first users [ Upstream commit eb70d2419e79b6720fd465b905a2dddd751f2a48 ] The proxy lets a consumer set the line direction and reset the default value and vote tally only when usecnt == 1, i.e. when it is the sole requester. But request() and direction_output() take the descriptor mutex separately. When two consumers probe concurrently, both request the line before either configures it, both see usecnt == 2, both fall into the shared path, read back the still unconfigured direction (input) and fail with -EPERM. On Nord RRD the two DAC supplies are reg-fixed-voltage regulators sharing tlmm GPIO 41. They probe asynchronously and intermittently both fail, leaving the codecs without supplies: reg-fixed-voltage regulator-3p3-dac: setup of GPIO (default) failed: -1 reg-fixed-voltage regulator-5p0-dac: setup of GPIO (default) failed: -1 Requesting the line is not evidence that a consumer has claimed it. Instead, count proxies that have actually configured the line (set its direction or voted for a value) in a new cfgcnt, with a per-proxy configured flag, and allow (re)initialization only while no other proxy has done so. A consumer obtained with GPIOD_ASIS that votes via gpiod_set_value() without ever setting the direction counts as configured, so a later user can never reset def_val/votecnt behind its vote. The count is dropped when the proxy frees the line. Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver") Signed-off-by: Shawn Guo Tested-by: Marek Szyprowski Link: https://patch.msgid.link/20261028123448.510401-2-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 4f79d94b938a4765a5b2f8e99981f4af385ed860 Author: Vlad Poenaru Date: Wed Oct 28 04:49:33 2026 -0700 bnxt_en: Don't keep MSI-X vectors added before FW reserves them [ Upstream commit af449230bd8de936d6e4f759240e787b9aad7cc0 ] When dynamic MSI-X is supported, bnxt_check_rings() grows the MSI-X vectors with bnxt_change_msix() once FW says the new rings would fit, and keeps them. FW only reserves the extra IRQs later, when bnxt_reserve_rings() calls __bnxt_reserve_rings(). The MSI-X table entries beyond the function's reserved IRQs are not backed until then: the MSI message written when the new vectors are activated is lost, and the entries read back as zero. After FW reserves them they are live but still zero, so the NQ rings bound to them signal address 0 and every completion on those rings is lost. The next ring change (for example ethtool -G) then times out freeing each of those rings and the TX watchdog fires: bnxt_en 0002:01:00.0 eth0: Resp cmpl intr err msg: 0x51 bnxt_en 0002:01:00.0 eth0: hwrm_ring_free type 1 failed. rc:fffffff0 err:0 ... bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 17: transmit queue 18 timed out 5716 ms On x86 this is hidden: GENERIC_IRQ_RESERVATION_MODE makes the PCI MSI domains MSI_FLAG_MUST_REACTIVATE, so the message is composed and written again when the IRQ is requested, after FW has reserved the vector. Since commit 0d6a7c417983 ("irqchip/gic-v3-its: Enable dynamic MSI-X allocation"), arm64 GICv3 systems take the dynamic path as well, but write the message only once, at allocation. On an NVIDIA Grace system with a BCM57508, raising the channel count from 18 to 32 left MSI-X entries 18-31 all zero, and the 14 rings using them lost their interrupts. Keep the allocation in bnxt_check_rings() as a check that enough vectors are available, but free the new vectors again right away when FW manages IRQ reservations (BNXT_NEW_RM). bnxt_reserve_rings() then allocates them after __bnxt_reserve_rings() has reserved them. Without BNXT_NEW_RM there is no IRQ reservation and bnxt_reserve_rings() does not grow the vectors, so keep the current behaviour there. In bnxt_reserve_rings(), size that allocation from the rings FW actually reserved (bnxt_get_num_msix()) instead of the count computed before the reservation, so that a partial grant does not activate unreserved entries either, at least while no RoCE driver is registered. The allocation can now fail after FW has committed the reservation. A later open would then find nothing to reserve and return before growing the vectors, and bnxt_request_irq() would use irq_tbl[] entries past bp->total_irqs, which still hold the freed virqs. Grow the vectors in that case as well, and clear irq_tbl[].vector when trimming. Fixes: 2d51eb0bd81c ("bnxt_en: Add MSIX check in bnxt_check_rings()") Reported-by: Andrew Preece Closes: https://lore.kernel.org/all/20261022193620.2152038-1-vlad.wing@gmail.com/ Signed-off-by: Vlad Poenaru Reviewed-by: Michael Chan Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit b02eb2580484d027f34d4c8ec060d9c6d922de0c Author: Joas Antonio dos Santos Date: Tue Oct 27 18:17:06 2026 -0300 net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period [ Upstream commit 902407bc588575af0ceae5de4f635fe1e024f258 ] macsec_fs_id_del() removes a struct mlx5_fs_id from its rhashtable with rhashtable_remove_fast() and then frees it with kfree() right away. The TX (SCI) table is read locklessly from the transmit path: mlx5e_macsec_handle_tx_skb() and mlx5e_macsec_tx_build_eseg() call mlx5_macsec_fs_get_fs_id_from_hashtable(), which does rhashtable_lookup() under rcu_read_lock() and then reads mlx5_fs_id->id. A transmit that looked the entry up just before it was removed reads freed memory. Before commit d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering") the SCI table held struct mlx5e_macsec_sa directly, and mlx5e_macsec_del_txsa() freed it with kfree_rcu_mightsleep(). That commit moved the table into macsec_fs.c with the new struct mlx5_fs_id, but frees it with a plain kfree(). Add an rcu_head to struct mlx5_fs_id and free it with kfree_rcu(). The same issue was flagged by the Sashiko AI review as a pre-existing problem while reviewing the HW-GRO for PSP series. Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering") Link: https://lore.kernel.org/all/20260909065542.4B80D1F00ACA@smtp.kernel.org/ Signed-off-by: Joas Antonio dos Santos Assisted-by: Yaga Agent HackerSec Claude:claude-opus-5-5 Reviewed-by: Simon Horman Signed-off-by: Dave Miller Signed-off-by: Sasha Levin commit f2924da5a444b36a0d50b4d7c9c8644c30abe1e3 Author: Animesh Manna Date: Mon Oct 26 13:58:46 2026 +0530 drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable() [ Upstream commit 0a5bad4cd8b87b8d575e3efccaa06c02158db32f ] hsw_crtc_disable() disables CMTG at the very start of the CRTC disable sequence, before intel_encoders_disable(). With this ordering, the wait for CMTG_STATE to clear after CMTG_ENABLE is cleared intermittently times out: xe 0000:00:02.0: [drm] CMTG: A disable timeout WARNING: drivers/gpu/drm/i915/display/intel_cmtg.c:205 intel_cmtg_disable+0x331/0x3d0 [xe] This is seen with igt@kms_hdr@bpc-switch-suspend, which repeatedly disables and re-enables the eDP across modesets and suspend/resume. Move the CMTG disable after intel_encoders_disable(), so the eDP-side teardown (panel unprepare, ALPM disable, backlight off) has completed, but keep it before intel_encoders_post_disable() and intel_dpll_disable(). The transcoder timing generator, DDI buffer and port PLL are therefore still running while CMTG_STATE is polled, and the requirement to disable CMTG before the transcoder and the port PLL feeding it are turned off is preserved. v2: - Modify commit description regarding PSR exit. [Dibin] - Add fixes tag. [Jani, Dibin] v3: - Add a cover letter with links to v1 and v2 for the review history. [Dibin] Fixes: c588a324183b ("drm/i915/cmtg: Add trigger to enable/disable cmtg") Signed-off-by: Animesh Manna Reviewed-by: Dibin Moolakadan Subrahmanian Link: https://patch.msgid.link/20261026082906.802048-2-animesh.manna@intel.com (cherry picked from commit f85fb6e8fd6cf7802285ccd2dbcb631efca8303f) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin commit c2e8dc2ecb8cc6d03108f304fbbf74eebcfc00c9 Author: Suraj Kandpal Date: Thu Oct 22 09:35:29 2026 +0530 drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step [ Upstream commit f704594d36809780cf41fb201729dc1ac352c5d4 ] The hardware issue which required us to keep vtotal as 0 has since been fixed on B0 well, so applying the workaround there is no longer correct and causes issues on B-stepping. Restrict the workaround to A-step only, in both transcoder timing paths and in the crtc_vtotal readout fixup in intel_vrr_get_config(). Fixes: a78d11e7859b ("drm/i915/display: Skip TRANS_VTOTAL.Vtotal write on NVL pre-C0") Signed-off-by: Suraj Kandpal Reviewed-by: Mitul Golani Link: https://patch.msgid.link/20261022040528.1403569-1-suraj.kandpal@intel.com (cherry picked from commit b749007b1ed67bc5482d15d3a1f6fe74555a81df) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin commit eeb76b21f13aea28d9123feaeaf03cde7db681c0 Author: Yuqiang Sun Date: Mon Nov 2 02:23:43 2026 +0800 bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom [ Upstream commit 5e96760b25fdedbbf9312827f1f237d6b18b03e8 ] When an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that the skb still has room for the link layer header. If pskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without freeing the skb. Its callers, lwtunnel_xmit() and then ip_finish_output2() or ip6_finish_output2(), take any return value other than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been consumed, so nothing frees it. Each such failure leaks the skb, together with what it holds: its dst and its charge to the sending socket, so the socket is never freed either. The other error paths of bpf_xmit() (BPF_DROP, an illegal return code, a changed protocol, a failed reroute) all free the skb. Free it here too. The leak was found with kbound, a static analysis prototype for ownership mismatches at kernel interfaces, on v7.2.12; it is present in mainline. Build-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new warnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a dummy device with an LWT xmit program that pushes one byte with bpf_skb_change_head(), so the headroom check has to expand the head, and failslab limited to allocations under bpf_xmit(). Each of 10 pings then fails with ENOMEM. Without this patch each leaves a raw socket behind (RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else is reported. Without injection both kernels go from 6 to 6. Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure") Signed-off-by: Yuqiang Sun Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101182343.17991-1-izaiahsun@gmail.com Signed-off-by: Sasha Levin commit d5e5bded9a03c4cca477913b08bc7d1f565ca061 Author: Michał Kopeć Date: Sat Oct 17 11:03:51 2026 +0200 firmware: coreboot: Don't skip CBMEM entries outside of known memory [ Upstream commit e094fd05defaf0b05774ea1c65fc2d0ab798c809 ] coreboot leaves CBMEM out of the /memory node of the device tree that it passes to FIT payloads, e.g. LinuxBoot on arm64 Chromebooks, and only lists it in the memory reservation block. The kernel has no resource for that memory, so region_intersects() reports it as neither System RAM nor Reserved memory, and since commit e31ecda9e3af ("firmware: coreboot: Skip no-map CBMEM entries") all CBMEM entries are skipped on such boards. That loses the coreboot log, the TPM event log and everything else that CBMEM devices expose. Also accept entries that don't intersect any memory resource. No-map regions are still skipped, as they are IORESOURCE_MEM resources, as are device regions. Fixes: e31ecda9e3af ("firmware: coreboot: Skip no-map CBMEM entries") Signed-off-by: Michał Kopeć Link: https://lore.kernel.org/r/20261017090351.1266064-1-michal@nozomi.space Signed-off-by: Tzung-Bi Shih Signed-off-by: Sasha Levin commit 7285a65314f9ad68928d7f1938f2ace0be98e140 Author: Rosen Penev Date: Sun Nov 1 12:01:55 2026 -0800 spi: acpi: only look up the IRQ of confirmed SPI devices [ Upstream commit 2d0953ab69d316589624b0517fdce01f8e630bf0 ] When an SPI controller is registered, acpi_register_spi_device() is called for every present ACPI device in the namespace and acpi_spi_device_alloc() walks each device's _CRS. While doing so, acpi_spi_add_resource() converts the first interrupt resource it finds, even for devices that have no SpiSerialBus resource at all and are discarded right afterwards. Converting an interrupt resource registers its GSI, so this maps IRQs for arbitrary unrelated ACPI devices. On a Dell Precision M4800 (Lynx Point, 24-pin IOAPIC) the DSDT reports Haswell-ULT LPSS child devices (\_SB.PCI0.I2C0.ACD0 and \_SB.PCI0.SDHC.WI01) as present with interrupts on GSI 37 and 38. Registering the intel-spi controller then results in: ERROR: Unable to locate IOAPIC for GSI 37 ERROR: Unable to locate IOAPIC for GSI 38 Do what the I2C core does and only parse the interrupt resource once the device has been identified as an SPI device on this controller. Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace") Signed-off-by: Rosen Penev Link: https://patch.msgid.link/20261101200155.15740-1-rosenp@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit a5aea968530ebbd31b5c96cfbc164e28ef232343 Author: Alban Bedel Date: Thu Oct 1 17:35:07 2026 +0200 spi: Fix ACPI SPI resources using relative path [ Upstream commit 4825287f6d2346e9273f35a928d1ef40e68bc58b ] ACPI resources can use relative path when pointing to other resources. This didn't work with SPISerialBus resources because the device defining the resource was not passed to acpi_get_handle(). Pass the ACPI device handle through the lookup context to also allow for relative paths. Signed-off-by: Alban Bedel Link: https://patch.msgid.link/20261001153507.2011806-1-alban.bedel@lht.dlh.de Signed-off-by: Mark Brown Stable-dep-of: 2d0953ab69d3 ("spi: acpi: only look up the IRQ of confirmed SPI devices") Signed-off-by: Sasha Levin commit 3166808970ee27326ae73340f44685704a36e3b9 Author: James Calligeros Date: Sat Oct 31 14:56:15 2026 +1000 ASoC: tas2770: Configure transmit clock edge when setting DAI format [ Upstream commit 72da22e9cc380ecda175983d2a17b4494a4b9d15 ] On reset, TAS2770 is configured to transmit on the falling edge of the I2S clock. If BCLK is inverted, we are also receiving on the falling edge. This can cause data leaving the codec to be corrupted. Transmit should happen on the rising edge of the clock when receiving on the falling edge, and vice versa. Fix up tas2770_set_fmt to take into account the BLCK polarity and always transmit on the correct edge of the clock. This fixes corrupted VISENSE data on Apple Silicon platforms at sample rates above 48 kHz. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: James Calligeros Link: https://patch.msgid.link/20261031-tas2770-sdout-clkedge-v2-1-afeeba781cbb@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 280c120c9dac35f7a22589303cc90b8a00e6fde8 Author: Chris Mason Date: Sun Nov 1 19:05:35 2026 +0000 bpf: Check the offset in bpf_skb_generic_{push,pop}() [ Upstream commit ee36c9aa44ef300cd651074bd97552b229337f85 ] To make room for len bytes at offset off, bpf_skb_generic_push() moves the first off bytes and clears len bytes after them. It assumes that the first off bytes are in the linear part. But in bpf_skb_adjust_room() off can be the end of the IP header, and this header can be in a frag. Then the function reads and writes after skb->tail, and can damage skb_shared_info. bpf_skb_generic_pop() checks off + len, but this u32 sum can wrap to a small value. bpf_skb_adjust_room() and bpf_skb_change_proto() calculate off from skb_mac_header_len(). This length is a very large u32 when network_header < mac_header. Then the check can pass, and memmove() reads and writes far outside the skb. Return -ENOMEM from both functions, like the present check, when off > skb->len. Thus the sum cannot wrap. In bpf_skb_generic_push() also pull the first off bytes into the linear part. Now bpf_skb_adjust_room() fails when a prog grows an skb that ends before off. network_header stays wrong. Fixes: 6578171a7ff0 ("bpf: add bpf_skb_change_proto helper") Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-28-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 70f8dcb65299393ab599a495d3a8e3c84f39a607 Author: Chris Mason Date: Sun Nov 1 19:05:34 2026 +0000 bpf: Use the inner transport header after a decap [ Upstream commit 33be492c2e239de8c525254e593357ae5e80852d ] If skb->encapsulation is set, qdisc_pkt_len_segs_init() reads the TCP header of a GSO packet at skb->inner_transport_header. Otherwise it uses skb->transport_header. A decap with BPF_F_ADJ_ROOM_DECAP_L4_{GRE,UDP} removes the outer transport header. It clears skb->encapsulation if no tunnel flag remains in gso_type. The result in BPF_ADJ_ROOM_MAC mode is: before | MAC | outer IP | GRE | inner IP | TCP | payload transport_header ^ ^ inner_transport_header after | MAC | inner IP | TCP | payload transport_header ^ ^ inner_transport_header Then qdisc_pkt_len_segs_init() reads the inner IP header as a TCP header. Thus the kernel can drop a valid packet with SKB_DROP_REASON_SKB_BAD_GSO. Copy skb->inner_transport_header to skb->transport_header when a decap clears skb->encapsulation. Keep skb->transport_header if it is larger. This occurs if nothing sets the inner field. At tc ingress nothing changes for IPIP or GRO packets. Both fields are at the TCP header there. Fixes: ec20dee2f2c4 ("bpf: Clear decap state on skb_adjust_room shrink path") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-27-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit e5d26cdbbce358235f3cd12f6c0112dc6937bcca Author: Chris Mason Date: Sun Nov 1 19:05:33 2026 +0000 bpf: Move the transport header with the moved headers [ Upstream commit a9d08fe60fa728ce0e3a99085241e8e790fb14c6 ] bpf_skb_net_hdr_pop() removes len bytes at offset off. bpf_skb_net_hdr_push() does the opposite. skb->data off before | A | removed | B | after | A | B | skb->data off mac_header and network_header move with A. transport_header moves only when it is equal to network_header. inner_transport_header never moves. This is correct only for a header in B. In bpf_lwt_seg6_adjust_srh() transport_header is in A. bpf_skb_adjust_room() can remove both transport headers. With an incorrect header offset, the stack can drop the skb or read outside of it. Also move transport_header with A when it is in A. Set it to offset off when it is in the removed bytes. In BPF_ADJ_ROOM_MAC mode it is then equal to network_header. Do not unset it, because skb_gso_validate_mac_len() uses it without a check. After a removal, set inner_transport_header to off when it is not in B and skb->encapsulation is set. A has only outer headers. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Fixes: 868d523535c2 ("bpf: add bpf_skb_adjust_room encap flags") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-26-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit ef5073375e48ae95b00788e7b32edfb92204f66a Author: Alexei Starovoitov Date: Sun Nov 1 19:05:32 2026 +0000 bpf: Don't let lwt_in progs call into IPv6 when it is disabled [ Upstream commit 95f1d5e4abb79fe85a54f7a46b41f297ce533c31 ] With ipv6.disable=1, inet6_init() returns before it registers any pernet subsystem. Thus net->ipv6.devconf_all and net->ipv6.seg6_data stay NULL. IS_ENABLED(CONFIG_IPV6) only says that the code is built in. bpf_lwt_input_reroute() and bpf_push_seg6_encap() call into IPv6, but do not test ipv6_mod_enabled(). An lwt_in prog also runs with ipv6.disable=1, and skb->protocol == htons(ETH_P_IPV6) does not prove that IPv6 is enabled. Thus the kernel dereferences NULL and crashes. Return -EAFNOSUPPORT before these calls if ipv6_mod_enabled() is false. BPF_LWT_REROUTE then drops an IPv6 skb. With IPv6 enabled nothing changes. The first Fixes tag is for bpf_push_seg6_encap(), which never had this test. The second tag is for bpf_lwt_input_reroute(). Until that commit it used ipv6_stub, which returned -EAFNOSUPPORT with ipv6.disable=1. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Fixes: ad84b1eefe28 ("bpf: remove ipv6_bpf_stub completely and use direct function calls") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-25-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3e08bbd4772e503bb7f7fe6f9cab95ad414dee16 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:31 2026 +0000 bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol [ Upstream commit d9618a6196953718f7470de5d2e84121bed063f7 ] When an lwt_in prog returns BPF_OK, bpf_input() calls orig_input(), the input handler of the route. This handler is for one IP version and needs a dst of the same family. But BPF_LWT_ENCAP_IP lets the prog push a header of the other IP version and thus change skb->protocol. Then the handler reads and changes a header of the other IP version. The push of an SRH also replaces the dst, because seg6_lookup_nexthop() puts an rt6_info into the skb. Then ip_forward() uses the rt6_info as a struct rtable. Drop the skb with -EINVAL when skb->protocol changes, as bpf_xmit() does. Drop it also when the family of the dst changes, because skb->protocol does not always show this change. Today no such skb leaves as the prog made it. A prog works as before if it returns BPF_LWT_REROUTE, or if it pushes an SRH on an IPv6 route. The commit in the first Fixes tag lets a prog change skb->protocol. The commit in the second tag adds the check to bpf_xmit() only. Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap") Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-24-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit f1d695ec88d088ce107a3a0b588631e3c02c4184 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:30 2026 +0000 bpf: Reset skb->cb after an lwt prog pushes an IP header [ Upstream commit b3ad42f6183286ab376389a5d26edf7ee3bdba27 ] IPCB(skb)->opt holds the offsets from the network header to the IPv4 options. But bpf_lwt_push_ip_encap() moves the network header and does not change IPCB(skb). Then ip_forward_options() and __ip_options_echo() use the old offsets on the pushed header. Thus the kernel corrupts the skb and the stack. If the family changes, the kernel also reads IP6CB(skb) as IPCB(skb), or the reverse. With CONFIG_IPV6_MIP6, it reads IPSKB_FORWARDED as frag_max_size and adds a needless fragment header. Reset skb->cb after the prog. bpf_lwt_push_ip_encap() cannot do it, because bpf_prog_run_save_cb() can restore skb->cb. For IPv4 in IPv4, clear IPCB(skb)->opt as ip_tunnel_xmit() does. If the family changes, clear the cb of the new family but keep iif, because ip6_forward() gets the input device from it. Behind a VRF, skb->skb_iif is the VRF device and cannot replace iif. Do nothing for IPv6 in IPv6, as in seg6_do_srh_encap(). Do the reset in bpf_input() only after a push. Without a push, ip_forward_options() needs the offsets. Do it in bpf_xmit() before each reroute, because an lwt_xmit prog can also change the options. Thus after a reroute without a push, ip_options_fragment() leaves the options in all fragments, and ICMP errors echo none. After BPF_OK or BPF_REDIRECT the skb goes to a device, thus bpf_xmit() does no reset. The inner IPv4 checksum can still be wrong after ip_rcv_options() changes an option. Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap") Reported-by: Xiang Mei Suggested-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-23-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit aab77b4aaf0e2e03ed034a8dcc4126d6544cef2d Author: Alexei Starovoitov Date: Sun Nov 1 19:05:29 2026 +0000 bpf: Don't leave a stale MAC header in bpf_lwt_push_ip_encap() [ Upstream commit 701ffd202b9e32942c8cfc065c9fe76ceaccc302 ] With BPF_LWT_ENCAP_IP, bpf_lwt_push_encap() pushes a new IP header. The new header overwrites the MAC header of a received skb. But skb->mac_header continues to point to the same bytes. Code that reads the MAC header after the push, for example netfilter, gets bytes of the new header. before the push | MAC header | old IP | payload ^ mac_header ^ network_header today | new header | old IP | payload network_header ^ ^ mac_header this patch, lwt_in | MAC header | new header | old IP | payload ^ mac_header ^ network_header this patch, lwt_xmit | new header | old IP | payload network_header ^ mac_header is not set For lwt_in, move the MAC header in front of the new header before the memcpy(), as __seg6_do_srh_encap() does. skb_cow_head() already reserves len + skb->mac_len bytes. For lwt_xmit, the output path makes a new MAC header. Thus mark skb->mac_header as not set. This is the state of a locally generated skb. Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-22-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit cd03b01e40a650d61f5fbadd48927d82037a5050 Author: Chris Mason Date: Sun Nov 1 19:05:28 2026 +0000 bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() [ Upstream commit 0fcb3f11a93d740e7f9ae1aeb48fe4d25838be18 ] bpf_skb_net_hdr_push() and bpf_skb_net_hdr_pop() change skb->data and skb->mac_header by len. That is correct in a tc prog, where skb->data is the MAC header. But bpf_lwt_seg6_adjust_srh() calls them in an End.BPF prog, where skb->data is the network header. The MAC header does not move: before push | free | MAC header | IPv6 | SRH | payload ^ head ^ mac_header ^ data today | free | MAC h| IPv6 | SRH + len | payload ^ head ^ mac_header ^ data this patch | free | MAC header | IPv6 | SRH + len | payload ^ head ^ mac_header ^ data Users of skb_mac_header() get incorrect bytes until __dev_queue_xmit() sets skb->mac_header again. skb_cow_head() reserves only len bytes. Thus the 16-bit offset skb->mac_header can wrap. A push also changes the "not set" value. In both cases skb_mac_header() points after the skb. Move the MAC header too. Pass len + skb->mac_len to skb_cow_head(). Keep the "not set" value. The second Fixes tag is for this case. Since that commit an End.BPF prog can get an skb with skb->mac_header not set. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Fixes: 20a081b7984c ("seg6: add VRF support for SRv6 End.DT6 behavior") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-21-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 77593d4d83780deae9a3cc788ca88404f2949e12 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:27 2026 +0000 bpf: Don't look for the SRH again in the End.BPF helpers [ Upstream commit 45bcc58d576705d2c001332766e10313f1c55bad ] A packet can have two SRHs. Thus input_action_end_bpf() uses IP6_FH_F_SKIP_RH to skip routing headers with segments_left 0. The helpers bpf_lwt_seg6_store_bytes() and bpf_lwt_seg6_adjust_srh() can reallocate the head of the skb. Thus they look for the SRH again, but without this flag. +------------------------+ <- the helpers: srh_state->srh | SRH 1, segments_left 0 | +------------------------+ <- input_action_end_bpf(): srh_state->srh | SRH 2 | and srh_state->hdrlen +------------------------+ Then the helpers check offset against the wrong limits. If a helper changes TLVs, seg6_bpf_has_valid_srh() writes the length of SRH 2 to SRH 1. Neither helper changes the offset of the SRH from skb->data. Calculate the new address from this offset. To add IP6_FH_F_SKIP_RH is not sufficient, because advance_nextseg() can set segments_left of SRH 2 to 0. The helper bpf_lwt_seg6_action() can change the headers and still looks for the SRH. Fixes: fbbc5bc2ab8c ("seg6: ignore routing header with segments left equal to 0") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-20-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 82801c1505b10c5d282ac9ab79b8507081a32e5c Author: Chris Mason Date: Sun Nov 1 19:05:26 2026 +0000 bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() [ Upstream commit ac159f39b252971141c49b68a27de0b637debfad ] bpf_lwt_seg6_adjust_srh() lets an End.BPF prog change the size of the TLVs in the SRH. The helper keeps the SRH length in srh_state->hdrlen, in bytes and without the first 8 bytes. Later seg6_bpf_has_valid_srh() writes it to srh->hdrlen, an 8-bit field in units of 8 bytes. But srh_state->hdrlen has no upper limit, and the cast to u8 can truncate it. After that, seg6_validate_srh() gets the SRH length from srh->hdrlen, and thus it can accept the SRH. Then srh->hdrlen is too small, and a parser reads TLVs as the subsequent header. Return -EFAULT when the new srh_state->hdrlen is larger than 2040, the largest length that srh->hdrlen can hold. To replace a TLV in the largest SRH, a prog can no longer add bytes first. It must remove bytes first. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-19-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit add5f647f128182fcce2a515de25724031ea5cf4 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:25 2026 +0000 bpf: Set a dst for test runs of lwt_in progs [ Upstream commit c1ca06e48e8848743fd876a1dc6b0f57bc76d23e ] When an lwt prog runs on a route, the skb always has a dst. To push an SRH, bpf_lwt_push_encap() reads the device from this dst. But bpf_prog_test_run_skb() sets a dst for lwt_xmit progs only. Thus the helper dereferences a NULL dst in a test run of an lwt_in prog. Set the same dst, ip6_null_entry, for lwt_in progs. When IPv6 is disabled or not built, their test run now fails with -EOPNOTSUPP too. An lwt_out prog cannot call this helper. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-18-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit d7106132b69e6916762bbbfd95fbcb60be4b8d9b Author: Chris Mason Date: Sun Nov 1 19:05:24 2026 +0000 bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 [ Upstream commit 58e39f8d58b141b96c030008a20dde9d625ec997 ] The mode BPF_LWT_ENCAP_SEG6 of bpf_lwt_push_encap() pushes an IPv6 header and an SRH, and it replaces the dst. The SRH says that IPv6 follows, and skb->protocol does not change. Thus the mode assumes an IPv6 packet, but an lwt_in prog also runs for IPv4 packets. After the prog, bpf_input() calls orig_input() of the old dst. This IPv4 handler reads the pushed headers as IPv4. It can write after the packet data, and the kernel crashes. after the push orig_input() expects --------------------- -------------------- skb->protocol ETH_P_IP ETH_P_IP dst rt6_info rtable packet | IPv6 | SRH | IPv4 | | IPv4 | The mode BPF_LWT_ENCAP_SEG6_INLINE returns -EBADMSG for non-IPv6 packets. Apply this check to both modes. End.BPF does not change, because seg6_local_input() drops non-IPv6 packets. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-17-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit e4384414432b98e93e6413856064b7c165be1a56 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:23 2026 +0000 bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS [ Upstream commit 6d8118937ba477e03fa2e94e9bd9abac7291a2a2 ] When bpf_skb_adjust_room() shrinks a TCP GSO skb, it adds the number of removed bytes to gso_size. gso_size has 16 bits, and nothing checks the sum. Thus gso_size can wrap to 0 or to a small size, or it can be GSO_BY_FRAGS. GSO_BY_FRAGS is not a size. It tells skb_segment() to read the length of each segment from the frag_list. If the TCP GSO skb has no frag_list, skb_segment() dereferences a NULL pointer. Return -ENOTSUPP and do not change the skb if the sum is GSO_BY_FRAGS or larger. With BPF_F_ADJ_ROOM_FIXED_GSO the helper does not change gso_size, so it shrinks the skb as before. Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-16-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3b2a42af183a7da44ae7d64bede143f31130c9e9 Author: Chris Mason Date: Sun Nov 1 19:05:22 2026 +0000 bpf, cgroup: Keep the skb network offset signed [ Upstream commit 3f9780d62dd1112ca15b5ae73568d29d42ccc950 ] cgroup_skb progs see a packet from its network header. While they run, __cgroup_bpf_run_filter_skb() moves skb->data there. It assumes that the network header is not after skb->data. It negates skb_network_offset(skb) and pushes skb->data by this offset. The offset is an unsigned int. But ip6mr_cache_report() and bpf_lwt_xmit_reroute() can pass an skb that has data before the network header. Then the offset wraps. On a 64-bit kernel skb->data is then far below skb->head. skb->len has 32 bits and wraps to the correct value, thus only skb->data is wrong. A read of packet data faults or gets other memory. Keep the offset in an int. Pull skb->data when the network header is after it. Otherwise push it, as today. Fixes: 3007098494be ("cgroup: add support for eBPF programs") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-15-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 655b2a6215815fdbf164f4fdb09e8b7619e6c505 Author: Chris Mason Date: Sun Nov 1 19:05:21 2026 +0000 bpf: Require prog fd or capability for cgroup detach [ Upstream commit 2962329f7c86fc51c177d4049c0f15a95ebd270c ] Since the commit below a cgroup prog detach does not require CAP_NET_ADMIN. The fd of the attached prog gives the permission instead. But the detach requires this fd only with BPF_F_ALLOW_MULTI. Without this flag a cgroup has only one prog per attach type. Then find_detach_entry() returns this prog and does not compare it with the prog of the caller. Thus the kernel detaches this prog for a caller with neither the fd nor a capability. Compare the two progs. If they are different, require CAP_NET_ADMIN or CAP_SYS_ADMIN in the initial user namespace. The error is -EPERM. A detach from tcx or netkit without a prog fd already requires these capabilities. With BPF_F_ALLOW_MULTI nothing changes. Without these capabilities, a caller of bpf_prog_detach() of libbpf must now use bpf_prog_detach2() with the fd of the attached prog. Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Signed-off-by: Chris Mason Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-14-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3ca487cf23d7d99ec5091247cf62a8c10ff97804 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:14 2026 +0000 bpf: Remove the WARN from arena_get_unmapped_area() [ Upstream commit 15dedd4b259289bffb8a5485b81722fdaebac71a ] The user range of an arena must not cross a 4 GiB boundary. Thus arena_get_unmapped_area() asks the mm for 2 * len bytes and rounds the result up if necessary. If user_vm_start is not 0, addr must be equal to it. A WARN_ON_ONCE() assumes that the mm returns addr. But addr is only a hint without MAP_FIXED, and the mm can return a different range that crosses a boundary. This is not a kernel bug. Remove the WARN_ON_ONCE() and its -EFAULT. arena_map_mmap() already compares vm_start with user_vm_start under arena->lock. If the rounded result is user_vm_start, mmap() succeeds. If not, it returns -EBUSY. Fixes: 317460317a02 ("bpf: Introduce bpf_arena.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-7-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 09aab6f1064f35f75a0e84308198e00fc91f3ea1 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:13 2026 +0000 bpf: Refuse an arena mmap() longer than max_entries pages [ Upstream commit 1e01345b87f13c354687360cb81ed2a521ff2b13 ] arena_map_alloc() puts max_entries free pages in the range tree of an arena. But the arena kfuncs check their arguments against user_vm_start and user_vm_end. Without map_extra, arena_map_mmap() takes both from the first vma. This vma can be up to 4 GiB long. Then arena_free_pages() also marks pages as free that were never in the range tree. Thus max_entries does not limit the memory of the arena, but these pages are inside kern_vm. Refuse an mmap() longer than max_entries pages with -E2BIG. With map_extra this limit exists already. libbpf always maps max_entries pages. Replace both SZ_4G checks with this limit, because it is at most 4 GiB. Fixes: 317460317a02 ("bpf: Introduce bpf_arena.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-6-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 49153a811e95ccaf45b0c0e516f6e20783de8ef1 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:12 2026 +0000 bpf: Don't let bpf_arena_free_pages() see a half-set user range [ Upstream commit 52498f14c2d26d67a9bf06998b797900827a06ad ] If map_extra is 0, the first arena_map_mmap() sets user_vm_start and user_vm_end. It holds arena->lock, but bpf_arena_free_pages() reads both fields without this mutex. The kfunc relies on the verifier, which rejects a prog if user_vm_start of its arena is 0. But this check covers only the maps in used_maps. The kfunc accepts any trusted pointer to struct bpf_map. Thus the kfunc can run during arena_map_mmap() and read user_vm_start as 0 and user_vm_end as vma->vm_end. Then min() does not limit page_cnt to the arena. arena_free_range() unmaps and frees pages of other vmalloc areas. Read user_vm_start one time and return if it is 0. This value means that no range is set, because arena_get_unmapped_area() rejects address 0. If only user_vm_end is still 0, uaddr_end is 0 and the kfunc returns, as today. Fixes: 317460317a02 ("bpf: Introduce bpf_arena.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-5-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 488cd5e323dad3809df40a9fa46b3db995e1e0d2 Author: Alexei Starovoitov Date: Sun Nov 1 19:05:11 2026 +0000 bpf: Refuse to map an arena at address 0 [ Upstream commit ca580b034380fa9a69cc973637d1859ec4f5b344 ] The first mmap() of an arena sets user_vm_start and user_vm_end. Each subsequent mmap() must use the same range. The value 0 in user_vm_start means that the range is not set, but a mapping can start at address 0. Then arena_map_mmap() does not check vm_start and sets user_vm_start again. The range tree counts pages from user_vm_start. With a new user_vm_start it reports allocated pages as free, and apply_range_set_cb() fails with -EBUSY. An arena at address 0 is not useful, because the verifier rejects all progs that refer to it. Return -EINVAL from arena_get_unmapped_area(). It runs before mmap() removes the old mappings in the range. Fixes: 317460317a02 ("bpf: Introduce bpf_arena.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-4-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit f624585522f6fe93823a3feea28ce3b4ace9e77a Author: Alexei Starovoitov Date: Sun Nov 1 19:05:10 2026 +0000 bpf: Clamp the trace length before the skip test in stackid_init() [ Upstream commit a08ba2ab79dffd92c32d3f2dadfc7eba03625a2b ] stackid_init() gives a bucket of the stack map min(trace_nr - skip, max_depth - skip) trace entries. Here max_depth is the size of a bucket plus skip, but at most perf_event_max_stack. Context markers can make trace_nr larger than that, so the skip test can pass when max_depth < skip. Then 'max_depth - skip' wraps, and the kernel can write after the bucket. Clamp trace_nr to max_depth before the skip test, as __bpf_get_stack_pe() does. The result changes only when skip >= max_depth. Then it is -EFAULT. Until now skip == max_depth could give the id of an empty trace. get_perf_callchain() releases the trace, so an NMI can change trace->nr. Use READ_ONCE() in bpf_get_stackid(), so the compiler reads it one time. Fixes: 23f852daa4ba ("bpf: Fix stackmap overflow check in __bpf_get_stackid()") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-3-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit f9045c09e95923b91d99916f0c821a4efbff4be4 Author: Josef Bacik Date: Sun Nov 1 19:05:09 2026 +0000 bpf: Clamp the trace length in __bpf_get_stack() again [ Upstream commit 007fd460798be9af7d4874734f934afa47742f29 ] get_perf_callchain() and get_callchain_entry_for_task() store a trace in a per-CPU entry, one per context. They release the entry before they return it. Thus a second user in the same context can write to the entry while the first user reads it. preempt_disable() stops only other tasks. __bpf_get_stack() requests at most max_depth frames. This is skip plus the frames that fit in the buffer, but not more than perf_event_max_stack. Since the commit below, it copies 'trace->nr - skip' frames with no limit. But a second user can store a longer trace. The unwinders of PowerPC add context markers that max_depth does not limit. In both cases the copy writes after the end of the buffer. Read trace->nr one time. Clamp the value to max_depth before the skip test, as __bpf_get_stack_pe() does. Thus when max_depth is less than skip, the helper returns -EFAULT, and 'trace_nr - skip' does not underflow. The copied frames can still be those of the second user. Fixes: e17d62fedd10 ("bpf: Refactor stack map trace depth calculation into helper function") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261101190535.1454146-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 4f27739c460f05f1e15e2f4d20002830d7cfb818 Author: Hongjian Dai Date: Sat Oct 17 15:55:45 2026 +0800 spi: pic32-sqi: fail transfer when the BD ring is exhausted [ Upstream commit 2066970324a1439e5a2e08c4599098367f8f82cc ] pic32_sqi_one_transfer() silently stopped programming buffer descriptors when ring_desc_get() returned NULL and still returned success. The caller then marked the last programmed descriptor as the end of the list and started the DMA engine, so the hardware transferred only a prefix of the requested data while the message completed with status 0. The ring holds PESQI_BD_COUNT (256) descriptors of at most PESQI_BD_BUF_LEN_MAX (256) bytes each, so messages larger than 64 KiB (or with enough SG entries) can exhaust it. Since the driver sets no max_message_size/max_transfer_size, the SPI core does not prevent this. Return -ENOMEM instead, and set msg->status so the failure reaches the caller rather than being silently truncated. Fixes: 3270ac230f66 ("spi: pic32-sqi: add SPI driver for PIC32 SQI controller.") Signed-off-by: Hongjian Dai Link: https://patch.msgid.link/F5276982A630220B+20261017075545.95854-1-daihongjian@kylinsec.com.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 66b2255211e67e4c7a4fc625566f90763fb6b966 Author: Alexei Starovoitov Date: Sat Oct 31 05:05:57 2026 +0000 bpf, x86: Fix bpf_throw() in a prog with a private stack [ Upstream commit 91068ed2d3ee0713d7566c7977b995f8a0936bea ] When the main prog has a private stack and the prog calls bpf_throw(), it returns to the kernel with wrong values in r12, rbx, r13, r14 and r15. The kernel crashes soon after that, for example: BUG: kernel NULL pointer dereference, address: 0000000000000010 RIP: 0010:__bpf_prog_test_run_raw_tp+0x125/0x380 The main prog of a prog that can throw saves these five registers at its entry. bpf_throw() walks the stack to the frame of the main prog and gives the stack pointer of that frame to the exception callback, which pops the registers from there. In a function with a private stack r9 is the frame pointer, and the JIT emits 'push r9' in front of every call and 'pop r9' after it. So the stack pointer that bpf_throw() finds is 8 bytes too low: r12 rbx r13 r14 r15 <- the callback has to pop from here r9 <- rsp of the main prog at the call r15 gets the address of the private stack and every other register gets the value of its neighbour. This happens in tracepoint, raw_tp, perf_event and tracing progs, except iterators, and in struct_ops progs that ask for a private stack, when the main prog has more than 48 bytes of stack. The throw can be in the main prog or in a subprog. aux->stack_arg_sp_adjust already moves the stack pointer from the outgoing stack arguments up to the saved registers. Add the 8 bytes of r9 to it when the main prog has a private stack. A constant is enough. Calls of helpers, kfuncs and subprogs and callx all have the push. A prog with tail calls has no private stack, and a callback cannot throw. Only the frame of the main prog matters: the frames of subprogs are dropped, with or without a private stack. On x86-64 a function with stack arguments has no private stack, hence only one of the two parts is not zero. The JITed code does not change. Fixes: 7d1cd70d4b16 ("bpf, x86: Support private stack in jit") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261031050558.2410721-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit bd2851eba74cf1919de4fcf95609670b12492b1b Author: Tang Bin Date: Wed Oct 28 19:45:00 2026 +0800 ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable [ Upstream commit e2df0223ba6dbdf028c45b4a018e6b15642a39af ] swclk_gate_enable() calls pm_runtime_resume_and_get() (incrementing the PM usage counter and, via of_pm_clk_add_clks, enabling mclk) before rx_macro_mclk_enable(). On rx_macro_mclk_enable() failure it called clk_disable_unprepare(rx->mclk) and returned, leaking the PM usage counter and potentially unbalancing the clock that the PM clock domain also manages. The sibling tx-macro/va-macro drivers call pm_runtime_put_autosuspend() here; do the same. Fixes: e38cbb75248a ("ASoC: codecs: lpass-rx-macro: Propagate regcache_sync() errors") Signed-off-by: Tang Bin Reviewed-by: Prasad Kumpatla Link: https://patch.msgid.link/20261028114501.2192-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit de55924b1ed4225331131ace2ece42da8a58ff34 Author: Fernando Fernandez Mancera Date: Thu Sep 24 22:13:28 2026 +0200 netfilter: nft_reject: prevent unbounded recursion in output hooks [ Upstream commit d6c18cadfc6c7a88e9e07e0a1b5ead37c0ddf866 ] nftables payload-mangling rules can rewrite packet contents (such as TCP flags) before they are evaluated by reject targets. This defeats the content-based loop guards, allowing unbounded hook recursion that leads to kernel stack exhaustion and panics. Fix this by extracting the per-CPU xmit recursion limit previously used by the netdev duplication/forwarding paths into a shared header, and apply it to the inet and inet6 reject transmit functions. It disables BH while transmitting the skb to address a possible migration to different CPU leading to imbalanced decrementation of the recursion counters. Note that the dev_queue_xmit() path used when CONFIG_BRIDGE_NETFILTER is enabled does not require this recursion guard. In that scenario, the generated reset packet is transmitted directly at Layer 2. Because the packet egresses from a different hook, it cannot synchronously loop. In addition nf_send_unreach() and nf_send_unreach6() are safe as the ICMP transmit functions are protected against recursion by the icmp_xmit_lock() and icmpv6_xmit_lock() guards. Reported-by: Yu Junzhe Closes: https://lore.kernel.org/netfilter-devel/20260921061320.543-1-junzheyu1@gmail.com/ Fixes: bee11dc78fc8 ("netfilter: nft_reject: support for IPv6 and TCP reset") Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 400561115da0e8326774c8d55fc602543e9e1356 Author: Ayushman Rout Date: Mon Oct 26 21:58:08 2026 +0530 bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet [ Upstream commit 696f0954e3b6280aa87ea4a6196153e506b0ab9c ] When both dynptrs point into the same packet and the ranges overlap, bpf_dynptr_copy() can copy wrong data in two ways. If one range fits into a segment and the other one does not, the slice of the first range is used as the buffer for __bpf_dynptr_read() or __bpf_dynptr_write(). The range that crosses into a frag is copied piece by piece, and an earlier piece can overwrite bytes that a later piece has yet to read. If neither range fits into a segment, the chunks are copied from the start to the end through a 256 byte stack buffer. When the destination is above the source, a chunk written to the destination overwrites source bytes that later chunks have yet to read. For a copy of 1200 bytes with the destination 100 bytes above the source, the first chunk writes source bytes 100..355 and the second chunk then reads bytes 256..355 after they were overwritten. Do not use a slice as the buffer when both dynptrs share the same data, and copy the chunks from the end to the start when the destination is above the source, like memmove() does. The selftests added later in this series pass with this change. Fixes: daec295a7094 ("bpf/helpers: Introduce bpf_dynptr_copy kfunc") Suggested-by: Alexei Starovoitov Signed-off-by: Ayushman Rout Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261026162810.12862-2-ayushmanrout27@gmail.com Signed-off-by: Sasha Levin commit ad35828e66b7bc6b3621056691333799d8a38ba4 Author: Sasha Levin Date: Wed Oct 28 10:44:43 2026 -0400 ALSA: hda/core: Fix double free on stream page allocation failure [ Upstream commit 1886b8132cd37edbc28b55f30a885011aa0bbe8a ] Since commit f16eaa38ea64 ("ALSA: hda/core: add cleanup in snd_hdac_bus_alloc_stream_pages()"), snd_hdac_bus_alloc_stream_pages() frees the BDL and position buffers it has already allocated when a later allocation fails. snd_dma_free_pages() doesn't clear dmab->area, so the freed buffers still look allocated to snd_hdac_bus_free_stream_pages(), which the HDA controller drivers call from their destructors, and they are freed a second time when the device is removed. With fault injection failing the CORB/RIRB buffer allocation of snd-hda-intel on a QEMU ich9-intel-hda, unbinding the device then crashes: page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) kernel BUG at include/linux/mm.h:1986! Call Trace: ___free_pages+0x9b/0xa0 free_pages_exact+0xa5/0xd0 snd_hdac_bus_free_stream_pages+0x43/0xb0 [snd_hda_core] azx_free+0xb3/0x1b0 [snd_hda_intel] azx_dev_free+0xd/0x20 [snd_hda_intel] Clear the buffer pointers after freeing them in the error path. Fixes: f16eaa38ea64 ("ALSA: hda/core: add cleanup in snd_hdac_bus_alloc_stream_pages()") Signed-off-by: Sasha Levin Link: https://patch.msgid.link/20261028144443.992569-1-sashal@kernel.org Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit f733176cb4c68ca03297f47f1a5acc7a9501b0b6 Author: Sasha Levin Date: Wed Oct 28 10:44:41 2026 -0400 ALSA: memalloc: Free the new pages when WC DMA mapping fails [ Upstream commit 016fe9695e6dc1322ddfe8c7dbc7b973483b4a24 ] snd_dma_wc_alloc() keeps the newly allocated pages in a local variable, and snd_dma_alloc_dir_pages() stores them in dmab->area only after ->alloc() returns. If dma_map_single() fails, the error path passes dmab->area to do_free_pages() instead, and that is still NULL at this point for the usual callers. The pages are then leaked with their write-combining attribute still set, set_memory_wb() warns about the zero address, and for buffers larger than a page free_pages_exact() goes on to free the struct pages of the bogus addresses 4096, 8192 and so on. With CONFIG_DEBUG_VM that hits the VM_BUG_ON() in free_pages(): kernel BUG at mm/page_alloc.c:5600! RIP: 0010:free_pages_exact+0xcb/0xd0 Call Trace: snd_dma_wc_alloc+0x14f/0x160 [snd_pcm] snd_dma_alloc_dir_pages+0x4f/0x80 [snd_pcm] This was reproduced on an x86 guest without swiotlb by allocating SNDRV_DMA_TYPE_DEV_WC buffers for a device with a 24-bit streaming DMA mask, so that dma_map_single() fails. Free the pages that were just allocated. Fixes: c880a5146642 ("ALSA: memalloc: Use proper DMA mapping API for x86 WC buffer allocations") Signed-off-by: Sasha Levin Link: https://patch.msgid.link/20261028144441.992127-1-sashal@kernel.org Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 3e8c7e6ac840c2e7fc7ae97f2492e0ea1ba8958e Author: Thomas Fourier Date: Thu Oct 29 09:20:55 2026 +0100 net: ipa: Fix double free of the interrupt structure on config error [ Upstream commit cb284914e749388eef402938bdb3115fe1f6d337 ] Since ipa_interrupt_init() allocates struct ipa_interrupt in ipa_probe(), the structure is owned by ipa_probe() and released with ipa_interrupt_exit() on its error paths and in ipa_remove(). The error path of ipa_interrupt_config() still frees it with kfree(). If ipa_interrupt_config() fails (called from ipa_config() via ipa_setup()), ipa_probe() unwinds through err_interrupt_exit, which frees the same structure again. Drop the kfree() from ipa_interrupt_config(); it should only undo what it set up itself. Drop the leftover initialization and cleanup of ipa->interrupt now managed in ipa_proble() and ipa_remove() of ipa_main.c. Fixes: ad1be80d7582 ("net: ipa: introduce ipa_interrupt_init()") Signed-off-by: Thomas Fourier Reviewed-by: Alex Elder Link: https://patch.msgid.link/20261029082100.17722-2-fourier.thomas@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 8487516030fdd039eba0d8b5401bcf3bb036e8d7 Author: Tung Nguyen Date: Thu Oct 29 10:04:48 2026 +0700 tipc: reject attaching bearer of different media to the same occupied device [ Upstream commit 0a0257228be902ff09608bcaf19ae7c6d58b028f ] Currently, two bearers of different media types can be added to the same device (e.g., "eth:eth0" and "ib:eth0") via tipc command: tipc bearer enable media eth dev eth0 tipc bearer enable media ib dev eth0 For each command execution, tipc_enable_l2_media() is called: tipc_enable_l2_media() dev_get_by_name() dev_hold() As a result, device->dev_refcnt is incremented twice, but the second bearer replaces the first one. This causes a leak in device->dev_refcnt. Fix this by rejecting a bearer with a different media type when the device is already occupied. Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()") Reported-by: Jiakai Xu Closes: http://lore.kernel.org/netdev/20260918013509.1853952-1-xujiakai24@mails.ucas.ac.cn/ Signed-off-by: Tung Nguyen Link: https://patch.msgid.link/20261029030522.8306-1-tung.quang.nguyen@est.tech Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit f8534ae433ab76c94a13b15467f0b36f8b27a81c Author: Jia Jia Date: Wed Oct 21 17:43:34 2026 +0800 scsi: target: Validate REGISTER AND MOVE TransportID length [ Upstream commit 5d5913710c81eed6fa275b6a24773059d9dbfdfa ] REGISTER AND MOVE has a 24-byte parameter-list header followed by a TransportID. A 24-byte parameter list with a zero TransportID length passes the existing tid_len + 24 check, then the handler reads buf[24] for the TransportID protocol identifier, one byte past the received parameter list. A TransportID is at least 24 bytes. Reject shorter TransportIDs and compare the declared length with the bytes following the header before reading buf[24]. A malformed PR OUT sent through vhost-scsi triggered this read on a KASAN kernel. The command is now rejected with INVALID PARAMETER LIST before buf[24] is accessed. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Jia Jia Link: https://patch.msgid.link/20261021094334.198599-1-physicalmtea@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 80ad7743597405039b5dbda2391e2d1e2cbc4855 Author: Vincent YUE Date: Wed Oct 21 07:08:56 2026 +1000 scsi: mpt3sas: Register devices during SANITIZE [ Upstream commit d58e6d962e5b59297be24d908f41af93f20ec11f ] A SAS disk being sanitized responds to TEST UNIT READY with NOT READY, ASC 0x04, ASCQ 0x1b. mpt3sas discovery maps this sense to DEVICE_START_UNIT and issues START UNIT repeatedly. The drive stays NOT READY until the sanitize operation completes, causing discovery to exhaust its retry budget and decline SCSI device registration. Allow registration only for the SANITIZE IN PROGRESS sense, so sd/sg can expose the target while retaining its actual NOT READY state. All other sense dispositions are unchanged. On an LSI SAS3008 with an HGST HUH728080AL4200, unpatched Linux 7.2.11 retried discovery 145 times without registering the device. Linux 6.18.55 registered the same sanitizing drive. With the equivalent 7.2.11 fix the disk registered as /dev/sda (0 B) and /dev/sg0 while TEST UNIT READY still reported 02/04/1b and 47.32% SANITIZE progress. Another SAS drive continued to enumerate. This updated variant uses the named 0x041b sense constant introduced in newer kernels. It passed static review on the current SCSI for-next branch but has not been independently boot-tested there. Fixes: aee682fad6cd ("scsi: mpt3sas: Improve device discovery and readiness handling for slow devices") Assisted-by: LLM Signed-off-by: Vincent YUE Link: https://patch.msgid.link/20261020210856.42835-1-vince@palmit.com.au Reviewed-by: Laurence Oberman Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 3c4554b33e35a9e186fcf94b75bea3bf27e89160 Author: Damien Le Moal Date: Tue Sep 8 18:02:45 2026 +0900 scsi: mpt3sas: Use combined sense codes [ Upstream commit f2e04ffb273e60aba6d39fc0c591bd1d8f4d9018 ] Refactor the mpt3sas driver to replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20260908090308.1085097-18-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) Stable-dep-of: d58e6d962e5b ("scsi: mpt3sas: Register devices during SANITIZE") Signed-off-by: Sasha Levin commit dbf0685068ea896135c0afc8f766efbde71d58cb Author: Fernando Fernandez Mancera Date: Wed Oct 28 23:53:50 2026 +0100 net/smc: fix limit_smc_hs sysctl on big-endian architecture [ Upstream commit 162cf592b577cccf04515100563e819d9eba5c4a ] net->smc.limit_smc_hs is a bool, but its sysctl entry uses proc_dointvec_minmax() with .maxlen = sizeof(int), so the handler accesses four bytes at the address of a one-byte field. On little-endian this works with the extra bytes being written in struct padding. On big-endian (tested on s390x) the bool sits at the most significant byte of the int therefore the bool stays false and the "1" goes into padding. The sysctl reads back 1 but SMC sockets created afterwards see limit_smc_hs as disabled. Fix this by using proc_dobool() handler and adjust the maxlen to the right value. Fixes: f8406a2fd279 ("net/smc: add sysctl for smc_limit_hs") Signed-off-by: Fernando Fernandez Mancera Link: https://patch.msgid.link/20261028225350.3753-1-fmancera@suse.de Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 09087c9bbf507fdd8abaad89462bd85e994ddd7a Author: James Hilliard Date: Mon Oct 26 12:11:31 2026 -0600 ptp: vclock: preserve missing hardware timestamps [ Upstream commit 63787dfd1b5ae720cc30dab5e66c8e4d81ff7391 ] Socket timestamp delivery converts hardware timestamps to a bound virtual clock before checking whether a hardware timestamp is present. A zero timestamp means that the packet has no hardware timestamp, but timecounter_cyc2time() can turn that zero into a nonzero virtual time. The socket then reports a hardware timestamp which was never supplied. Return zero without conversion when the input timestamp is absent. This also covers skb_get_tx_timestamp(), which checks for an absent timestamp after the same conversion. This was identified during review of virtual clock sampling changes. Fixes: d7c088265588 ("net: socket: support hardware timestamp conversion to PHC bound") Reviewed-by: Vadim Fedorenko Signed-off-by: James Hilliard Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-5-e705612541f1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit ab3732a527f343c60a9687d83f06b0653da4e5b2 Author: James Hilliard Date: Mon Oct 26 12:11:30 2026 -0600 ptp: vclock: serialize extended samples with counter updates [ Upstream commit d3fcce5afe3bb62e8f7a2efb29e43da4fe4ae1f3 ] The extended and cross-timestamp callbacks sample the physical clock before taking the virtual clock mutex. A concurrent frequency adjustment can advance the timecounter and change its multiplier in between, so the older sample is converted using a different frequency than the one in effect when it was taken. Take the mutex before sampling and keep it held through the conversion. Retain timecounter_cyc2time() and its existing conversion window. A PHC sample need not advance the counter: for example, e1000e explicitly allows non-monotonic SYSTIM readings. Treating a slightly older sample as a forward delta would instead advance virtual time by nearly a full counter wrap. This race was found by code inspection of the virtual clock sampling paths. Fixes: f0067ebfc42b ("ptp: add gettimex64() to virtual clocks.") Fixes: 21fad63084c2 ("ptp: add getcrosststamp() to virtual clocks.") Signed-off-by: James Hilliard Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-4-e705612541f1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit a8df562cf7c33b8b649dad3bbd196525a9d3442c Author: James Hilliard Date: Mon Oct 26 12:11:29 2026 -0600 ptp: vclock: propagate physical clock sampling errors [ Upstream commit d1bdfdafd663dd00b01d43eb3391f87718f2a09d ] The cyclecounter read callback cannot report errors. ptp_vclock_read() ignores the return from the physical clock and consumes its output even if the read failed. A zero sample followed by the real counter can add an extra 32-bit wrap to virtual time. This was found by code inspection of reset-time PHC access and the virtual clock callers. Sample the parent before calling timecounter_read() or timecounter_init() and have the cyclecounter callback return the cached successful sample. On failure, leave the counter and frequency adjustment unchanged and return the PHC error to the caller. Retry the first failed refresh after 10 ms instead of waiting another two seconds. With the existing 32-bit nanosecond mask, timecounter_cyc2time() can interpret a fresh timestamp as being in the past once the last successful refresh is about 2.147 seconds old. An isolated read failure should not deliberately defer the next attempt until that sample is four seconds old. Double the retry delay after consecutive failures, up to the normal two-second refresh interval, and reset it after a successful refresh. Each virtual clock has its own worker, and a failed parent read can involve bus traffic and error logging. Backoff limits that repeated work during a persistent failure while retaining a prompt first retry. Limit each retry delay to the next regular refresh deadline. Otherwise, backoff can skip the next two-second refresh opportunity and lose a full counter wrap even when the parent has recovered before that refresh was due. Advance the deadline when an attempt reaches it without resetting the backoff, so sustained failures still settle at the normal refresh interval. Keep the retry state private to each clock's auxiliary worker. Take the initial sample and initialize the counter before publishing the clock. Return an error pointer from registration and propagate its errno through n_vclocks, including when the initial sample fails. Queue the first refresh immediately after registration so registration latency is not followed by another full refresh interval. Keep the existing cyclecounter mask and scaling. These scheduling changes do not guarantee timely samples: prolonged read failures or worker delays can still exceed the half-wrap conversion window, and a gap of about 4.295 seconds between successful samples can lose a full counter wrap. Do not assume that getcycles64() exposes a full-width nanosecond counter. Fixes: 5d43f951b1ac ("ptp: add ptp virtual clock driver framework") Signed-off-by: James Hilliard Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-3-e705612541f1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 1e8b0d578dacb89064394b842894580d6eff470a Author: James Hilliard Date: Mon Oct 26 12:11:28 2026 -0600 ptp: unwind partially completed virtual clock creation [ Upstream commit 3dea778260e3dddf30651a6913d87a42861346a2 ] n_vclocks_store() publishes the new clock count only after every child has been registered. If a later registration fails, it returns without unregistering the children already created by that request. Those clocks are left out of n_vclocks, and a subsequent request can overwrite their index entries without removing them. Unregister the newly created children in reverse order and clear their index entries on failure. Leave the previously installed clocks and their count unchanged. The n_vclocks mutex serializes this rollback with other sysfs changes, and parent removal drains the store before walking the children. This was found by code inspection while adding initial PHC sample error handling to virtual clock registration. Fixes: 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion") Signed-off-by: James Hilliard Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-2-e705612541f1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 33a0670e85b57ea1331ab5fe183b93725c821826 Author: James Hilliard Date: Mon Oct 26 12:11:27 2026 -0600 ptp: drain virtual clock sysfs operations before unregistering children [ Upstream commit 0e4a135aebc7686286d87e286499ce55e5bd5aad ] Parent clock removal walks its virtual clocks before removing the n_vclocks sysfs attribute. The mutex taken by ptp_vclock_in_use() is released before that walk, so a concurrent sysfs deletion can pick the same child and unregister and free its ptp_vclock a second time. A reference held by the device iterator does not protect that separately allocated virtual clock. Remove n_vclocks before walking the children. Removing the attribute prevents new stores and drains stores already running, without holding n_vclocks_mux across a callback that needs that mutex. Skip virtual clocks, which do not have this attribute. This race was found by code inspection of virtual-clock registration failure cleanup and parent removal. Fixes: bfcbb76b0f59 ("ptp: unregister virtual clocks when unregistering physical clock.") Reviewed-by: Vadim Fedorenko Signed-off-by: James Hilliard Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-1-e705612541f1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit a8e6460bdb279901e664ea154e9f76d931d835bc Author: Zhi-Jun You Date: Mon Oct 26 17:57:31 2026 +0800 net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 [ Upstream commit dd6efae5529107cc8db277eaeaff5c5f15e6bc15 ] WDMA_RING_TX(0) is required to set MTK_WED_WDMA_RING_TX for WED RX but on a non-DBDC MT7986 it is never setup because idx is 1. Setting MTK_WED_WDMA_RING_TX with WDMA_RING_TX(1) is not feasible because WED still tries to send through WDMA_RING_TX(0). This is verified with register dump. Fix this by calling mtk_wed_wdma_tx_ring_setup if wed is v2 and rx_ring[0] is not allocated and reset tx_wdma[0] if it's already allocated also add error messages and bail when mtk_wed_start fails. Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support") Signed-off-by: Zhi-Jun You Link: https://patch.msgid.link/20261026-wedfix-v6-4-a52f6b15d2fc@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 675f37b4fa4f4c417ab73edb93198fd72d54d686 Author: Zhi-Jun You Date: Mon Oct 26 17:57:30 2026 +0800 net: ethernet: mtk_wed: free up rings during detach [ Upstream commit 5b8d12512cbd3495dbd8c38e8047bb5d716f0f3f ] During __mtk_wed_detach, rx_ring and tx_wdma aren't freed up. Fix this by add them to mtk_wed_free_rx_rings. This patch is pulled from mtk-openwrt-feeds to address Sashiko's review and edit to rely on ring->desc instead of an extra flag. Link: https://github.com/mediatek/mtk-openwrt-feeds/blob/main/25.12/files/target/linux/mediatek/patches-6.12/999-wed-04-Fix-reinsert-wifi-module-cause-memory-leak-issue.patch Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support") Reported-by: Sashiko Link: https://sashiko.dev/#/message/179000700034.2160803.10594281691384015089%40kernel.org Signed-off-by: Zhi-Jun You Link: https://patch.msgid.link/20261026-wedfix-v6-3-a52f6b15d2fc@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit e5ef6293b0601da46c140651f61841a55088373c Author: Zhi-Jun You Date: Mon Oct 26 17:57:29 2026 +0800 net: ethernet: mtk_wed: fix reset condition for rx wdma [ Upstream commit 7180a42d8e616f919dcff4b90a13b9a5ecea665b ] In mtk_wdma_rx_reset, currently only resets the CPU index of the rings that doesn't have a descriptor. This is wrong because no descriptor means the ring is not configured. Also mtk_wed_start makes sure that all rx_wdma rings are set up this would lead to no ring getting their CPU index reset. Fix this by inverting the reset condition so allocated rings will be reset. Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20260724172040.1653-1-hujy652%40gmail.com Signed-off-by: Zhi-Jun You Link: https://patch.msgid.link/20261026-wedfix-v6-2-a52f6b15d2fc@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 281570393a750ed8f5d10f9fe5e6b1355bd15d2d Author: Zhi-Jun You Date: Mon Oct 26 17:57:28 2026 +0800 net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 [ Upstream commit cb50f16f37fc3429085c454ee5978e05732d10ba ] Currently WED v3 tx wdma ring, ring reset happens in a separate code block unconditionally. Moreover, v3 has double the size of wdma_desc and has different init values. mtk_wed_ring_reset doens't deal with that and would corrupt the wdma_desc. Fix this by skipping mtk_wed_ring_reset in mtk_wdma_tx_ring_setup for WED v3. Fixes: e2f64db13aa1 ("net: ethernet: mtk_wed: introduce WED support for MT7988") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20260711112128.971-1-hujy652@gmail.com?part=1 Signed-off-by: Zhi-Jun You Link: https://patch.msgid.link/20261026-wedfix-v6-1-a52f6b15d2fc@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de Author: Puranjay Mohan Date: Wed Oct 21 11:51:16 2026 -0700 bpf: Drop percpu_counter from the htab element count [ Upstream commit 1cd28b5354ab77c727ed87255bf289a87178b415 ] The element count of a large non-preallocated hash map is a percpu_counter, whose slow path takes fbc->lock with raw_spin_lock_irqsave(). That is not safe against BPF programs that run while the lock is held or contended: NMI programs and, as queued_spin_lock_slowpath() calls trace_contention_end() with the lock already held, programs attached to the contention_end tracepoint. If such a program updates the same map it spins on the lock its own CPU holds: WARNING: possible recursive locking detected cend/250 is trying to acquire lock: (key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30 but task is already holding lock: (key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30 percpu_counter_add_batch+0xd8/0x160 alloc_htab_elem+0x408/0x480 htab_map_update_elem+0x1e8/0x6a0 bpf_prog_7a29a1ae68aedf07_cend+0x14c/0x1f8 __bpf_trace_contention_end+0x14/0x20 queued_spin_lock_slowpath+0x2e8/0x468 percpu_counter_add_batch+0xd8/0x160 alloc_htab_elem+0x408/0x480 htab_map_update_elem+0x1e8/0x6a0 is_map_full() is affected too, as __percpu_counter_compare() falls back to percpu_counter_sum(), which takes the same lock. map.elem_count already is a lockless per-cpu count of the same elements. Make htab->count follow it in steps of PERCPU_COUNTER_BATCH and let is_map_full() sum elem_count once count is within nr_cpu_ids * batch of max_entries. Each cpu's elem_count is ahead of count by less than the batch, so that is exact, in NMI as well. Fixes: 86fe28f7692d ("bpf: Optimize element count in non-preallocated hash map.") Suggested-by: Alexei Starovoitov Signed-off-by: Puranjay Mohan Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261021185117.650403-1-puranjay@kernel.org Signed-off-by: Sasha Levin commit c8b32df27f50d28e3ef2601e0ef578e47dc72e12 Author: Thomas Fourier Date: Wed Oct 28 10:50:51 2026 +0100 btrfs: zoned: fix double free of bitmaps on clone failure [ Upstream commit 8c66a6aa59a5df1d672d72b7cd379d897ff73200 ] btrfs_clone_dev_zone_info() duplicates the original orig_dev->zone_info with kmemdup(), which also copies the seq_zones, empty_zones and active_zones pointers. The clone then replaces them one by one with fresh bitmaps. If one of the allocations fails, the error path frees all three pointers, including those not yet replaced, which still point to the bitmaps owned by the original device. Clear the three pointers right after kmemdup() so the error path only frees what this function allocated. Fixes: 21e61ec6d0bb ("btrfs: zoned: clone zoned device info when cloning a device") Reviewed-by: Johannes Thumshirn Signed-off-by: Thomas Fourier Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 679600b3b1460aa715ffbe0c7570bdd5f7b4fde9 Author: Filipe Manana Date: Fri Oct 16 17:14:49 2026 +0100 btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing [ Upstream commit bda65e5115fe66ee0d8cf4ade11807f9fca4f0e1 ] When scrub finishes, it does a wakeup on the fs_info->scrub_pause_wait wait queue and then sets dev->scrub_sctx to NULL. On the other hand the scrub cancel code (btrfs_scrub_cancel_dev()) waits on that wait queue for dev->scrub_sctx to be NULL. So this means if btrfs_scrub_cancel_dev() is called right when scrub is finishing and sees the wakeup before the NULL is assigned to dev->scrub_sctx by btrfs_scrub_dev(), it hangs. Fix this by doing the wakeup in btrfs_scrub_dev() after setting dev->scrub_sctx to NULL. Fixes: a2de733c78fa ("btrfs: scrub") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 958a89357504c44171a32866288269df938778c3 Author: Filipe Manana Date: Thu Oct 15 18:45:45 2026 +0100 btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe [ Upstream commit 387d5be169e6644a41dd5865e6a01c9489e996e2 ] If we find errors we are returning the value of 'ret', which has a value of 0 from some previous function call that succeeded, instead of returning an -EIO error. Fix this by returning -EIO instead of 'ret'. Fixes: fab0c0f03cfd ("btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 87ba8421339a0cd1992a2f35530cade2f43a748b Author: Filipe Manana Date: Thu Oct 15 15:55:55 2026 +0100 btrfs: fix fiemap merging compressed extents [ Upstream commit 980fbbd041ac2538fdbe7cfda4253dfc28fdcad1 ] Compressed extents are never supposed to be merged by the fiemap code and reported as a single extent, as each extent's content comes from a different compression stream and has its own header and context. We currently rely on checking the logical and physical address adjacency to prevent merging compressed extents but that is broken. Consider the following reproducer which explains why the merging happens: $ cat test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi mkfs.btrfs -s 4K -f $DEV mount -o compress $DEV $MNT # Do a write that compresses to a single 4K extent and represents the # maximum compressed chunk size (128K). xfs_io -f -c "pwrite 0 128K" $MNT/foo # Sync to flush delalloc and allocate the 4K extent. sync -f $MNT # Now allocate a 124K extent in some other file, which will be adjacent # (to the right) of the 4K extent previously allocated. xfs_io -f -c "falloc 0 124K" $MNT/filler # Do another write to the main file at its current EOF that is # compressible and fits in a 4K extent. xfs_io -c "pwrite 128K 128K" $MNT/foo # Sync to flush delalloc and allocate the 4K extent. sync -f $MNT # Run fiemap which should report 2 encoded extents, each with a # logical size of 128K. xfs_io -c "fiemap -v" $MNT/foo umount $MNT Running this, fiemap will report a single extent: $ ./test.sh (...) /mnt/sdi/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..511]: 26624..27135 512 0x9 Fix this by never attempting to merge extents if the flags contain FIEMAP_EXTENT_ENCODED. Fixes: 4751832da990 ("btrfs: fiemap: Cache and merge fiemap extent before submit it to user") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit badfe3e6bea057c863d50bdcc9c9075f582a9a7c Author: guolingxing Date: Thu Oct 15 09:59:01 2026 +0000 btrfs: verity: propagate orphan insertion errors when enabling verity [ Upstream commit 45a686dff6b91c3667cd8188d3a02c69f62f4d00 ] btrfs_begin_enable_verity() ignores the return value of btrfs_orphan_add() and unconditionally returns 0. If orphan insertion fails, btrfs_orphan_add() aborts the transaction, but the generic fs-verity code still proceeds with Merkle tree construction because the begin_enable_verity callback reported success. Return the error so that fs-verity stops immediately instead of continuing after the initialization failure. The transaction is already aborted by btrfs_orphan_add() and the handle is released by btrfs_end_transaction(), so no additional cleanup is needed. Fixes: 705242538ff3 ("btrfs: verity metadata orphan items") Signed-off-by: guolingxing Reviewed-by: Qu Wenruo Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 3ec66b8c095b14e12157f4c92d23c4d126b0cbdb Author: Tejun Heo Date: Thu Oct 29 12:28:59 2026 -1000 sched_ext: Call ops.sub_attach() only while the cgroup is online [ Upstream commit 0aba89317f386f43c946d91238af28250b4dbc60 ] The parent's ops.sub_attach() runs before the enable work checks that the cgroup is still online, so the parent can get an attach for a cgroup whose rmdir already returned. That complicates parents where cgroup cleanup and sub-scheduler attach race. Check CSS_ONLINE and call ops.sub_attach() under cgroup_lock(), so that the parent sees an attach only for a cgroup that is online. Fixes: ebeca1f930ea ("sched_ext: Introduce cgroup sub-sched support") Signed-off-by: Tejun Heo Reviewed-by: Andrea Righi Signed-off-by: Sasha Levin commit f7e155df7a413483d54705979134da3e708594f6 Author: Jose Fernandez (Anthropic) Date: Fri Oct 30 18:14:22 2026 +0000 bpf: Fix jited line info off by the CFI preamble [ Upstream commit 3e4279dc5144a5afcda101df23792b13e94c3859 ] With CONFIG_CFI=y, every jited line info entry after a function's first is cfi_get_offset() bytes too high on x86-64, riscv64 and arm64, so tools that use it show the wrong source line. The JITs count the insn_to_jit_off[] offsets from the start of the image. Since the CFI commits below, prog->bpf_func starts cfi_get_offset() bytes into the image, and bpf_prog_fill_jited_linfo() adds the offsets to prog->bpf_func. s390 corrects its offsets before the call, the other three JITs do not. Subtract cfi_get_offset() once in bpf_prog_fill_jited_linfo() and drop the s390 correction. jited_linfo[0] stays prog->bpf_func, the function's ksym address. Without CONFIG_CFI, cfi_get_offset() is 0 and nothing changes. Fixes: 4f9087f16651 ("x86/cfi,bpf: Fix BPF JIT call") Fixes: e63985ecd226 ("bpf, riscv64/cfi: Support kCFI + BPF on riscv64") Fixes: 710618c760c0 ("arm64/cfi,bpf: Support kCFI + BPF on arm64") Reported-by: Sashiko Reported-by: Alexei Starovoitov Signed-off-by: Jose Fernandez (Anthropic) Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261030-b4-arm64-bpf-linfo-cfi-v2-1-4eac83435d4b@linux.dev Closes: https://lore.kernel.org/all/20260904014748.C04AA1F000E9@smtp.kernel.org/ Closes: https://lore.kernel.org/all/DLNXZ2WK7TPD.2RZBUNRS4FA4L@gmail.com/ Signed-off-by: Sasha Levin commit feb129f10538dfac80b9ab298fd9455d51f2e4d9 Author: Daniel Borkmann Date: Wed Oct 28 21:23:44 2026 +0100 x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address [ Upstream commit 31ac959c915cc7f379d84cf9dadf3664cbcace02 ] Since commit 0c3772a8db1f ("x86/ftrace: Implement DYNAMIC_FTRACE_WITH_JMP") ftrace_call_replace() emits a jmp instead of a call when bit 0 of the target is set, the mark of a direct trampoline that is entered by a jmp. ftrace_update_ftrace_func() and arch_ftrace_update_trampoline() use it too, for the call of the ftrace callback in ftrace_caller, ftrace_regs_caller and the ftrace trampolines, but a callback is a C function and can start at an odd address. It does with gcc13 and CONFIG_CC_OPTIMIZE_FOR_SIZE=y: gcc13 has no -fmin-function-alignment, so CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT is not set, and the -falign-functions=16 used in its place does not apply to functions optimized for size. Here ftrace_ops_list_func() starts at: ffffffff810e0147 T ftrace_ops_list_func ftrace_regs_call then becomes a jmp to the byte before it: ftrace_regs_call ffffffff810374f3: e9 4e 8c 0a 00 That byte is the last one of the preceding function's tail jump, and with the first two of ftrace_ops_list_func() it decodes as an inc DWORD PTR [rcx+0x57], which swallows the push %r15 of the prologue. Entered without a return address and one push short, the list function returns through the pt_regs that ftrace_regs_caller saved, here to the saved R14: BUG: unable to handle page fault for address: ffff888116c29f40 #PF: supervisor instruction fetch in kernel mode RIP: 0010:0xffff888116c29f40 R13: 0000000000000000 R14: ffff888116c29f40 R15: 0000000000000000 Call Trace: ? bpf_trampoline_6442499918+0x1/0x149 ? bpf_lsm_file_open+0x5/0x8 ? bpf_lsm_file_open+0x5/0x8 ? security_file_open+0x19/0x46 ? do_dentry_open+0x16c/0x32a The list function is installed whenever two ftrace_ops are registered, and a function that two of them trace calls it. A kprobe next to a BPF trampoline is one such case, and with the single ftrace_ops of the BPF trampolines every update_ftrace_direct_mod() is another, as it registers a stub ops for the sites it modifies. Here, detaching one of several BPF LSM programs from a busy hook crashed the tasks that ran the hook during the update. Bit 0 is free only in the direct trampolines that a dyn_ftrace record can point to, but bit 63 is set in every kernel text address on x86_64. Thus, mark jmp mode by clearing bit 63 instead, so that ftrace_is_jmp() is false for any callback, whatever its alignment, and ftrace_regs_caller sets the bit again where it cleared bit 0 before. A marked address is not canonical, so a return or indirect branch to one that missed ftrace_jmp_get() faults instead of running from a byte before its target. Fixes: 0c3772a8db1f ("x86/ftrace: Implement DYNAMIC_FTRACE_WITH_JMP") Suggested-by: Steven Rostedt Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Reviewed-by: Jiri Olsa Reviewed-by: Steven Rostedt Link: https://patch.msgid.link/20261028202345.1215859-1-daniel@iogearbox.net Signed-off-by: Sasha Levin commit c821c31389df173110a6a00e6f2724006e17cfae Author: Avi Weiss Date: Thu Oct 29 12:36:26 2026 +0200 gpio: omap: Propagate runtime PM failures in probe and request [ Upstream commit 05be1a99d6d68b24cbe24a191e1af67c70193ac3 ] pm_runtime_get_sync() can fail when the OMAP PM domain cannot resume a GPIO controller, but omap_gpio_probe() and omap_gpio_request() ignore its return value. Consequently, probe can register a GPIO controller despite a failed resume, while a GPIO request can report success and modify GPIO state even though runtime-PM acquisition failed. Use pm_runtime_resume_and_get() in both paths and propagate resume errors. On probe failure, disable runtime PM and unprepare the debounce clock when applicable. Reproduced both failures on QEMU N800 by injecting -EIO from the OMAP PM-domain resume callback. The original driver continues probe and accepts the GPIO request - while the patched driver rejects both operations with -EIO. Normal GPIO controller registration continues to work without fault injection. Fixes: 77640aabd755 ("OMAP: GPIO: Implement GPIO as a platform device") Fixes: 55b93c32520d ("gpio/omap: use pm-runtime framework") Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261029103626.1527919-2-thnkslprpt@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit e3fc631c54dc3dba83791728ea2d1707e45aa176 Author: Michal Wilczynski Date: Thu Oct 29 09:17:18 2026 +0100 drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes [ Upstream commit 6c6200ffebf9766fd5d9293002298ea371c261c1 ] Sparse (W=1) builds fail because `SIZE_CHECK(struct rogue_fwif_hwrtdata, 384)` expects 384 bytes, but the compiler generates a 336-byte structure. This is due to an alignment conflict: the inner member `cleanup_state` requires 64-byte alignment, but the outer struct is explicitly marked `__aligned(8)`. While a non-sparse build implicitly pads the size to a multiple of 64, a sparse build strictly respects the 8-byte outer alignment, resulting in a size mismatch. Fix this by aligning the entire structure to 64 bytes, which resolves the contradiction and forces the correct 384 byte size on all builds. Fixes: a26f067feac1 ("drm/imagination: Add FWIF headers") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202512131851.1WNXk3BC-lkp@intel.com/ Reviewed-by: Matt Coster Reviewed-by: Luigi Santivetti Signed-off-by: Michal Wilczynski Link: https://patch.msgid.link/20261029-fix_imagination-v4-1-689745dd52ef@samsung.com Signed-off-by: Alessio Belle Signed-off-by: Sasha Levin commit b3517d64bf2d8468758afffb6d0417565f9602f5 Author: Andrea Mayer Date: Wed Oct 28 18:15:11 2026 +0100 seg6: fix transport header for inner IPv4 with IP options [ Upstream commit 5838f10563d58afca6711edb5e4eda968ca181d9 ] The End.DT4, End.DT46 (its IPv4 path only) and End.DX4 behaviors set the transport header of the decapsulated IPv4 packet at a fixed 20 bytes, the size of an IPv4 header without options. They do not validate the header length either. With options, the transport header points at the first option byte. The effects include: - ping -R sends an echo request with a 60-byte IPv4 header to a local address through an End.DT4 or an End.DX4 SID. Since icmp_rcv() computes the ICMP checksum from the first option byte, the request fails the check and is counted in IcmpInCsumErrors. - A UDP datagram can reach a port that an iptables rule drops. The rule checks the UDP header after the full IPv4 header, while the socket lookup reads it at the fixed 20-byte offset. - With an inbound AH state, ah_input() reads the AH header at the fixed 20-byte offset, but copies the IPv4 header over it with the length in the IHL field. A packet shorter than that length can make ah_input() write past the end of the data, into skb_shared_info when the skb has no tailroom. Validate the inner IPv4 header length with the new helper seg6_validate_iphdr_len() and set the transport header at that length. A packet that is not IPv4, whose header length field is below 5, or whose header is truncated, is dropped with a drop reason. The fix is limited to the header length, which the transport header relies on. Other checks done on IPv4 input, such as the header checksum, the total length and the IP options, are not addressed here. Found by code inspection while reviewing commit 44930446dde4 ("ipv6: seg6: clear IPv4 control block on IPIP decapsulation"), as a pre-existing issue that Sashiko also reported on v2 of that patch. Without this patch, a bpftrace probe on ah_input() shows the reporter's reproducer packet written into skb_shared_info. With it, that packet is dropped before ah_input(), ping -R no longer fails the ICMP checksum, the UDP datagram reaches its real port, and the SRv6 selftests still pass. These effects reproduce on an unmodified kernel, without error injection. Fixes: 891ef8dd2a8d ("ipv6: sr: implement additional seg6local actions") Fixes: 664d6f86868b ("seg6: add support for the SRv6 End.DT4 behavior") Reported-by: Hazley Samsudin Closes: https://lore.kernel.org/netdev/20260809221915.2ffc1ecd0f445fcb70270e31@uniroma2.it/ Reviewed-by: David Ahern Reviewed-by: Hangbin Liu Signed-off-by: Andrea Mayer Link: https://patch.msgid.link/20261028171511.35-1-andrea.mayer@uniroma2.it Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0cd07f0d106edfda24f92c437aeb916451e54573 Author: Kang Yang Date: Tue Oct 20 00:52:50 2026 -0700 wifi: ath12k: set MSDU payload correctly [ Upstream commit fe74d991f3387febfd57b65c7383d2d49e14e19a ] ath12k_dp_mon_rx_merg_msdus() mistakenly passes head_msdu to ath12k_dp_mon_rx_msdus_set_payload() while iterating over all MSDUs in the chain. As a result, skb_pull() is applied repeatedly to the head MSDU, whereas the remaining MSDUs are never adjusted. Pass the current MSDU instead so each MSDU is processed exactly once. Also rename the helper parameter from head_msdu to msdu since the helper operates on any MSDU in the chain. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 1cf514fdc790 ("wifi: ath12k: use different packet offset for WCN7850") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20261020-msdupayload-v1-1-1ca9a5936727@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit 1188e36809750306fe0f9cd6e439b6a987d81553 Author: P Praneesh Date: Thu Oct 15 14:14:45 2026 +0530 wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler [ Upstream commit 216dd4fc57435726506e250ba2483f31ddc3c01b ] On AHB platforms such as IPQ5332, IRQ group 3 maps multiple hardware rings to a single NAPI instance. Each ring is assigned its own IRQ line, but all IRQs in the group share one napi struct and one poll function. When two IRQs from the same group fire simultaneously on different CPUs, both handlers call ath12k_ahb_ext_grp_disable(), which invokes disable_irq_nosync() for every IRQ in the group. This increments the interrupt controller's disable reference count for each IRQ twice. The single NAPI poll that runs calls ath12k_ahb_ext_grp_enable() once, decrementing each count from 2 to 1. Because the count never reaches 0, all IRQs in the group remain permanently masked by the interrupt controller. With no further interrupts, TX completions stop being reaped from the WBM release ring. The pending TX descriptor count grows until the WBM idle link descriptor pool is exhausted. Once full, TX ring allocation fails and no new packets including management frames can be enqueued. This causes stations to disassociate with reason 34 (DISASSOC_LOW_ACK) and ath12k_mac_flush() to time out: "failed to flush transmit queue, data pkts req N pending N" where N equals ATH12K_NUM_POOL_TX_DESC(ab). Fix this by using napi_schedule_prep() to atomically test-and-set NAPI_STATE_SCHED before disabling IRQs. Only the first CPU to win the atomic operation disables the group and calls __napi_schedule(). Any concurrent handler that loses the race skips the disable entirely, keeping the reference count balanced. Guard the enable_irq() call in the poll routine with the return value of napi_complete_done() to prevent an unbalanced enable if the NAPI instance was re-scheduled before the poll completed. Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.7-00587-QCAHKSWPL_SILICONZ-1 Fixes: 6cee30f0da75 ("wifi: ath12k: add AHB driver support for IPQ5332") Signed-off-by: P Praneesh Reviewed-by: Karthikeyan Periyasamy Reviewed-by: Baochen Qiang Link: https://patch.msgid.link/20261015084445.3045925-1-praneesh.p@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit daefd6aee980366ce2f9e8aa1135ea2014d521f4 Author: Filippo Falezza Date: Tue Oct 27 01:56:20 2026 +0000 wifi: ath10k: Stop unanswered temperature reads [ Upstream commit 2a87e367c62856b87a90f745c6b7d2eb91e0c51f ] Reading the ath10k hwmon temperature sends WMI_PDEV_GET_TEMPERATURE and waits up to 5 s (ATH10K_THERMAL_SYNC_TIMEOUT_HZ) for the reply event, holding conf_mutex. Not all firmware answers: the WCN3990 firmware WLAN.HL.3.3.1-00694-QCAHLSWMTPLZ-1 on a Motorola Moto G 5G Plus codename nairo (SM7250) never sends the event, so every read of temp1_input stalls for 5 s, logs ath10k_snoc 18800000.wifi: failed to synchronize thermal read and returns -ETIMEDOUT. Tools that read all hwmon sensors, such as lm-sensors, hang for 5 s on every run, and configuration changes of the interface wait for conf_mutex in the meantime. Whether the firmware answers cannot be told from the chip: firmware that answers and firmware that does not both advertise WMI_SERVICE_THERM_THROT, and WCN3990 firmware differs between devices. Instead, remember that the running firmware did not answer, and return -EOPNOTSUPP right away on later reads. Forget it when the firmware starts, so that a restarted or updated firmware is asked again. The first read after each firmware start still takes 5 s when the firmware does not answer. Reads on firmware that answers are unchanged. Fixes: e98199a8c27f ("ath10k: enable QCA6174/QCA9377 to read the chip temperature") Signed-off-by: Filippo Falezza Reviewed-by: Loic Poulain Link: https://patch.msgid.link/20261027-ath10k-temperature-v2-1-0793e80d73bc@gmail.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit e7ed79cf55cdb9cf2e9e917bec9dfe3898c435c0 Author: Hyunchul Lee Date: Wed Oct 28 17:42:48 2026 +0900 ntfs: avoid overflow when limiting attribute read length [ Upstream commit 4b927614d92d7326f265d22b50ba7b4a33966e48 ] ntfs_inode_attr_pread() limits a read to the attribute size using pos + count. A large count can overflow the signed sum and bypass the attribute EOF boundary check. Compare count with isize - pos instead, after validating pos, so the read length limit cannot wrap. Fixes: af0db57d4293 ("ntfs: update inode operations") Signed-off-by: Hyunchul Lee Reviewed-by: Baolin Liu Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 68ec561cfbe96760f9da9e4f0b1f93cfc9a04135 Author: Hyunchul Lee Date: Wed Oct 28 17:42:47 2026 +0900 ntfs: initialize VCN when inserting index entries [ Upstream commit 1f3c5ba3c55c112a0b33c03caa9d5f88bb9e7759 ] When a leaf index entry is promoted during a split, ntfs_ih_insert() extends a copied entry with the NODE VCN field. Initialize that field before copying the new entry into the parent index. The promoted entry must reference the old child VCN, while the existing parent entry is updated to reference the newly allocated right child. Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations") Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 9f96f35e353edb6057b31f0be9383607fc1208b7 Author: Yuanfu Xie Date: Tue Sep 22 21:16:22 2026 +0800 9p: do not store the create fid on special files [ Upstream commit 56894cadf21c34abbba7f74b8f5d78dabf69dd39 ] v9fs_vfs_atomic_open_dotl() always stores the create fid in file->private_data after finish_open(). FIFO and device inodes already have type-specific file_operations that own that field. Overwriting it with the fid makes later read/write/close treat the p9_fid as a pipe_inode_info, which corrupts the fid and can use it after it has been clunked. The non-dotl atomic_open path does not assign the fid this way. Only attach the fid for regular files and directories. Special files do not need the create fid; leave it for the existing p9_fid_put() on the out path so it is clunked before return. KASAN report, linux-stable 4982d3552a3b: BUG: KASAN: slab-use-after-free in anon_pipe_prefill_and_lock+0x376/0x3f0 Read of size 4 at addr ffff88800ab30538 by task repro/1 Call Trace: anon_pipe_prefill_and_lock+0x376/0x3f0 anon_pipe_write+0x127/0x1600 fifo_pipe_write+0x24/0x300 vfs_write+0x659/0xd00 ksys_write+0x10f/0x200 do_syscall_64+0xdd/0x4a0 Fixes: 30d904947459 ("kill struct opendata") Signed-off-by: Yuanfu Xie Message-ID: <92377346-29E9-46D3-96F5-AABA8A64CD57@stu.pku.edu.cn> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit c4df44124ece4f0dc92b3c18598add65b4abf5b4 Author: Yuanfu Xie Date: Tue Sep 22 21:15:36 2026 +0800 9p: fall back to the normal open path for non-regular files [ Upstream commit ff1baa01a6e1f24741f7428119e6f3a61b995604 ] v9fs_vfs_atomic_open() and v9fs_vfs_atomic_open_dotl() call finish_open(file, dentry, generic_file_open) regardless of the file type the server reported for the created dentry. The supplied callback replaces f_op->open in do_dentry_open(), so blkdev_open() never runs for a server-reported device node: an open() with O_CREAT succeeds with f_op = def_blk_fops while f_mapping still points at the 9p inode, because the bdev mapping swap only happens inside blkdev_open(). The block file methods then derive their block_device from that inode with I_BDEV(); the loads land at the tail of a 656-byte v9fs_inode_cache object (offsets +624 and +632), which KASAN reports as slab-out-of-bounds, and the garbage they read is then dereferenced, so the first read(), write(), ioctl() or close() ends in a NULL pointer write and a panic. In the ioctl(BLKGETSIZE64) variant the value read this way is returned to userspace. The server controls the file type reported for the create, so a malicious server can crash the client this way. KASAN report of the read() variant, on a build of linux-stable 2709dd5ae32f: BUG: KASAN: slab-out-of-bounds in blkdev_read_iter+0x3cd/0x440 Read of size 8 at addr ffff88800828ceb0 by task repro/1 Call Trace: dump_stack_lvl+0x7b/0xa0 print_report+0xd0/0x630 kasan_report+0xe5/0x120 blkdev_read_iter+0x3cd/0x440 vfs_read+0x718/0xa50 ksys_read+0x10f/0x200 do_syscall_64+0xdd/0x4a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88800828cc40 which belongs to the cache v9fs_inode_cache of size 656 The buggy address is located 624 bytes inside of allocated 656-byte region [ffff88800828cc40, ffff88800828ced0) A plain open() without O_CREAT is not affected: it runs blkdev_open() and either maps the device correctly or fails with -ENXIO for an rdev with no registered device. When the created inode is not a regular file, clunk the fid the create opened. The unopened fid is already on the dentry. Set FMODE_CREATED and return finish_no_open(file, NULL) so the VFS keeps its dentry reference and calls the inode's ->open. Regular files still use finish_open() with generic_file_open. Fixes: be12af3ef5e6 ("getting rid of 'opened' argument of ->atomic_open() - part 1") Signed-off-by: Yuanfu Xie Message-ID: <908FC420-EC1F-46FC-8526-698F646961A8@stu.pku.edu.cn> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit effcb7c02232330e8d2901990e8d274ded455062 Author: Omokefe Emmanuel Onanaroghene Date: Fri Oct 2 04:58:37 2026 +0100 9p: fix kernel-doc warning for enum p9_session_flags [ Upstream commit d037e9c1b40c28eb57ea10947141cad3781b91a7 ] kernel-doc cannot parse enum p9_session_flags, since its documentation comment is followed by #define lines instead of the enum declaration: fs/9p/v9fs.h:31 : error: Cannot parse enum! Move the three #define lines below the enum whose values they are derived from, and give V9FS_ACCESS_ANY and V9FS_ACCESS_MASK their own kernel-doc comments with the descriptions they had in the enum comment. Also document the four enum members that had no description, using the corresponding mount option wording from Documentation/filesystems/9p.rst. Fixes: 76381a42e4a5 ("fs/9p: Add access = client option to opt in acl evaluation.") Assisted-by: LLM Signed-off-by: Omokefe Emmanuel Onanaroghene Message-ID: <20261002035837.39703-1-emmaonana18@gmail.com> [Dominique: slight reword, also fixed typo in Doc/ for access=client] Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit 00d85b7151ad8390986b2baa7a00f81dde7c8521 Author: Barret Rhoden Date: Thu Jul 2 09:09:32 2026 +0000 9p: treat read return values of 0 as EOF [ Upstream commit a3a6212c7d67baebebd0e4c2cf2ae1b75eb9231e ] If your 9p server shares a synthetic file system such as sysfs, the file size from stat often disagrees with the actual file size. Treat non-error reads of 0 as EOF, except in the case where the request was for 0 bytes. Tested: git@github.com:hugelgupf/p9.git, served "/" on 10.0.2.2 bash-5.3# mount -t 9p -o trans=tcp,port=12345,cache=none 10.0.2.2 /tmp/foo bash-5.3# cat /tmp/foo/sys/devices/system/cpu/online 0-47 Fixes: eb497943fa21 ("9p: Convert to using the netfs helper lib to do reads and caching") Signed-off-by: Barret Rhoden Message-ID: <20260702090941.1298188-1-brho@google.com> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit 4a0eccdd383974b7e353ba53c9c850ffe4ad1fda Author: Matthew Whitehead Date: Tue Sep 29 10:45:28 2026 -0400 scsi: aha1542: Remove unneeded scsi_dma_unmap() call [ Upstream commit 9ec6671b137de06f0345962fb8091466b7d56a96 ] aha1542 never DMA maps the command's scatterlist. Data is bounced through a per-command buffer allocated with dma_alloc_coherent() in aha1542_init_cmd_priv(), the adapter is programmed with acmd->data_buffer_handle, and the payload is copied to and from the request segments in aha1542_queuecommand() and aha1542_free_cmd(). The scsi_dma_unmap() call left in aha1542_free_cmd() therefore unmaps a scatterlist that was never mapped. With CONFIG_DMA_API_DEBUG enabled this results in: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=0 bytes] Remove the call. Verified by testing on real hardware. Fixes: 2f2fef022c3e ("aha1542: use a local bounce buffer") Suggested-by: Laurence Oberman Assisted-by: LLM Signed-off-by: Matthew Whitehead Reviewed-by: Laurence Oberman Link: https://patch.msgid.link/20260929144528.7061-1-tedheadster@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 9bee8b729f1b28bc9d66e216d7d95546c3cee5ed Author: Giuseppe Piscitelli Date: Tue Oct 27 11:08:50 2026 +0100 scsi: core: Balance the pseudo target reap reference [ Upstream commit 8a832fb632da303cdf0704e0d56722ec47799f19 ] With memory allocation profiling enabled, unloading scsi_debug reports allocations left at module unload. A stock Linux 7.2.11 VM without OpenZFS emitted the following on each of three load/unload cycles: [ 1.644665] drivers/scsi/scsi_debug.c:8863 module scsi_debug func:sdebug_add_host_helper has 1024 allocated at module unload [ 1.656260] drivers/scsi/scsi_debug.c:1261 module scsi_debug func:sdebug_target_alloc has 16 allocated at module unload scsi_alloc_target() supplies a reap reference for its caller. The SCSI device initializer takes another reference, which device removal drops. scsi_get_pseudo_sdev() drops its caller reference only when device allocation fails. On success the target cannot be destroyed, retaining its driver-private data and its parent host and adapter. Drop the caller reference in the common cleanup path, as the other scsi_alloc_target() callers do. Fixes: d630fbf6fc8c ("scsi: core: Support allocating a pseudo SCSI device") Signed-off-by: Giuseppe Piscitelli Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/20261027100859.1031135-1-ooonea@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit a1029efa9b9bb264331bd90fc5236e855ba0ab2d Author: Giuseppe Piscitelli Date: Mon Oct 26 21:23:41 2026 +0100 scsi: scsi_debug: Drain target cleanup before module exit [ Upstream commit 34c99ce2993971712d89010a948d2f650687b796 ] Target destruction queues cleanup in an exclusive async domain. The module loader's async_synchronize_full() does not wait for exclusive domains. Wait for target cleanup after removing the hosts and before removing the debugfs root and returning from module exit. Fixes: b402a0dce64a ("scsi: scsi_debug: Fix create target debugfs failure") Signed-off-by: Giuseppe Piscitelli Link: https://patch.msgid.link/20261026202342.668361-1-ooonea@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 6f7ccb231679f1aefd8aaf834a57e85904a48ae5 Author: Imre Kaloz Date: Tue Oct 13 11:42:53 2026 +0200 scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts [ Upstream commit 9a2690eb4bbea8d7fbc3dfe478fca75fe956abb4 ] The REQUEST SENSE length was taken from sg->len after the AHC_DMA_LAST_SEG flag was or-ed in and the value converted to little-endian, so the 8-bit field is 0x80 on big-endian hosts and the target is asked for 128 bytes into a 32-byte buffer. Use the buffer size, as aic79xx does. On an SGI O2 with a Fujitsu MAX3147NC, the sense data of its CHECK CONDITIONs during probe was lost. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Imre Kaloz Link: https://patch.msgid.link/20261013094253.2956-1-kaloz@kernel.org Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 62c58c9b5fe7933146fd348fd90eea1125e7ddc4 Author: Davidlohr Bueso Date: Mon Sep 28 12:58:49 2026 -0700 dma-buf: validate the attachment before asserting its reservation lock [ Upstream commit 6ce0c151d52f6741b6c04569e1886bc7837faa5d ] dma_buf_phys_vec_to_sgt() asserts the reservation lock before its NULL checks run. Validate first, then assert. Fixes: 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine") Reviewed-by: T.J. Mercier Reviewed-by: Christian König Signed-off-by: Davidlohr Bueso Signed-off-by: Christian König Link: https://lore.kernel.org/r/20260928195850.1982569-2-dave@stgolabs.net Signed-off-by: Sasha Levin commit edb6ec2b27e63b6aafe726885c66b367f8b1ae37 Author: Karl Mehltretter Date: Mon Oct 5 08:41:31 2026 +0200 dma-buf: keep the DMA flags in the DMABUF_DEBUG copy [ Upstream commit e87fd0513792a5cf90f502399faa9e19439747e6 ] With DMABUF_DEBUG, dma_buf_map_attachment() hands the importer a copy of the sg_table that keeps only sg_dma_address() and sg_dma_len(). The dma_flags (SG_DMA_BUS_ADDRESS, SG_DMA_SWIOTLB) are dropped. The flags describe the DMA side of an entry, which is the side importers may use. Copy them as well. This is not a bug fix. No importer reads the flags today. Their only readers are dma-iommu, dma-direct and iommu_map_sg(), which are not supposed to see an importer's copy at all. The warn mode added in the next patch keeps its marker in dma_flags and lets importers that do get there continue. They should then see the same flags as without DMABUF_DEBUG. Assisted-by: LLM Fixes: 51db5336e16d ("dma-buf: improve sg_table debugging hack v4") Signed-off-by: Karl Mehltretter Reviewed-by: Christian König Signed-off-by: Christian König Link: https://lore.kernel.org/r/20261005064133.7305-2-kmehltretter@gmail.com Signed-off-by: Sasha Levin commit 49698d8985e029879a3b3df60d5d6b5e92aa4c45 Author: Leon Romanovsky Date: Tue Oct 13 14:46:24 2026 +0300 dma-buf: Restore the scatterlist entry count before freeing [ Upstream commit 052947a3b5e7402eaad53379dfec2ecab27a2d80 ] dma_buf_phys_vec_to_sgt() clears orig_nents to mark the returned table as DMA-only. Since sg_free_table() uses orig_nents to walk and free the scatterlist, dma_buf_free_sgt() leaks the allocation on every successful map/unmap cycle. Restore orig_nents from nents before freeing the table. The helper allocates the DMA list directly, so nents retains the allocation count, including for chained scatterlists. The reported kmemleak output was: KMEMLEAK LEAK: 2 driver-related leak(s) KMEMLEAK LEAK: unreferenced object 0xff11000125ceff00 (size 32): KMEMLEAK LEAK: comm dtr, pid 4432, jiffies 4295031027 KMEMLEAK LEAK: hex dump (first 32 bytes): KMEMLEAK LEAK: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ KMEMLEAK LEAK: 00 00 01 00 28 38 00 00 00 10 00 00 00 00 00 00 ....(8.......... KMEMLEAK LEAK: backtrace (crc 4e8077f2): KMEMLEAK LEAK: __kmalloc_noprof+0x451/0x8b0 KMEMLEAK LEAK: __sg_alloc_table+0x2a0/0x4d0 KMEMLEAK LEAK: sg_alloc_table+0x24/0x170 KMEMLEAK LEAK: dma_buf_phys_vec_to_sgt+0x84f/0xed0 KMEMLEAK LEAK: 0xffffffffa1ad21a8 KMEMLEAK LEAK: dma_buf_map_attachment+0x138/0x690 KMEMLEAK LEAK: ib_umem_dmabuf_map_pages+0x249/0xc90 [ib_core] KMEMLEAK LEAK: 0xffffffffa138f8d2 KMEMLEAK LEAK: 0xffffffffa1396abe KMEMLEAK LEAK: 0xffffffffa1331a5f KMEMLEAK LEAK: 0xffffffffa13320dd KMEMLEAK LEAK: 0xffffffffa1ad696d KMEMLEAK LEAK: 0xffffffffa1acecc7 KMEMLEAK LEAK: 0xffffffffa1acfd17 KMEMLEAK LEAK: __x64_sys_ioctl+0x72c/0x11f0 KMEMLEAK LEAK: do_syscall_64+0xa1/0x4f0 KMEMLEAK LEAK: unreferenced object 0xff1100016dbf3a80 (size 32): KMEMLEAK LEAK: comm dtr, pid 4432, jiffies 4295034705 KMEMLEAK LEAK: hex dump (first 32 bytes): KMEMLEAK LEAK: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ KMEMLEAK LEAK: 00 20 10 00 28 38 00 00 00 10 00 00 00 00 00 00 . ..(8.......... Fixes: 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine") Signed-off-by: Leon Romanovsky Reviewed-by: Jason Gunthorpe Signed-off-by: Christian König Link: https://lore.kernel.org/r/20261013-dma-buf-fixes-v1-1-0e2d9ca41f3a@nvidia.com Signed-off-by: Sasha Levin commit c4cc5ea30e1e03640c4702b3e488572258e33249 Author: Wang Wensheng Date: Sun Oct 4 15:57:55 2026 +0800 printk_ringbuffer: Fix space_used() when blk_lpos->next overflows [ Upstream commit 2b2dc9dd356aed030e7ac11469d12f736793bc89 ] Since commit 67e1b0052f6b ("printk_ringbuffer: don't needlessly wrap data blocks around") blk_lpos is treated as not wrapped when blk_lpos->next overflows to the start of data_ring. We use the indices of blk_lpos->next and blk_lpos->start to calculate the size of the data_block. This computes zero minus a small positive value, resulting in underflow and an unexpectedly large value. Simply using the original lpos with wrap-counts solves the problem. Fixes: 67e1b0052f6b ("printk_ringbuffer: don't needlessly wrap data blocks around") Signed-off-by: Wang Wensheng Reviewed-by: John Ogness Reviewed-by: Petr Mladek Link: https://patch.msgid.link/20261004075755.363989-1-wsw9603@163.com Signed-off-by: Petr Mladek Signed-off-by: Sasha Levin commit 590345c250df8469bc27d4e7094f57021071ed00 Author: Bart Van Assche Date: Mon Oct 26 12:43:00 2026 -0700 ntfs: Fix error handling in __ntfs_create() [ Upstream commit 5210eadc44ccdd9632b1ee66205742610a486989 ] In __ntfs_create(), if ntfs_init_acl() fails before ntfs_mft_record_alloc() is called, jumping to err_out frees MFT record 0 ($MFT), unmaps an unmapped record and unlocks the unheld &dir_ni->mrec_lock and &ni->mrec_lock mutexes. Call iput(vi) and return ERR_PTR(err) directly instead, matching the ntfs_mft_record_alloc() failure path right below it. Fixes: af0db57d4293 ("ntfs: update inode operations") Signed-off-by: Bart Van Assche Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit d1de90a65fbd96046b8fe2f8d985121d87880064 Author: Mehmet Fide Date: Mon Oct 5 09:22:09 2026 +0200 wifi: ath9k_htc: start ANI when an AP interface begins to beacon [ Upstream commit 5c1b202d67a212c87e7389aaa093ce77828fa98f ] ath9k_htc_vif_reconfig() re-arms ANI after a channel change when an AP interface beacons. mac80211 configures the channel before it enables the beacon, so during a normal AP start that never triggers, and the start from add_interface that the previous patch removed was cancelled by the same channel configuration: with hostapd, ANI and the periodic calibration it drives did not run in AP mode until a later channel change. Start ANI when the beacon is enabled. The channel and its calibration data are in place by then, which is the state vif_reconfig() re-arms it in, and remove_interface() already stops it with the last AP interface. Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode") Signed-off-by: Mehmet Fide Acked-by: Toke Høiland-Jørgensen Link: https://patch.msgid.link/20261005072209.4101009-3-mehmet.fide@gmail.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit b06b1fc78c33c3ce4a543a9325dec5972d068d36 Author: Miaoqing Pan Date: Tue Sep 15 16:00:53 2026 +0800 wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect [ Upstream commit 843a011534b007a609ae25a91581c5c535e78741 ] In ath12k_mac_op_sta_state(), when transitioning an MLO station from IEEE80211_STA_NOTEXIST to IEEE80211_STA_NONE, after ath12k_dp_peer_create() succeeds, on is_sta_assoc_link verification failure, it takes the 'goto exit' path instead of 'goto peer_delete', leaving a stale dp_peer on the dp_peers_list. On the next connection attempt, ath12k_dp_peer_create() finds the stale entry and returns -EEXIST (-17): wlP4p1s0: failed to insert STA entry for the AP (error -17) Fix it by changing 'goto exit' to 'goto free_unassign_link'. Also, there is another error path in ath12k_mac_op_sta_state() that jumps to peer_delete after ath12k_mac_assign_link_sta() succeeds, without undoing the assignment through ath12k_mac_free_unassign_link_sta(). As a result, the link RCU pointer remains assigned and a stale bit is left in ahsta->links_map, which can trigger the same -EEXIST failure on subsequent reconnect attempts. Fix this by redirecting that error path to free_unassign_link instead. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 0cd46d1f36ce ("wifi: ath12k: identify assoc link vif in station mode") Fixes: ee16dcf573d5 ("wifi: ath12k: Define ath12k_dp_peer structure & APIs for create & delete") Signed-off-by: Miaoqing Pan Reviewed-by: Rameshkumar Sundaram Reviewed-by: Baochen Qiang Link: https://patch.msgid.link/20260915080053.918500-1-miaoqing.pan@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit 10a9fc0b16bcc3dcd6e707f2bb06592a38048ece Author: Lorenzo Bianconi Date: Thu Oct 15 11:17:40 2026 +0200 wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers [ Upstream commit 1e678e37ff13e45f22d78d802fcefa8f9a0d9395 ] When a MSDU is split across multiple RX buffers, the msdu_end TLV is populated only in the last buffer. Since commit e8a1e49c6328 ("wifi: ath12k: Add new infra for the rx path"), the RX info extraction in ath12k_hal_extract_rx_desc_data_*() helpers runs before the MSDU is coalesced, so the msdu_end-derived fields (decap_type, mesh_ctrl_present, is_from_ds, is_to_ds, is_mcbc, is_decrypted, sgi, rate_mcs, bw, phy_meta_data, pkt_type, nss, checksum flags and err_bitmap, plus tid on QCN9274) were read from the first buffer, where that TLV is not valid. As a result decap_type was reported as DP_RX_DECAP_TYPE_RAW and the frame was handed to mac80211 with a raw 802.11 header instead of being converted to an ethernet frame, breaking reception of any frame larger than the single RX buffer. Fix it by parsing the msdu_end fields from the last buffer (ldesc) in ath12k_hal_extract_rx_desc_data_{wcn7850,qcn9274,qcc2072}(), keeping the mpdu_start fields (enctype, seq_no, peer_id and addr2) on the first buffer (rx_desc). The tid field is read from mpdu_start on WCN7850 and QCC2072, and from msdu_end on QCN9274. For single-buffer MSDUs rx_desc and ldesc point to the same descriptor so the behavior is unchanged. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: e8a1e49c6328 ("wifi: ath12k: Add new infra for the rx path") Reviewed-by: Vasanthakumar Thiagarajan Reviewed-by: Baochen Qiang Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261015-ath12k-fix-descap-multiple-rx-buf-v2-1-4cde055677ed@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin commit b0a876de69f8d9c7398ef8eb2b833c63f4d29133 Author: Avi Weiss Date: Thu Oct 15 20:57:01 2026 +0300 fsnotify: preserve 64-bit pre-content ranges [ Upstream commit 1dcf2be94b9be2d366a0d2b70c2b1c7ebccf1443 ] vfs_fallocate() and remap_verify_area() pass 64-bit lengths to fsnotify_file_area_perm(), which truncates them to size_t on 32-bit systems. Use 64 bit (unsigned) types throughout the entire pre-content notification chain to keep the full range. The userspace range field is already 64-bits. Fixes: 9740d17162de ("fsnotify: pass optional file access range in pre-content event") Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261015175701.3674449-1-thnkslprpt@gmail.com Signed-off-by: Jan Kara Signed-off-by: Sasha Levin commit 11e56970ff5231b10664c216ec5b7e7a73c24b67 Author: Cosmin Ratiu Date: Wed Oct 21 17:41:11 2026 +0300 wifi: wext: Limit notifier event flushes to the device's netns [ Upstream commit 48c0045366bec142d053f7cf76fb9dd7127cd231 ] With mlx5 netdev instance locking enabled, registering an IPoIB netdev calls the WEXT notifier while holding the instance mutex. Its call to wireless_nlevent_flush() takes net_rwsem to walk every namespace, completing the following lockdep dependency cycle: netdev instance mutex -> net_rwsem (read) -> GID table mutex -> event_handler_rwsem (read) -> netdev instance mutex RoCE GID enumeration takes the GID table mutex under net_rwsem. GID updates dispatch events under the table mutex, taking event_handler_rwsem. The IPoIB event handler takes the netdev instance mutex in ipoib_queue_work() to traverse child interfaces. The all-namespace walk originated in the single global worker servicing per-namespace WEXT queues. The ordering fixes later reused that routine in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages from following RTM_DELLINK or reporting stale interface flags. A notifier only needs to drain the affected device's namespace; there is no reason for it to walk and flush all namespaces. Pass dev_net(dev) from both notifier callers and make the flush helper operate on that namespace. Keep the all-namespace walk and net_rwsem in the existing worker. This removes the instance-mutex -> net_rwsem dependency while retaining synchronous flushing from the notifiers. It may seem strange that the fix for a lock cycle across multiple subsystems lies in a completely unrelated part of the code, but this seemed the most justified lock cycle edge to break. Fixes: 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking") Signed-off-by: Cosmin Ratiu Link: https://patch.msgid.link/20261021144111.611840-1-cratiu@nvidia.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin commit d3d83f3031d1a205ba6cc115db63f469361ee0c1 Author: Devin Wittmayer Date: Thu Oct 15 22:27:22 2026 -0700 drm/panic: Accept a trailing newline in panic_screen [ Upstream commit 3706caf4da279686b9b95a253eb1d39b1fa12192 ] Setting the panic screen through sysfs with echo fails with EINVAL, because the value ends in a newline. Ignore it when matching. Fixes: e85e9ccf3f84 ("drm/panic: Report invalid or unsupported panic modes") Signed-off-by: Devin Wittmayer Reviewed-by: Jocelyn Falempe Reviewed-by: Tvrtko Ursulin Link: https://patch.msgid.link/20261016052722.60051-2-lucid_duck@justthetip.ca Signed-off-by: Jocelyn Falempe Signed-off-by: Sasha Levin commit b56890837fd8fbb840d5e21f2eb16446e827917a Author: Antony Antony Date: Wed Oct 7 11:36:08 2026 +0200 docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple [ Upstream commit dcf413245c8c2351f7f80502f89c344256f61a66 ] Document mark as part of the EEXIST tuple and update the SA lookup description to match. Fixes: c13c0cc6f52e ("xfrm: add documentation for XFRM_MSG_MIGRATE_STATE") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 0c9e215bcbeb6f1a4f3457d244fc8b98bba09899 Author: Antony Antony Date: Wed Oct 7 11:35:58 2026 +0200 xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state() [ Upstream commit 24bc5e549913c37fa30693fd3a62a16757c14327 ] xfrm_init_state() takes an extack parameter but doesn't pass it to xfrm_init_replay(), so replay-window errors can't be reported via extack. Fixes: 231a1744dc43 ("xfrm: add extack to xfrm_init_state") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 0b0016bd4a1c9081edf9f38b86a95d93f8ad8510 Author: Antony Antony Date: Wed Oct 7 11:35:48 2026 +0200 xfrm: include mark in MIGRATE_STATE SA collision check [ Upstream commit a46232c697c809aaa2b0ad18157b49d66201fd7f ] The SA lookup tuple is (daddr, spi, proto, family, mark), but the EEXIST pre-check and the xfrm_state_insert() vs xfrm_state_add() decision only considered daddr and family, ignoring mark. A migration that only changes the mark inserts a duplicate SA tuple into the hash tables. The collision check is implemented as xfrm_state_mark_collides(), which walks the SPI hash bucket for the target tuple and excludes the state being migrated by pointer, rather than doing a separate exact-match lookup followed by a wildcard lookup and comparing the result against self. Before: root@west:~# ip xfrm state add src 10.1.1.1 dst 10.1.1.2 proto esp \ spi 0x1000 reqid 100 mode tunnel aead "rfc4106(gcm(aes))" \ 0x1111111111111111111111111111111111111111 96 \ mark 0x1 mask 0xff root@west:~# ip xfrm state add src 10.1.1.1 dst 10.1.1.2 proto esp \ spi 0x1000 reqid 100 mode tunnel aead "rfc4106(gcm(aes))" \ 0x1111111111111111111111111111111111111111 96 \ mark 0x2 mask 0xff root@west:~# ip xfrm state migrate dst 10.1.1.2 proto esp spi 0x1000 \ mark 0x1 mask 0xff \ new-dst 10.1.1.2 new-src 10.1.1.1 new-reqid 100 \ new-mark 0x2 mask 0xff ip x s src 10.1.1.1 dst 10.1.1.2 proto esp spi 0x00001000 reqid 100 mode tunnel replay-window 0 mark 0x2/0xff aead rfc4106(gcm(aes)) 0x1111111111111111111111111111111111111111 96 anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000 src 10.1.1.1 dst 10.1.1.2 proto esp spi 0x00001000 reqid 100 mode tunnel replay-window 0 mark 0x2/0xff aead rfc4106(gcm(aes)) 0x1111111111111111111111111111111111111111 96 anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000 sel src 0.0.0.0/0 dst 0.0.0.0/0 Notice two states with same mark 0x2/0xff. After: Error: New SA tuple already occupied. Fixes: a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration") Reported-by: Sashiko Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 8081ad916bb7662c96728023614e4c522e40cb39 Author: Antony Antony Date: Wed Oct 7 11:35:39 2026 +0200 xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path [ Upstream commit da94223774ea012188ef76f89e0bd642b39ba517 ] In the error path, the cloned state is dropped without removing its hardware offload, leaking the offloaded SA entry. Fixes: a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration") Reported-by: Sashiko Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 54373e43af790a0adfade92a2aa8f1c7afb8251c Author: Antony Antony Date: Wed Oct 7 11:35:27 2026 +0200 xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state() [ Upstream commit 3eb841b771e81e0692b3ebfc75fdb774022cc4f6 ] A concurrent delete can free the migrated state before xfrm_do_migrate_state() finishes using it. Fixes: a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration") Reported-by: Sashiko Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 682c25fb824de2159460c04bb3a464da6fbaa824 Author: Antony Antony Date: Wed Oct 7 11:35:09 2026 +0200 xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups [ Upstream commit 6362f459bfc485d805f0439ae4566c1b014abfa4 ] Add __xfrm_state_lookup_exact(); wire it into DELSA/GETSA, GETAE/NEWAE, EXPIRE, MIGRATE_STATE. xfrm_state_update() (UPDSA) keeps wildcard match because ALLOCSPI's larval state may be unmarked (mark 0/0), so an exact-match UPDSA would not find it and the ADD fallback would then fail with -EEXIST via xfrm_state_add(). Fixes: 3d6acfa7641f ("xfrm: SA lookups with mark") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 3fb765116c09040fab08b2b829b45069467d3a70 Author: Deepanshu Kartikey Date: Sun Sep 13 08:49:06 2026 +0530 batman-adv: avoid WARN_ON for orig_ifinfo allocation failure [ Upstream commit dfa953ba5366b0a80c303700dab2bbcbdc5c27e9 ] batadv_orig_ifinfo_new() returns NULL only when its GFP_ATOMIC allocation fails, which is a normal runtime condition and not a bug. batadv_v_ogm_forward() already handles this the same way, simply checking for NULL without a WARN_ON. Do the same in batadv_iv_ogm_update_seqnos() to avoid a spurious WARN_ON splat when the allocation fails (e.g. under fault injection). Fixes: 7351a4822d42 ("batman-adv: split out router from orig_node") Reported-by: syzbot+a079f084653164a652d1@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=a079f084653164a652d1 Signed-off-by: Deepanshu Kartikey Signed-off-by: Sven Eckelmann Signed-off-by: Sasha Levin commit 9b2a11a479514b977ac8902603cc7e956188d0cd Author: Shubham Antil Date: Wed Oct 7 13:28:07 2026 +0530 xfrm: zero-initialise km_event in the replay-notify path [ Upstream commit e35a12dffd5da67b6ca12bd23eebdd0570592205 ] xfrm_replay_notify(), xfrm_replay_notify_bmp() and xfrm_replay_notify_esn() declare a struct km_event on the stack and initialise only its .event and .data.aevent fields, leaving .seq and .portid uninitialised. build_aevent() then builds the XFRM_MSG_NEWAE message with those fields: nlmsg_put(skb, c->portid, c->seq, ...) so the netlink header of a replay event carries uninitialised stack values rather than defined ones. This was confirmed at runtime rather than by inspection alone: the .seq and .portid carried in that header hold values that nothing in the replay path assigns. The request-driven paths set these header fields from the requester (xfrm_get_ae() / xfrm_new_ae()); only the kernel-originated replay path leaves them unset. Zero-initialise the event so the header fields are 0, the correct value for a kernel-originated notification. Fixes: f8cd54884e67 ("[IPSEC]: Sync series - core changes") Reported-by: Giovanni Vignone Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Shubham Antil Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin commit 32ab49b914654dc1fe2364f091f2104953a79f36 Author: Haobin Wu <853555@gmail.com> Date: Fri Sep 18 10:48:49 2026 +0800 9p: skip intermediate directory entry name copy in p9dirent_read() [ Upstream commit 8bb0279930cc90975f03bad4d83282613e5f57fa ] v9fs_dir_readdir_dotl() decodes each entry of a Rreaddir reply with p9dirent_read(), which parses it through p9pdu_readf("Qqbs"). The 's' conversion in p9pdu_vreadf() already allocates a NUL-terminated copy of the name from the wire buffer; p9dirent_read() then strscpy()s that copy into the fixed 256-byte p9_dirent::d_name and frees the original. The wire format carries the name length in 16 bits, so a name longer than 255 bytes is valid on the wire and may well be valid on the server's filesystem, but it makes strscpy() return -E2BIG. v9fs_dir_readdir_dotl() turns that into -EIO and aborts getdents64(), so every entry after the long one disappears from the listing. Drop the second copy: keep the string allocated by p9pdu_vreadf() in p9_dirent and let v9fs_dir_readdir_dotl(), its only user, free it once dir_emit() has consumed it. p9_dirent is a short-lived stack object, so the string's lifetime does not change. Note that the VFS only rejects names of PATH_MAX bytes or more in verify_dirent_name(), so after this change a name between NAME_MAX and PATH_MAX is returned by getdents64() even though any later lookup on it fails with -ENAMETOOLONG. The next patch skips such entries. Fixes: 7751bdb3a095 ("9p: readdir implementation for 9p2000.L") Closes: https://github.com/microsoft/WSL/issues/41192 Signed-off-by: Haobin Wu <853555@gmail.com> Reviewed-by: Christian Schoenebeck Message-ID: <20260918024851.51229-2-853555@gmail.com> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit 840ae53432e569266879dddcaf06993ec2276ec8 Author: Yizhou Zhao Date: Fri May 29 16:10:25 2026 +0800 net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx [ Upstream commit 5c69297356bf6d04d8222f52717c6c4aa73e5d2c ] When p9_usbg_close() is called, it invokes usb9pfs_clear_tx() but does not clear usb9pfs->client nor usb9pfs->in_req->context afterwards. The 9p client core (p9_client_destroy) calls close() and then kfree(clnt), so after p9_usbg_close returns the client struct is freed. If the USB gadget is later disabled (e.g., host disconnect), usb9pfs_disable calls usb9pfs_clear_tx again, which passes the dangling usb9pfs->client pointer to p9_client_cb. Inside p9_client_cb, p9_req_put(c, req) dereferences the freed client to access its reqs IDR, causing a use-after-free. Additionally, usb9pfs_clear_tx does not clear usb9pfs->in_req->context after calling p9_client_cb, so a second invocation finds a stale request pointer and attempts double-completion, further compounding the UAF risk. Fix by: 1. Clearing usb9pfs->in_req->context to NULL in usb9pfs_clear_tx() before checking usb9pfs->client, so that even if the client is gone the stale request pointer is consumed and cannot cause double-completion. 2. Adding a NULL check on usb9pfs->client in usb9pfs_clear_tx() to skip p9_client_cb() when the client has already been destroyed. 3. Setting usb9pfs->client = NULL in p9_usbg_close() after calling usb9pfs_clear_tx(), to prevent any subsequent call from dereferencing the freed client pointer. Fixes: a3be076dc174 ("net/9p/usbg: Add new usb gadget function transport") Reported-by: Yizhou Zhao Reported-by: Yuxiang Yang Reported-by: Ao Wang Reported-by: Xuewei Feng Reported-by: Qi Li Reported-by: Ke Xu Assisted-by: GLM:GLM-5.1 Signed-off-by: Yizhou Zhao Message-ID: <20260529081026.77732-1-zhaoyz24@mails.tsinghua.edu.cn> Acked-by: Michael Grzeschik Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit c1495c9ae0601cd0f31cf7705a2e8f2beeca8f8c Author: Yizhou Zhao Date: Fri May 29 16:18:16 2026 +0800 net/9p/usbg: fix descriptor cleanup use-after-free [ Upstream commit 0955472fff1e9f9e410a0300136924ebc8bd7a16 ] usb9pfs_free_func() frees the f_usb9pfs object before calling usb_free_all_descriptors(). The usb_function passed to the latter is embedded in the freed object, so removing the function from a gadget dereferences freed memory. The failing teardown sequence is: configfs unlink usb9pfs_free_func() kfree(usb9pfs) usb_free_all_descriptors(f) dereference the embedded usb_function KASAN reported: BUG: KASAN: slab-use-after-free in usb_free_all_descriptors+0x138/0x190 Read of size 8 at addr ffff888106a73088 by task poc/95 Call Trace: usb_free_all_descriptors+0x138/0x190 config_usb_cfg_unlink+0x1f0/0x2f0 configfs_unlink+0x321/0x6f0 Free the descriptors before freeing their containing object. Fixes: a3be076dc174 ("net/9p/usbg: Add new usb gadget function transport") Reported-by: Yizhou Zhao Reported-by: Yuxiang Yang Reported-by: Ao Wang Reported-by: Xuewei Feng Reported-by: Qi Li Reported-by: Ke Xu Assisted-by: GLM:GLM-5.1 Signed-off-by: Yizhou Zhao Co-developed-by: Chengfeng Ye Signed-off-by: Chengfeng Ye Acked-by: Michael Grzeschik Message-ID: <20260529081817.77898-1-zhaoyz24@mails.tsinghua.edu.cn> Message-ID: <20260731150414.3135662-1-nicoyip.dev@gmail.com> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit f20d28cc1e9ac9da0a63bbfe048e3ce4d501d182 Author: Yizhou Zhao Date: Fri May 29 17:06:24 2026 +0800 9p: use fc->net_ns for network namespace in RDMA and socket transports [ Upstream commit 37dce65a0b4356d7ec289a5d09cece5db241c302 ] The 9p RDMA transport currently passes &init_net to rdma_create_id(). As a result, RDMA address resolution and connection setup are performed in the initial network namespace, even when the mount is initiated from a non-initial network namespace. This differs from the socket-based 9p transports, which create sockets in current->nsproxy->net_ns. Use fc->net_ns for both the RDMA and socket transports instead, so that transport setup follows the VFS mount namespace context rather than depending on the calling process's current namespace. This avoids surprising behaviour where a 9p RDMA mount from a container or other non-initial network namespace may use the host namespace for RDMA CM operations. Fixes: fa20105e09e9 ("IB/cma: Add support for network namespaces") Reported-by: Yizhou Zhao Reported-by: Yuxiang Yang Reported-by: Ao Wang Reported-by: Xuewei Feng Reported-by: Qi Li Reported-by: Ke Xu Suggested-by: Dominique Martinet Assisted-by: GLM:GLM-5.1 Signed-off-by: Yizhou Zhao Message-ID: <20260529090625.78761-1-zhaoyz24@mails.tsinghua.edu.cn> Signed-off-by: Dominique Martinet Signed-off-by: Sasha Levin commit 2a1d7429a50a69aec1f5e4d2dc2be477c0356e5f Author: Nick Venenga Date: Wed Sep 2 00:59:10 2026 +0000 wifi: rtw89: 8922au: add ASUS BE93 [ Upstream commit 475539db19530b7e134f58555e1afcae21d419f3 ] ASUS USB-BE93 Mini USB-C adapter Originally added and tested here https://github.com/morrownr/rtw89/pull/121 Acked-by: Ping-Ke Shih Signed-off-by: Nick Venenga Link: https://patch.msgid.link/010f01a05fa084ba-80349068-cd1f-4e4e-99f5-8cf6f4c03216-000000@us-east-2.amazonses.com Signed-off-by: Ping-Ke Shih Signed-off-by: Sasha Levin commit 7c4b4b95b624d1312ce8cd119b51c8d997181007 Author: Nick Venenga Date: Sat Aug 29 14:53:24 2026 +0000 wifi: rtw89: 8922au: Add support for TP-Link TBE400U [ Upstream commit de2cb461456143a69845c24ce38ac14a61d6e166 ] idVendor=37ad, idProduct=0104 TP-Link TBE400U (USB-C, no external antenna) idVendor=37ad, idProduct=0106 TP-Link Archer TBE400U Plus (USB-A, antenna) https://github.com/morrownr/rtw89/pull/123 https://github.com/morrownr/rtw89/commit/c98e6ff31c331be35383b5a500cfaf76620e2d0c Signed-off-by: Nick Venenga Acked-by: Ping-Ke Shih Link: https://patch.msgid.link/010f01a04e02d70c-a52abf35-2e60-47a5-99f5-b064b344ac19-000000@us-east-2.amazonses.com Signed-off-by: Ping-Ke Shih Signed-off-by: Sasha Levin commit bc8f03bf412df12b28ee3dcf1780d6458aa4a3e4 Author: Bitterblue Smith Date: Wed Aug 19 23:06:10 2026 +0300 wifi: rtw89: usb: Avoid crash with dynamically added device ID [ Upstream commit b1827227176821af9bba0cb643728d23328f3660 ] Adding a device ID via sysfs causes a crash when the device is plugged in, because the driver_info pointer is null. Check for null driver_info in rtw89_usb_probe() and add a wrapper in each driver to pass it a reasonable default value. Signed-off-by: Bitterblue Smith Acked-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/7a537b2e-67d2-40fb-8ef2-fcbc7bbc93af@gmail.com Signed-off-by: Sasha Levin commit 37e81f10ece145cb0e9b6c98a3addef95d227f1c Author: Dmitry Torokhov Date: Wed Nov 11 18:33:45 2026 -0800 Input: destroy force-feedback device on input unregistration [ Upstream commit 2ae35f090d029d2d8491b0a7f98a04c5c05d0a44 ] When an input device is unregistered while userspace holds an open file descriptor to its event node, input_dev_release() is deferred until the last file descriptor is closed. Because input_ff_destroy() was only called from input_dev_release(), force-feedback teardown (ff->destroy and freeing ff->private) could run after the parent driver had already unbound, freed its device state, or even been unloaded via rmmod, causing use-after-free errors or page faults in unmapped module text. Commit ef166ce08801 ("Input: stop force-feedback timer when unregistering input devices") added a separate ff->stop callback for ff-memless, but left ff->destroy invoked from input_dev_release(). Once __input_unregister_device() has disconnected all input handlers (which flushes effects, closes the device, and marks evdev dead) and deleted the device from sysfs, nothing accesses dev->ff anymore. Call input_ff_destroy() directly in __input_unregister_device() so that ff->destroy() always runs synchronously while the driver and its module are still active, and remove the now-redundant ff->stop callback. Keep input_ff_destroy() in input_dev_release() (where it is a no-op once dev->ff is NULL) to handle input_free_device() on devices that were never registered. Fixes: 509ca1a93836 ("Input: implement new force feedback interface") Reported-by: Gideon Heinz Closes: https://lore.kernel.org/r/CAPb1+K2BxnfQ7VUQ15td5f9pVhn-ARSM9EjfOU8WuW72o+cvPg@mail.gmail.com Tested-by: Gideon Heinz Link: https://patch.msgid.link/2f722967b6db0692d4dd4164aff39b62@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin commit e0d529a5d9f149947818adf2951e6a3c0ec2c5d9 Author: Bryan Cochrane Date: Mon Nov 9 20:42:35 2026 -0800 bnxt_en: Take RTNL before netif_close() when aborting FW reset [ Upstream commit bf83b257423bb557b970df3d7ece32fbd85f3bd4 ] netif_close() must be called with RTNL held in addition to the netdev instance lock: __dev_close_many() asserts it, and the NETDEV_GOING_DOWN and NETDEV_DOWN notifier chains it runs rely on it for serialization. Commit 004b5008016a ("eth: bnxt: remove most dependencies on RTNL") replaced rtnl_lock() with netdev_lock() in bnxt_fw_reset_task() and bnxt_fw_reset(). That is sufficient for the paths that only tear the NIC down internally with __bnxt_close_nic(), but the abort paths close the netdev via bnxt_fw_reset_abort() -> netif_close(), and the error path in bnxt_fw_reset() calls netif_close() directly. Those now run without RTNL and trigger a WARN_ONCE() cascade when a firmware reset is aborted: RTNL: assertion failed at net/core/dev.c (1740) WARNING: net/core/dev.c:1740 at __dev_close_many+0x1be/0x1f0 Workqueue: bnxt_pf_wq bnxt_fw_reset_task [bnxt_en] Call Trace: netif_close_many+0xb5/0x190 netif_close+0xa2/0xd0 bnxt_fw_reset_task.cold+0x8d/0x213 [bnxt_en] process_one_work+0x19d/0x3a0 worker_thread+0x1af/0x320 kthread+0xe3/0x120 followed by the same assertion from call_netdevice_notifiers_info(), fib_rules_event(), inetdev_event(), rtnl_fill_ifinfo(), devlink_compat_phys_port_name_get() and ip_mc_down(). This was observed on a machine in real use with a BCM57504 (4 PFs, FW 236.1.153.0) running v7.1.6: the firmware crashed, announced a "Fatal firmware reset event" and then failed to come back within the advertised max wait, so bnxt_fw_reset_task() aborted the reset on all ports: bnxt_en 0000:c1:00.1 eno16905np1: Firmware reset aborted bnxt_en 0000:c1:00.1 eno16905np1: fw_health_status 0x448100 Take RTNL (before the netdev instance lock, matching the OPENING state which already uses rtnl_trylock()) in the fw_reset_abort path of bnxt_fw_reset_task() and route the POLL_VF abort through that same path. In bnxt_fw_reset(), only a PF can reach the bnxt_get_registered_vfs() error path that calls netif_close(), so take RTNL up front via bnxt_rtnl_lock_sp() when BNXT_PF(bp) is true and keep bnxt_lock_sp() on VFs. That avoids dropping the instance lock mid-reset (which would expose a transient BNXT_STATE_IN_FW_RESET and let a concurrent devlink health recover set BNXT_STATE_IN_SP_TASK), avoids racing with bnxt_sriov_configure() updating active_vfs outside RTNL, and keeps VFs from contending on RTNL during recovery while PFs already run on the single-threaded bnxt_pf_wq. The bug was found by inspecting the kernel log of the affected machine and the driver source; the fix was prepared with the help of an AI coding assistant (Gemini based) and reviewed by the submitter. It is build tested (allmodconfig with W=1, plus the same change on top of v7.1.6 built as a module for the affected BCM57504 host). The aborted reset path itself only runs when the firmware fails to return from a reset, which could not be reproduced on demand. Fixes: 004b5008016a ("eth: bnxt: remove most dependencies on RTNL") Cc: stable@vger.kernel.org Signed-off-by: Bryan Cochrane Link: https://patch.msgid.link/20261110044235.204386-1-bcochrane@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d7e6362b0c5f00146b8c0b746bbfd59642e5d2ef Author: Mikhail Malyshev Date: Sat Nov 21 21:31:54 2026 +0000 io_uring/io-wq: apply the current cpuset to new workers Commit 0659e44ce739ecd856164c75a5325b7959a2921d upstream. Since commit 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker"), io_wq_create() copies the cpuset of the creating task into wq->cpu_mask, and io_init_new_worker() gives each new worker that copy. A cpuset change, or a move of the task to another cgroup, updates the workers that exist but not the copy, so workers started later run on the CPUs the cgroup had when the io-wq was created, which may since have been given to other tasks. Workers come and go for the life of the io-wq, and a worker that cpuset moved is also retired at its next idle timeout and replaced on the old CPUs. Keep wq->cpu_mask for the affinity of the io-wq itself, all CPUs or the mask set with IORING_REGISTER_IOWQ_AFF, and intersect it with the cpuset of the worker when the worker starts, falling back to the cpuset if the two do not intersect, as __set_cpus_allowed_ptr() does. Use the same mask in the idle exit test, and go back to all CPUs when the registered affinity is removed. Fixes: 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker") Cc: stable@vger.kernel.org Signed-off-by: Mikhail Malyshev Link: https://patch.msgid.link/20261111162705.1150983-1-mike.malyshev@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 6b87e4b57a203535b2580fc04ddd8b2f08d21cce Author: Siddharth Chintamaneni Date: Sat Nov 21 21:31:53 2026 +0000 io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Commit b7322810d1870ccc0d293ad383d94ef583d5057b upstream. io_buffers_select() passes &arg->out_len to io_provided_buffers_select() on the legacy provided-buffer path. Because callers initialize arg->max_len (from sqe->len) while leaving arg->out_len as 0, io_provided_buffers_select() sees *len == 0 and always selects the full buffer size buf->len, ignoring the user-specified sqe->len limit. Initialize arg->out_len = arg->max_len before calling io_provided_buffers_select(). Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers") Signed-off-by: Siddharth Chintamaneni Link: https://patch.msgid.link/20261116193146.65315-1-sidchintamaneni@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 2ce117df91537f9445787a33fae529cbef7e349a Author: Cheng Yongkang Date: Sat Nov 21 21:31:52 2026 +0000 io_uring/rsrc: keep the old file when a file update fails Commit e5a346e4309d720c47fe8331a00068608fad47dd upstream. __io_sqe_files_update() resets the slot before it calls fget() on the new fd. If fget() fails, the fd is an io_uring file, or the node allocation fails, the update stops and reports that entry as not done, but the old file has already been removed. Later requests that use the slot fail with -EBADF, and if the old file was registered with a tag, its tag CQE is posted as if it had been removed on purpose. Reset the slot only after the new file has been checked and its node allocated, as io_install_fixed_file() does. Removal with fd == -1 still resets the slot right away. Fixes: c3a31e605620 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE") Cc: stable@vger.kernel.org Signed-off-by: Cheng Yongkang Link: https://patch.msgid.link/20261116044531.281978-1-teel4res@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 7716981e3d2e80e32d807813650171712c79a862 Author: Cheng Yongkang Date: Sat Nov 21 21:31:51 2026 +0000 io_uring/timeout: don't rearm a multishot timeout on cancel Commit 97d4a585db2b91d855f957be0a9f126068c5be93 upstream. io_timeout_complete() does not check tw.cancel. When it runs from io_cancel_local_task_work(), a multishot timeout that has not reached its count still posts an IORING_CQE_F_MORE completion and rearms its timer. With a zero interval the timer expires again right away and queues new task work, so the drain keeps running it until posting a CQE fails. Normally the CQ fills up quickly and the request then completes. But if userspace moves the CQ head far ahead of the tail, for example to cq.tail + 0x7fffffff, posting keeps succeeding and ring teardown is delayed for a long time. Don't post another CQE or rearm the timer when tw.cancel is set, so the request completes through io_req_task_complete(), like the poll and linked timeout task work does when cancelled. Fixes: ea97f6c8558e ("io_uring: add support for multishot timeouts") Signed-off-by: Cheng Yongkang Link: https://patch.msgid.link/20261116044519.281756-1-teel4res@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 056f45ebb73144a49ddc196094e84875ab0226fc Author: Jens Axboe Date: Sat Nov 21 21:31:50 2026 +0000 io_uring/io-wq: show stuck workers rather than WARN on a slow exit Commit d4912d6440bf6d255e1fa1c360c8ddb39d0e01bd upstream. io_wq_exit_workers() triggers a WARN_ON_ONCE() if it has waited more than IO_URING_EXIT_WAIT_MAX for the workers to exit. That can be triggered at will, for example with an open on a FUSE mount where the server never replies to the lookup. The worker can't be canceled, and the exit waits until the server goes away. The stack trace from the WARN isn't useful either, as it's that of the exiting task and that is always the task exit, exec, or SQPOLL thread exit path. Print a message and show the workers that are still around instead, that's where the interesting stack traces are. Reported-by: syzbot+b0d54b9e81de55179e47@syzkaller.appspotmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 6a083a13378990e142af7a32783842e1f08aef87 Author: Yang Xiuwei Date: Sat Nov 21 21:31:49 2026 +0000 io_uring/rw: fail soft links on IOPOLL short or error IO Commit 4d3db66c5363dcf42c3d43ebaea330ac2d1888bb upstream. io_complete_rw_iopoll() updates cqe.res when the transfer does not match the requested length, but it does not call req_set_fail(). Soft linked requests then still run after a short or failed IOPOLL read or write. Fixes: b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path") Signed-off-by: Yang Xiuwei Link: https://patch.msgid.link/20261114072246.741950-3-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 236c8655c4e582747e9f811406e5be8c1e5d8394 Author: Yang Xiuwei Date: Sat Nov 21 21:31:48 2026 +0000 io_uring/futex: fail soft links when cancelling a wait Commit 9a7cbe50dd95594d6fb3c57b8454ace58d8d8d0a upstream. __io_futex_cancel() completes the request with -ECANCELED but does not call req_set_fail(). IOSQE_IO_LINK dependents then still run. Fixes: 194bb58c6090 ("io_uring: add support for futex wake and wait") Signed-off-by: Yang Xiuwei Link: https://patch.msgid.link/20261114072246.741950-2-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit a3b8965deb899b7f23ddb221294cfc92fccfed14 Author: Yang Xiuwei Date: Sat Nov 21 21:31:47 2026 +0000 io_uring: fail soft links on negative IOU_COMPLETE results Commit 9ed19503a7b34e1ffb2b81236843204c473b0ae0 upstream. Handlers such as fsync return IOU_COMPLETE with a negative cqe.res. The old io_req_complete() path called req_set_fail() for res < 0. After completions moved into the core, that check was dropped, so IOSQE_IO_LINK dependents kept running after the head failed. Fixes: 97b388d70b53 ("io_uring: handle completions in the core") Signed-off-by: Yang Xiuwei Link: https://patch.msgid.link/20261114041123.109163-1-yangxiuwei@kylinos.cn Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 39fc82424388a7b94366597bb8fea2ed8576339f Author: Cinq Prairie Date: Sat Nov 21 21:31:46 2026 +0000 io_uring/napi: don't end the single NAPI busy poll early on need_resched() Commit 39c7210e970200f8b17de3767c73efe64173a95f upstream. With a single registered NAPI, io_napi_blocking_busy_loop() hands io_napi_busy_loop_should_end() to napi_busy_loop_rcu() as loop_end and runs its own loop once, relying on __napi_busy_loop() to spin until that predicate fires. napi_busy_loop_rcu() sets NAPI_F_END_ON_RESCHED, so __napi_busy_loop() also returns on the first need_resched(). io_uring treats the return as the end of the busy poll period and sleeps in schedule_hrtimeout() for the rest of the wait timeout. With two or more NAPIs the inner loop is single-shot and io_uring's own loop runs until its predicate is met, so busy_poll_to is honoured. The same registration therefore behaves differently for one NAPI than for several. Make the busy poll deadline absolute, stored in io_wait_queue, so that io_napi_busy_loop_should_end() no longer depends on the start_time the napi loop snapshots on every entry. The single NAPI loop can then be re-entered after an early need_resched() exit if there is budget left, and the loop condition drops the "run once" special case. The fast path that holds the NAPI across polls is kept. Measured on io_uring-7.4 at 9c207aa58e54, x86-64, HZ=1000, PREEMPT_DYNAMIC (lazy), no CPU isolation, low RX traffic, r8169 with one RX queue, prefer_busy_poll, busy_poll_to = wait timeout = 10 ms. "waker" is a SCHED_FIFO task pinned to the polling CPU waking every 1 ms: 1 NAPI, waker, before: busy 0.5-1.5 ms per 10 ms wait, ~0.8M polls/s 1 NAPI, waker, after: busy 10 ms per 10 ms wait, ~16.2M polls/s 1 NAPI, idle, before: busy 10 ms per 10 ms wait, ~15.3M polls/s 1 NAPI, idle, after: busy 10 ms per 10 ms wait, ~16.2M polls/s 2 NAPIs, waker, before: busy 10 ms per 10 ms wait, ~7.2M polls/s 2 NAPIs, waker, after: busy 10 ms per 10 ms wait, ~7.1M polls/s The held-NAPI fast path polls about twice as often as the single-shot path used for several NAPIs, which is why it is kept. Fixes: 8d0c12a80cde ("io-uring: add napi busy poll support") Cc: stable@vger.kernel.org Signed-off-by: Cinq Prairie Link: https://patch.msgid.link/20261027204840.7823-1-notprairie@gmail.com [axboe: trim comments, drop __always_unused] Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit e2f8cdae8924e985db48a6bd012b5cbde0cb9ae4 Author: Hui Peng Date: Wed Oct 21 13:46:18 2026 +0200 udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() [ Upstream commit 49f771d14578733a350c45e34e1bc6ad14f56952 ] In udf_load_vat() (fs/udf/super.c), validate that vat20->lengthHeader is at least sizeof(struct virtualAllocationTable20) and does not exceed the mapped buffer or VAT inode size so computing the VAT table pointer and entry count cannot underflow or read out of bounds. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://patch.msgid.link/20260919222600.3793513-1-benquike@gmail.com Signed-off-by: Hui Peng Signed-off-by: Jan Kara Signed-off-by: Sasha Levin commit 003b27b62bc4169b656d976f813013b83f1a527f Author: Sasha Levin Date: Sat Nov 21 21:59:15 2026 -0500 Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" This reverts commit 992f7f5f34f803144c9cac31d49ff853d8e861a9. Signed-off-by: Sasha Levin commit a1d50a6bff4a593977478202119f2f544e8e2eae Author: Vladimir Petrzhikovskii Date: Tue Nov 10 16:38:27 2026 +0100 virtio_net: check RX buffer length before DMA sync [ Upstream commit 29dfa436bc488056a84ee423ba82336db453e2a6 ] An RX queue that uses the DMA API (rq->use_page_pool_dma, for example with VIRTIO_F_ACCESS_PLATFORM) syncs each received buffer with page_pool_dma_sync_for_cpu() using the length the device wrote to the used ring, and checks that length against the posted buffer only after the sync. With SWIOTLB bouncing (swiotlb=force, or a confidential-computing guest), the sync copies from the shared bounce buffer into the guest's private page, so an oversized length also copies the bytes the device wrote past the posted buffer over the neighbouring page pool fragments. The later check drops the packet, but the copy has already happened. A malicious device, such as a host the confidential guest does not trust, can overwrite guest kernel memory next to an RX buffer with bytes it chooses, which is enough to take an unprivileged guest process to root. Check the length before the sync in the per-fragment loops. receive_buf() has to sync the header before the length check, because the mergeable error path reads num_buffers from it, so limit that sync to the posted length. A device that reports correct lengths sees no change. The driver has synced with the device's length since commit 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers"), at first in virtnet_rq_unmap(). Commit 24fbd3967f3f ("virtio_net: add page_pool support for buffer allocation") moved the sync to the page_pool call sites that this patch changes, so the patch applies to v7.1 and later. Older kernels need a separate backport that limits the sync in virtnet_rq_unmap(). Found by an LLM code review agent auditing users of the DMA API; the fix and this changelog were also written with an LLM coding assistant and reviewed by us. Reproduced in QEMU with swiotlb=force and iommu_platform=on, a test-only device change that reports a used length 64 bytes past the posted buffer and writes a marker there, and a guest kprobe module that reads the buffer after the sync: without this patch the marker reaches the guest page for small and mergeable buffers; with it the packets are dropped and counted in rx_length_errors. The virtio_net selftest basic_features.sh passes with and without mergeable buffers. Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers") Cc: stable@vger.kernel.org Co-developed-by: Nikolai Kalinin Signed-off-by: Nikolai Kalinin Signed-off-by: Vladimir Petrzhikovskii Link: https://patch.msgid.link/20261110-b4-virtionet-rxlen-v2-1-6ec5aa0edf9f@dfb.sh Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 7925102ff113c8b52b92abb11780c58e420cdca0 Author: Antheas Kapenekakis Date: Mon Nov 2 18:40:52 2026 +0100 ALSA: hda/tas2781: Prevent throwing away custom calibration addresses [ Upstream commit ba39a31448857da3b848174c9130b466b3ccddba ] The V2 UEFI spec for per-device calibration data in TAS allows for manufacturers to specify up to five custom calibration register addresses and values to optimize per-device in factory. A basic description of the spec is found in a comment in function tas2781_apply_calib(). However, currently, for the condition of p->dspbin_typ != TASDEV_BASIC, if custom calibration addresses have been provided by the manufacturer, they are ignored and the ones listed in firmware are used. In case the manufacturer chose to change different registers other than the default ones (r0, invr0, r0_low, pow, tlimit), this causes the UEFI calibration data to scratch different registers and cause the firmware to misbehave. This is true in the Xbox ROG Ally X, for one of the firmwares, where it pops and has audio dropouts after the calibration data is applied. Therefore, add a new bool to indicate that UEFI supplied custom calibration addresses, and if so, use them regardless of dspbin_typ. Closes: https://lore.kernel.org/all/179122346529.6.9250312386131579603.1671009695@8alias.com/ Co-developed-by: Matthew Schwartz Signed-off-by: Matthew Schwartz Signed-off-by: Antheas Kapenekakis Link: https://patch.msgid.link/20261102174052.1216670-1-lkml@antheas.dev Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 4d31f5ec513f0aa803687f0ef98bff9b28503eff Author: Krittikun Wongnin Date: Tue Oct 13 14:42:45 2026 +0700 ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] [ Upstream commit 8eb2754ef96d77d870d6b1ef1e0e8470c892b6b4 ] On the Acer Aspire A515-53G (Whiskey Lake + NVIDIA GeForce MX230), the dGPU behind root port RP05 (00:1c.4) falls off the bus during boot and is unusable until the next power cycle: nvidia 0000:02:00.0: Unable to change power state from D3cold to D0, device inaccessible NVRM: The NVIDIA GPU 0000:02:00.0 ... has fallen off the bus The firmware ships two SSDTs which both provide power management for the dGPU: - One SSDT defines \_SB.PCI0.RP05.PC01 together with RP05._PR0/_PR2/_PR3 = { PC01 }. - A second SSDT defines \_SB.PCI0.RP05.PCRP (_STA initially One, _OFF calls \_SB.PCI0.HGOF, which puts the link into L2/L3 and drops the dGPU power enable GPIO) and its own RP05._PR0/_PR2/_PR3/_S0W. The latter fail to load: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.RP05._PR0], AE_ALREADY_EXISTS As a result PCRP is not referenced by any device and acpi_turn_off_unused_power_resources() turns it off right after the ACPI namespace scan. This cuts power to the dGPU, but PC01 still believes it is on, so its _ON method is a no-op when the PCI core later tries to bring the GPU back to D0. Windows does not turn off unused power resources, so the dGPU works there. Add the machine to dmi_leave_unused_power_resources_on[], like the THUNDEROBOT ZERO which has a similar SSDT bug. With this change the dGPU stays on the bus and the nvidia driver binds. Runtime PM of the dGPU is unaffected, as it is handled through PC01: with no driver bound and power/control set to auto, RP05 reaches D3cold and the GPU comes back to D0 on resume. Link: https://lore.kernel.org/r/CADS-TgDQ1G8vrTQLJeQ3RTBVFTyMe0C+5p2=UBKS=EFCDFuaxw@mail.gmail.com/ Signed-off-by: Krittikun Wongnin [ rjw: Subject and changelog tweaks ] Link: https://patch.msgid.link/20261013074245.4327-1-krittikunwongnin@gmail.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 005f9871dfca72975562d7fb6b7314872256f17b Author: Hakan Abay Date: Mon Oct 5 20:49:39 2026 +0300 ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 [ Upstream commit 23ec17231cc6a83bb11d8660db5bfc5336f53a0e ] On the Casper Excalibur G900, the NVIDIA discrete GPU and the second NVMe device become inaccessible when unused ACPI power resources are turned off during initialization. The failure is similar to the THUNDEROBOT ZERO case addressed by commit cd7ef20ba8c6 ("ACPI: PM: Add unused power resource quirk for THUNDEROBOT ZERO"). Without the quirk, the NVIDIA GPU and the second NVMe device are left inaccessible in D3cold and attempts to transition them back to D0 fail. Add a DMI quirk for the affected Casper Excalibur G900 with NLCC 001 mainboard to leave unused ACPI power resources on. With the quirk applied, the second NVMe device remains accessible. The NVIDIA GPU can enter D3cold while idle and subsequently return to D0 for accelerated rendering. Link: https://bugs.kali.org/view.php?id=9891 Signed-off-by: Hakan Abay Link: https://patch.msgid.link/20261005174939.53873-1-hakan.abay84@gmail.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 80aa2e639742a1d8e4d1e6b48eed9c807e1da106 Author: Matthias Dittrich Date: Mon Sep 7 09:04:49 2026 +0200 ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) [ Upstream commit a0039113053d4d3f629ea1b9cd74130ca597f14a ] The Acer Swift 3 SF314-56G (with NVIDIA GeForce MX250) suffers from the same ACPI power resource regression as the Thunderobot ZERO. The power resource controlling the dGPU is incorrectly turned off during initialization, causing the GPU to fall off the bus (D3cold). This commit adds a DMI quirk to keep the power resource on for this model, similar to the existing Thunderobot quirk. Tested on Acer Swift 3 SF314-56G with NVIDIA MX250. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221087 Signed-off-by: Matthias Dittrich [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 65b64795bbc158097906ea55131c731a565a3b07 Author: Hao Li Date: Thu Nov 19 19:08:33 2026 -0800 mm/slub: refill prefilled sheaves from the barn commit 1b87ea06a34b213e45e3e0c4effd5043f15046ed upstream. Currently, when the prefill API refills a non-full sheaf, it takes the objects from partial slabs and never from the full sheaves in the barn, so once the barn's full list becomes saturated, it stays saturated. For objects freed via kfree_rcu(), every RCU sheaf then has to be flushed to slabs because the barn's full list has no room. To fix this, let the sheaf refill from the barn first, and introduce a partial sheaf in the barn, which holds the leftover objects [1]. Only the prefill path needs the partial sheaf. The generic allocation path (__pcs_replace_empty_main()) exchanges an empty sheaf for a full one from the barn, so nothing is left over. The prefill path refills a sheaf that is not necessarily empty, so taking objects from the barn usually leaves leftovers, and the partial sheaf is where they are kept. refill_sheaf() only takes objects from partial slabs and never involves the partial sheaf. The sheaf is refilled by copying objects from the partial sheaf, and then from a full sheaf taken from the barn if it is still not full. A sheaf that objects were copied from stays in the barn as the partial sheaf if it still holds objects, or goes on the empty list if it is empty. The sheaf being refilled is never replaced. The gain comes from two sides: every full sheaf taken out makes room on the barn's full list for a future RCU sheaf, and refilling from the barn is cheaper than refilling from partial slabs under list_lock. Note that putting the sheaf with the leftover objects on the full list instead would not work: it would occupy room on the full list, so the list would stay saturated and rcu_free_sheaf() would still keep flushing. An earlier version of this patch swapped sheaves instead, to minimize the memcpy overhead. As Harry Yoo pointed out [2], replacing the caller's sheaf loses cache affinity, filling it directly is more straightforward, and testing showed no measurable difference between the two approaches, so the approach he suggested is used. Tested with will-it-scale mmap1 (192 processes, one-minute runs) on the maple_node cache. throughput: 27778727 -> 34500556 (+24.2%) metric baseline patched change ===================================================================== alloc_fastpath 54,124 56,696 +4.75% alloc_slab 7,100,651 159,739 -97.75% barn_get 849 194,460,392 +22904539.81% barn_get_fail 2 217 +10750.00% barn_put 851 182,306,701 +21422544.07% barn_put_fail 260,400,484 145,522,675 -44.12% cmpxchg_double_fail 1,029,204 334,228 -67.53% free_add_partial 326,694,687 181,935,790 -44.31% free_fastpath 13,297 15,611 +17.40% free_rcu_sheaf 8,332,839,104 10,490,535,227 +25.89% free_remove_partial 7,099,788 158,297 -97.77% free_slab 7,099,788 158,297 -97.77% free_slowpath 10,969,156 782,851 -92.86% objects 15,295 14,849 -2.92% objects_partial 15,295 14,849 -2.92% partial 1,604 2,336 +45.64% sheaf_alloc 137,757,895 141,208,076 +2.50% sheaf_flush 8,332,823,922 4,656,725,764 -44.12% sheaf_free 137,757,883 141,208,072 +2.50% sheaf_prefill_fast 3,337,502,163 4,196,506,116 +25.74% sheaf_prefill_slow 685 400 -41.61% sheaf_refill 8,343,794,364 4,657,509,724 -44.18% sheaf_return_fast 3,337,502,411 4,196,506,382 +25.74% sheaf_return_slow 437 134 -69.34% slabs 1,604 2,336 +45.64% total_objects 102,656 149,504 +45.64% Here is what the important metric changes mean. barn_get and barn_put: refills now take full sheaves out of the barn, and RCU sheaves are put into the barn again. Before, the barn's full list was saturated once and hardly ever consumed. barn_put_fail: more than half of the RCU sheaves are now put into the barn instead of being flushed. The rest are still flushed because they arrive while the barn's full list is at its limit. sheaf_refill and free_add_partial: fewer objects are taken from partial slabs to refill sheaves, and fewer slabs are added to the partial list, by the same percentage. alloc_slab and free_slab: the partial list is almost never empty when a refill looks at it, so slabs are almost never allocated and freed again only to serve refills. After the test, the maple_node cache holds 1604 slabs without the patch and 2336 with it. After a manual shrink (echo 1 > /sys/kernel/slab/maple_node/shrink), it holds 485 without the patch and 563 with it. So most of the extra slabs are held only by objects sitting in sheaves and are returned by a shrink, and what remains is a small difference, because objects handed out from the barn come from many more slabs than a refill from partial slabs would use. Link: https://lore.kernel.org/linux-mm/aqPlMzUIw-4g2iOX@fedora/ [1] Link: https://lore.kernel.org/linux-mm/aq0ylDidEHa2kg4X@thinkstation/ [2] Signed-off-by: Hao Li Reviewed-by: Harry Yoo (Meta) Link: https://patch.msgid.link/20260921094521.141665-1-hao.li@linux.dev Reviewed-by: Vlastimil Babka (SUSE) Signed-off-by: Harry Yoo (Meta) Cc: stable@vger.kernel.org Signed-off-by: Suren Baghdasaryan Signed-off-by: Sasha Levin commit 1e9052f7793894650f012cabdbbd996abc3a5d54 Author: Sergey Lebedev Date: Sun Sep 13 21:08:55 2026 +0000 soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel) [ Upstream commit d32e04c052342d7d1cc03f6ba4cbd135cd0112bc ] The Microsoft Surface Pro 11 for Business (Intel, Lunar Lake) carries a single physical RT1320 amplifier on link 0 and describes it twice: SWRA _ADR 0x000030025D132000 SDCA class 0 SWRB _ADR 0x000030025D132001 SDCA class 1 Identical apart from the class id: same link, same manufacturer, part and version, same unique id 0. The part reports class 1, so only SWRB enumerates. SWRA never attaches on any boot or firmware version tested, including the November 2025 bundle. The ghost is not harmless. It consumes an amplifier index in find_acpi_adr_device(), so the real part is named "rt1320-2" and the stock sof-soundwire UCM profile enables switches on a device that is not there. Its endpoints also reach create_sdw_dailink(), which builds DAI link names from link id and function type alone; the ghost declares the same SmartMic function as the real part, so the card fails to register at all: sysfs: cannot create duplicate filename '.../sof_sdw/SDW0-Capture-SmartMic' kobject_add_internal failed for SDW0-Capture-SmartMic with -EEXIST sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12 Remap its _ADR to zero so sdw_acpi_find_slaves() never creates the peripheral, which is how ghost devices are handled already - see ghost_realtek and global_ghost_adr in this file. Both failures then disappear, because neither path is reached. Matched on DMI_PRODUCT_SKU rather than the product name. A later batch of the same model could carry a different RT1320 version, which would change the _ADR; keying on the SKU keeps this remap to the hardware it was verified on, and follows dell_sku_0A3E above. Link: https://lore.kernel.org/linux-sound/20260830151516.44629-1-lsa.uz@pm.me/ Suggested-by: Pierre-Louis Bossart Suggested-by: Bard Liao Signed-off-by: Sergey Lebedev Reviewed-by: Pierre-Louis Bossart Tested-by: German Pablo Lindo Link: https://patch.msgid.link/20260913210849.6446-1-lsa.uz@pm.me Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 3bbbc5a12a74fee3b3421a17e33ad8faea20fc77 Author: Charles Keepax Date: Thu Sep 3 11:27:43 2026 +0100 soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9 [ Upstream commit a6a867552a36e647cbd35aceae24754c9bcd3661 ] The Lenovo Pro 9 also has a Realtek device in the ACPI that doesn't exist in the physical hardware. This confuses the machine driver into attempting to create DAI links for the device. Add a quirk to remove this device. Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20260903102743.3782541-1-ckeepax@opensource.cirrus.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 1ffd37058fd5865ad277901114936c4fe1d9b0cc Author: Sataporn Saijai Date: Wed Aug 19 01:20:20 2026 +0700 soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11 [ Upstream commit c3133906d5bda343bd5c1d8ad63074a14506ad72 ] The Lenovo Yoga Slim 7i 14IPH11 (DMI product 83QM) declares an RT722 on link 3 that is not actually present and never attaches, leaving the machine with no audio. Since the address is already handled by the ghost_realtek table, only the DMI match is needed. Signed-off-by: Sataporn Saijai Reviewed-by: Bard Liao Link: https://patch.msgid.link/20260818182020.143096-1-excursively@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit c1771e1bacae3a727408ad01d8fcf40474e19565 Author: Eric Dumazet Date: Tue Nov 10 22:36:28 2026 +0100 net: virtio: validate outer protocol of UDP tunnel GSO packets [ Upstream commit 73e08d50eb139e7329032c89a4cb105cf43ef278 ] virtio_net_hdr_tnl_to_skb() trusts the virtio header to describe a UDP tunnel over IPv4 or IPv6, but never checks that the frame actually carries such outer headers. Because VIRTIO_NET_HDR_F_NEEDS_CSUM is mandatory for tunnel GSO, __virtio_net_hdr_to_skb() skips the flow dissector, so virtio_net_hdr_match_proto() is never applied either. A guest (or a tap writer) can then inject a frame with an arbitrary outer ethertype, for example ETH_P_NSH, with SKB_GSO_UDP_TUNNEL set. The GSO stack then runs nsh_gso_segment() on top of the UDP tunnel segmentation, which assumes a different header layout. The result is segments with skb->data before skb->head, and a host crash in skb_under_panic() as soon as a later layer pushes a header: skbuff: skb_under_panic: ... put:4 ... dev:gretap1 kernel BUG at net/core/skbuff.c:215! skb_push __gre_xmit gre_tap_xmit ... tun_get_user Validate the outer headers with the parsing helpers from Michael's series "net: resolve uncommon partial checksums at ingress": - locate the L3 header: Ethernet with optional VLAN tags, or the network header set by the caller. skb->protocol is not trusted when it disagrees with the frame. - require the outer L3 protocol to match the declared tunnel type. - require the outer UDP header exactly at outer_th_offset, after IPv4 options or IPv6 extension headers, and reject fragments. Unlike the original helpers: - the callers tell whether the frame starts with an Ethernet header, with a new has_eth argument of virtio_net_hdr_tnl_to_skb(), instead of using the device type. tun frames packets from its IFF_TAP and IFF_TUN flags, and TUNSETLINK can set the device type to any value. virtio_net and tun_xdp_one() always pass true, tun_get_user() passes whether the device is IFF_TAP. - ipv6_find_hdr() stops at an AH header, as Willem suggested in the review of that series. Fixes: a2fb4bc4e2a6 ("net: implement virtio helpers to handle UDP GSO tunneling.") Reported-by: Hassan Sultan Suggested-by: Willem de Bruijn Link: https://lore.kernel.org/netdev/93d0e37c99711bebdf60c120af03010455c2f2e2.1793276116.git.mst@redhat.com/ Co-developed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Willem de Bruijn Acked-by: Michael S. Tsirkin Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261110213628.3476051-4-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0130142ed2e3423fd671f0b8df94eae8d9f21a3c Author: Eric Dumazet Date: Tue Nov 10 22:36:27 2026 +0100 tun: clear stale skb->protocol of NAPI frags skbs [ Upstream commit 3287cd714a853d9443c4a743eca010aedcfbbcdd ] With IFF_NAPI_FRAGS, tun_napi_alloc_frags() gets its skb from napi_get_frags(). If GRO merged the previous frame with GRO_MERGED_FREE, that skb was recycled by napi_reuse_skb(), which does not reset skb->protocol set by napi_frags_skb() for the previous frame. tun_get_user() calls tun_vnet_hdr_tnl_to_skb() before eth_type_trans(), so the virtio header checks see the protocol of the previous frame: GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are dissected with the wrong protocol. A following change checks the outer protocol of UDP tunnel GSO packets, which would then reject a valid frame when the two ethertypes differ. This needs GRO to hold packets across writes, and IFF_NAPI_FRAGS needs CAP_NET_ADMIN. Clear skb->protocol in tun_napi_alloc_frags(), like skbs allocated by tun_alloc_skb() or build_skb(). eth_type_trans() sets it later. Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Reported-by: Sashiko Closes: https://lore.kernel.org/netdev/179386753589.488856.11455181721004759454@kernel.org/ Suggested-by: Willem de Bruijn Reviewed-by: Willem de Bruijn Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261110213628.3476051-3-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin