commit 2c7bb1d0212c23234a9f85123eb7a36eecc76776 Author: Greg Kroah-Hartman Date: Mon Nov 30 12:54:05 2026 +0100 Linux 6.18.66 Link: https://lore.kernel.org/r/20261125143822.072087159@linuxfoundation.org Tested-by: SJ Park Tested-by: Florian Fainelli Link: https://lore.kernel.org/r/20261126105725.767748294@linuxfoundation.org Tested-by: Brett A C Sheffield Tested-by: Joungmin Lee Tested-by: Miguel Ojeda Tested-by: SJ Park Tested-by: Barry K. Nathan Tested-by: Sean Lyon Tested-by: Ron Economos Signed-off-by: Greg Kroah-Hartman commit 0d7ca33faffa3a4249b77005bbee98ee38df5a6e 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 4db5f1d65950e8cf76fff8287a6e00f60a7fa279 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 a94ba6aa591cee205a73f97a0a2c277b53c93f21 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: Eduardo Mucelli Rezende Oliveira Signed-off-by: Greg Kroah-Hartman commit aacb780521002e87e19def67bd74a383cf1d50b2 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 9d80a13a9af05ebf38fe95c41c3963ff45955048 Author: Damien Riégel Date: Tue Mar 24 10:00:39 2026 -0400 greybus: raw: fix use-after-free if write is called after disconnect commit 84265cbd96b97058ef67e3f8be3933667a000835 upstream. If a user writes to the chardev after disconnect has been called, the kernel panics with the following trace (with CONFIG_INIT_ON_FREE_DEFAULT_ON=y): BUG: kernel NULL pointer dereference, address: 0000000000000218 ... Call Trace: gb_operation_create_common+0x61/0x180 gb_operation_create_flags+0x28/0xa0 gb_operation_sync_timeout+0x6f/0x100 raw_write+0x7b/0xc7 [gb_raw] vfs_write+0xcf/0x420 ? task_mm_cid_work+0x136/0x220 ksys_write+0x63/0xe0 do_syscall_64+0xa4/0x290 entry_SYSCALL_64_after_hwframe+0x77/0x7f Disconnect calls gb_connection_destroy, which ends up freeing the connection object. When gb_operation_sync is called in the write file operations, its gets a freed connection as parameter and the kernel panics. The gb_connection_destroy cannot be moved out of the disconnect function, as the Greybus subsystem expect all connections belonging to a bundle to be destroyed when disconnect returns. To prevent this bug, use a rw lock to synchronize access between write and disconnect. This guarantees that the write function doesn't try to use a disconnected connection. Fixes: e806c7fb8e9b ("greybus: raw: add raw greybus kernel driver") Reviewed-by: Johan Hovold Signed-off-by: Damien Riégel Link: https://patch.msgid.link/20260324140039.40001-2-damien.riegel@silabs.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 4b87d9a89934402b4d29aac77d4e41fb7aaf237a Author: Karl Mehltretter Date: Sun Aug 16 18:30:27 2026 +0200 mtd: core: avoid double-free of OTP NVMEM device commit 26300879cd8e4612dce66bb8f6ff7cd35fcf3e59 upstream. If factory OTP setup fails after the user OTP NVMEM device has been registered, mtd_otp_nvmem_add() unregisters the user device but leaves mtd->otp_user_nvmem set. On an error, the caller unregisters it again. For -EOPNOTSUPP, registration continues and normal teardown unregisters it again. Clear mtd->otp_user_nvmem after unregistering it. Fixes: e0489f6e221f ("mtd: core: fix error path for nvmem provider") Fixes: fe0b8213c012 ("mtd: core: Don't fail mtd_otp_nvmem_add() if OTP is unsupported") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Karl Mehltretter Signed-off-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman commit c9f48f50049e9c4e8b61aeca9ca750f5397b971f 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 894579fb0eacf0cf088466ca2a86f919dad5da13 Author: Andrea Mayer Date: Fri Sep 25 15:38:07 2026 +0200 seg6: ensure packet data is writable before modifying SRH and IPv6 DA commit 8ae3f4067ba4ae3a15581392f6dac422e3d3def0 upstream. advance_nextseg() modifies the SRH Segments Left field and the IPv6 destination address without ensuring the packet data is writable. seg6_next_csid_advance_arg() has the same problem when it advances the NEXT-C-SID argument in the destination address. The skb may be cloned, for example by an AF_PACKET socket receiving on the ingress device. advance_nextseg() and seg6_next_csid_advance_arg() then write into the packet data shared with the clone. A read from that socket can return the modified packet instead of the received one. The simplified path below shows this for advance_nextseg(): __netif_receive_skb_one_core __netif_receive_skb_core deliver_skb [orig: users=2, cloned=0] packet_rcv skb_clone clone queued to the AF_PACKET socket consume_skb(orig) [orig: users=1, cloned=1] ipv6_rcv ip6_rcv_core skb_share_check: no-op [orig: users=1] [...] input_action_end_core advance_nextseg writes into the data shared with the clone Call skb_ensure_writable() in advance_nextseg() and in seg6_next_csid_advance_arg() before they modify the packet data. skb_ensure_writable() may reallocate skb->head, which invalidates the pointers into the packet data taken before the call. advance_nextseg() now returns a valid SRH pointer, or NULL if skb_ensure_writable() fails. seg6_next_csid_advance_arg() takes the pointer to the destination address from the skb after skb_ensure_writable(). On failure, the callers drop the packet with SKB_DROP_REASON_NOMEM. Fixes: 140f04c33bbc ("ipv6: sr: implement several seg6local actions") Fixes: 848f3c0d4769 ("seg6: add NEXT-C-SID support for SRv6 End behavior") Signed-off-by: Andrea Mayer Link: https://patch.msgid.link/20260925133807.32-1-andrea.mayer@uniroma2.it Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 494d9ebed3edf8842776ab98e96969155c280f2b Author: Yuya Kusakabe Date: Tue Sep 22 05:49:56 2026 +0900 net: ipv6: keep room for the mac header in dst_dev_overhead() commit 87cd6b717e4069dca34e0866e57eaeb44d3b173e upstream. The seg6, ioam6 and rpl lwtunnels size their skb_cow_head() request as the length they are about to push plus dst_dev_overhead(), then push the new headers and rebuild the mac header below them with skb_mac_header_rebuild(). That rebuild needs skb->mac_len of headroom, but dst_dev_overhead() leaves LL_RESERVED_SPACE() of the egress device, 16 bytes for plain Ethernet. Where the mac header is longer than that, as it is on ingress through a VLAN device with reorder_hdr off, the rebuild runs out of room: skb_set_mac_header(skb, -skb->mac_len) computes a negative offset, stores it unchecked in the u16 skb->mac_header, and the memmove that follows writes skb->mac_len bytes about 64 KB past skb->head. Forwarding plain ping6 traffic through such a device reproduces it on all five seg6 encapsulation modes and on the rpl and ioam6 inline paths; skb->mac_header comes back as 65534 on a 704-byte head. Return the larger of the two. The helper already returns skb->mac_len when it has no dst, so this only makes the other branch agree, and it covers every caller rather than each call site in turn. Fixes: 40475b63761a ("net: ipv6: seg6_iptunnel: mitigate 2-realloc issue") Fixes: dce525185bc9 ("net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue") Fixes: 985ec6f5e623 ("net: ipv6: rpl_iptunnel: mitigate 2-realloc issue") Suggested-by: Andrea Mayer Signed-off-by: Yuya Kusakabe Reviewed-by: Justin Iurman Reviewed-by: Gabriel Goller Reviewed-by: Eric Dumazet Reviewed-by: Andrea Mayer Link: https://patch.msgid.link/20260922-seg6-maclen-headroom-v3-1-7b2f982ef79d@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 90c4ab670895ac69a36af3554f7f9d5e45ce8600 Author: Cen Zhang (Microsoft Security FORGE Labs) Date: Wed Aug 26 16:17:45 2026 -0400 xfrm: hold net_device reference under RCU in bundle creation commit 9fa903b24b1f46b4ff5443bcd4aca23e5c57f9c1 upstream. xfrm_bundle_create() and xfrm_create_dummy_bundle() read dst->dev into a local pointer without taking a device reference, then pass it to xfrm_fill_dst(). A concurrent RTM_DELLINK replaces dst->dev via dst_dev_put() and frees the old net_device, causing a use-after-free when xfrm6_fill_dst() later dereferences the stale dev pointer. BUG: KASAN: slab-use-after-free in xfrm6_fill_dst+0x82c/0x860 (net/ipv6/xfrm6_policy.c:86 netdev_hold()) Read of size 8 at addr ffff8880142fe588 by task exploit/153 Call Trace: xfrm6_fill_dst+0x82c/0x860 xfrm_resolve_and_create_bundle+0x21d4/0x2bd0 xfrm_lookup_with_ifid+0x485/0x1640 ip6_dst_lookup_flow+0x19b/0x1e0 udpv6_sendmsg+0x1443/0x2dd0 Fix this by reading dst->dev via dst_dev_rcu() and keeping the RCU read-side critical section active until xfrm_fill_dst() has taken the required device references. Fixes: 25ee3286dcbc ("[IPSEC]: Merge common code into xfrm_bundle_create") Fixes: a0073fe18e71 ("xfrm: Add a state resolution packet queue") Suggested-by: Steffen Klassert Reported-by: Xiang Mei (Microsoft) Link: https://lore.kernel.org/all/20260820200245.44312-1-blbllhy@gmail.com/ Cc: AutonomousCodeSecurity@microsoft.com Assisted-by: GitHub-Copilot:claude-opus-4.6 Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman commit eed532b874790f5555e56a461477f33dac4c514f Author: Nikolay Aleksandrov Date: Mon Sep 14 13:52:58 2026 +0300 net: bridge: vlan: fix bugs caused by switchdev deletion errors commit 2842ce397dd09882530b42f7fdb0c855767eb24e upstream. Allowing switchdev to prevent vlan deletion and error out in __vlan_del could cause multiple different issues - inconsistent state, memory leaks when flushing, NULL pointer dereference on bridge error when flushing. It doesn't make sense to allow it to stop __vlan_del, so log the error and continue with software vlan deletion. This is also consistent with 8021q behaviour. Suggested-by: Ido Schimmel Fixes: bf361ad38165 ("net: bridge: check __vlan_vid_del for error") Fixes: 5454f5c28eca ("net: bridge: vlan: check for errors from __vlan_del in __vlan_flush") Fixes: 2594e9064a57 ("bridge: vlan: add per-vlan struct and move to rhashtables") Fixes: 9c86ce2c1ae3 ("net: bridge: Notify about bridge VLANs") Signed-off-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20260914105258.3436918-1-razor@blackwall.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 4034def9d6386b984c1cb70a7c432c3db866b243 Author: Vinay Belgaumkar Date: Tue Mar 3 10:14:16 2026 -0800 drm/xe: Don't disable GuCRC in suspend path commit b458597544c20c31cef9d907696e8b9652b0894e upstream. GuCRC should not be disabled in xe_guc_stop_prepare() as C6 is a prerequisite for s0ix and s2idle. This is a regression caused by the patch below. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7510 Fixes: 40a684f91d26 ("drm/xe: Decouple GuC RC code from xe_guc_pc") Cc: Riana Tauro Signed-off-by: Vinay Belgaumkar Reviewed-by: Riana Tauro Link: https://patch.msgid.link/20260303181416.3880937-1-vinay.belgaumkar@intel.com Signed-off-by: Greg Kroah-Hartman commit dfb3b00f712e4c8712f8bf5468abf0d352f919be Author: Riana Tauro Date: Thu Dec 18 16:21:53 2025 +0530 drm/xe/xe_survivability: Remove unused index commit fb084e4183e1d79ead103265cafc4b6bc0ecba03 upstream. Remove unused index variable and fix for loop. Fixes: f4e9fc967afd ("drm/xe/xe_survivability: Redesign survivability mode") Reported-by: Nathan Chancellor Closes: https://lore.kernel.org/intel-xe/20251210075757.GA1206705@ax162/ Signed-off-by: Riana Tauro Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20251218105151.586575-5-riana.tauro@intel.com Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman commit 34661800afde3c6100d91f08126e897020f0cd2e Author: Baochen Qiang Date: Thu May 14 11:32:51 2026 +0800 wifi: ath12k: fix EHT TX MCS limitation due to wrong 20 MHz-only parsing commit 60fb2cf51e77bb1c0261160b4be44209d68956b1 upstream. When connecting to an AP configured for EHT 20 MHz with a full EHT MCS/NSS map (supporting MCS 0-13) Supported EHT-MCS and NSS Set EHT-MCS Map (BW <= 80MHz): 0x444444 .... .... .... .... .... 0100 = Rx Max Nss That Supports EHT-MCS 0-9: 4 .... .... .... .... 0100 .... = Tx Max Nss That Supports EHT-MCS 0-9: 4 .... .... .... 0100 .... .... = Rx Max Nss That Supports EHT-MCS 10-11: 4 .... .... 0100 .... .... .... = Tx Max Nss That Supports EHT-MCS 10-11: 4 .... 0100 .... .... .... .... = Rx Max Nss That Supports EHT-MCS 12-13: 4 0100 .... .... .... .... .... = Tx Max Nss That Supports EHT-MCS 12-13: 4 TX throughput is observed to be significantly lower than expected. Investigation shows that TX rates are limited to EHT MCS 11, even though the AP advertises support for EHT MCS 12/13. The root cause is an incorrect parsing of the Supported EHT-MCS and NSS Set element in ath12k_peer_assoc_h_eht(). IEEE Std 802.11be-2024 Figure 9-1074as describes the format for 20 MHz-Only Non-AP STAs. IEEE Std 802.11be-2024 Figure 9-1074at describes the format for all other AP and non-AP STAs. Currently the first format is parsed when the peer advertises no wider HE channel width support, without considering whether it is an AP or a non-AP STA. This is incorrect: the peer AP's capabilities must be parsed using Figure 9-1074at even when it operates on 20 MHz only. Parsing it as Figure 9-1074as causes rx_tx_mcs13_max_nss to be interpreted as zero, which is then passed to firmware, leading firmware to assume the peer does not support MCS 13 and to limit TX rates at MCS 11. Fix this by parsing the Figure 9-1074as format only when the peer is a 20 MHz-Only non-AP STA, i.e. when the local interface operates as AP or mesh point. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 Fixes: 6c95151e2e77 ("wifi: ath12k: Add EHT MCS/NSS rates to Peer Assoc") Signed-off-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20260514-ath12k-fix-20mhz-only-mcs-map-v1-1-a38d4a9b21a2@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Greg Kroah-Hartman commit f3eee3e11aa8c60ea8bd271de165adb7fbaeb0fa Author: Vinay Belgaumkar Date: Fri Sep 4 11:16:24 2026 -0700 perf: Fix null pointer access in is_include_guest_event() commit 88aed0422f39b22406f35f1e758cea25e7bbcfb5 upstream. A typical module unload occurring event when there is an active perf connection leads to freeing of the pmu pointer. The call log is something like: .. __pmu_detach_event pmu_detach_event pmu_detach_events perf_pmu_unregister .. __pmu_detach_event() sets event->pmu to null. When the perf connection finally is closed, the following stack trace is observed: Oops: general protection fault, kernel NULL pointer dereference ... RIP: 0010:_free_event+0x3e/0x370 ... Call Trace: ... perf_event_release_kernel+0x260/0x2d0 perf_release+0x12/0x20 A call to mediated_pmu_unaccount_event() inside _free_event() is the root cause of this crash. Adding a check inside is_include_guest_event() ensures we don't accidentally access a null pmu ptr. In addition to this, we will now call mediated_pmu_unaccount_event() before clearing the pmu ptr so that nr_include_guest_events counts are maintained correctly. Fixes: eff95e170275 ("perf: Add APIs to create/release mediated guest vPMUs") Assisted-by: Claude:Claude-Sonnet-5 Signed-off-by: Vinay Belgaumkar Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dapeng Mi Link: https://patch.msgid.link/20260904181625.1394082-1-vinay.belgaumkar@intel.com Signed-off-by: Greg Kroah-Hartman commit 400c72f4d5be40f44acebd663f70805dfb09da7e Author: Christian Brauner Date: Fri Oct 9 23:51:53 2026 +0200 9p: free the session after a grace period commit bcec7fc2e224088daf94448d663b02e0d0b9c717 upstream. v9fs_vfs_get_link_dotl() reads ->cache from the v9fs_session_info in sb->s_fs_info to decide whether the symlink target sits in the page cache. It does that before it looks at the dentry, so it also does it in rcu pathwalk mode. Without loose or metadata caching the dentries have no ->d_revalidate() that would make the walk leave rcu mode before it gets there. v9fs_kill_super() frees the session and clears sb->s_fs_info without waiting for a grace period. Right now a pathwalk can't still be in v9fs_vfs_get_link_dotl() at that point, but only by accident. umount(2) waits for a grace period in namespace_unlock() before it drops the mount. And a mount whose last reference goes away elsewhere, like the chdir out of a lazily unmounted directory, still gets a grace period from bdi_unregister(). v9fs_fill_super() sets up a private bdi, so generic_shutdown_super() unregisters it from kill_anon_super() and bdi_remove_from_list() waits in synchronize_rcu_expedited() before v9fs_kill_super() frees the session. That grace period protects the rcu readers of bdi_list in the writeback code. It has nothing to do with pathwalk. Don't rely on it. Keep sb->s_fs_info and free the session after a grace period. Fixes: 712da38d134b ("9p: Enable symlink caching in page cache") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-3-7446d2d335e6@kernel.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman commit c98acb24fa284ac8c858957f7a6da2b0ba3f9bcf Author: Stefano Garzarella Date: Fri Jul 3 12:22:54 2026 +0200 9p: fix privport option setting wrong RDMA field commit 7fb9bd3659051ff74a29387de0023bb8300e4aa7 upstream. While reviewing a patch adding vsock transport to 9p, I noticed that since commit 1f3e4142c0eb ("9p: convert to the new mount API"), the Opt_privport case incorrectly sets rdma_opts->port instead of rdma_opts->privport, so mounting with the privport option overwrites the RDMA port number instead of enabling privileged port usage. Fixes: 1f3e4142c0eb ("9p: convert to the new mount API") Cc: stable@vger.kernel.org Cc: sandeen@redhat.com Signed-off-by: Stefano Garzarella Acked-by: Eric Sandeen Message-ID: <20260703102254.114446-1-sgarzare@redhat.com> Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman commit eeadf0fd1997ccad959c84f7bacdd62352ba8497 Author: Pierre Barre Date: Thu Apr 2 12:03:12 2026 +0200 9p: fix access mode flags being ORed instead of replaced commit da2346a48a5a1fed86c3fe3d73c0b60e7b3027c9 upstream. Since commit 1f3e4142c0eb ("9p: convert to the new mount API"), v9fs_apply_options() applies parsed mount flags with |= onto flags already set by v9fs_session_init(). For 9P2000.L, session_init sets V9FS_ACCESS_CLIENT as the default, so when the user mounts with "access=user", both bits end up set. Access mode checks compare against exact values, so having both bits set matches neither mode. This causes v9fs_fid_lookup() to fall through to the default switch case, using INVALID_UID (nobody/65534) instead of current_fsuid() for all fid lookups. Root is then unable to chown or perform other privileged operations. Fix by clearing the access mask before applying the user's choice. Fixes: 1f3e4142c0eb ("9p: convert to the new mount API") Signed-off-by: Pierre Barre Reviewed-by: Christian Schoenebeck Message-ID: <0ddc72da-d196-4f01-8755-0086f670e779@app.fastmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman commit 31efc73785ef509babeb34db50bd2b752e6f2902 Author: Sasha Levin Date: Wed Feb 25 08:57:45 2026 -0500 9p: fix memory leak in v9fs_init_fs_context error path commit 0fd76f1be20d19ac593138ceec502cb044c909bd upstream. Move the assignments of fc->ops and fc->fs_private to right after the kzalloc, before any fallible operations. Previously these were assigned at the end of the function, after the kstrdup calls for uname and aname. If either kstrdup failed, the error path would set fc->need_free but leave fc->ops NULL, so put_fs_context() would never call v9fs_free_fc() to free the allocated context and any already-duplicated strings. Fixes: 1f3e4142c0eb ("9p: convert to the new mount API") Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Sasha Levin Message-ID: <20260225135745.351984-1-sashal@kernel.org> Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman commit 136a6f1bb1dd28b7b8110ebe40fb53b0458ef510 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 06776d859f7fce1318081cae7c6576931a194d18 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 4ef5a909c2bc166c971d3cc53374367a57e2c6e8 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 c690f1e1e330e5f43506ce1cc16edba7bd5624e2 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 528cda558eeaa390902f5c5e93ac911b2b756375 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 61f99e5d24408f9fa12125b8f5b06549efeb7c91 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 4dbab6c00d5e2a896d823f33f296835b2dad0377 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 f81bb46c2c053b7553f1efa9841d67dc52315c17 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 c90eab7a4c252a0f3eafeb666dce0f4c93b9f88f 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 e2bb8f31a312f074d0de6e2d8e6bf89d575b0fd7 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 d23f817fefcfec670d56362938b71f077a39ce99 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 22d087a71f1edb66c280a31da57d92c9b9f7b7be 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 294ba20e7413eb117d3a6d5db7743ea4ca31a110 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 cac8ad11a53b4ec53d824dbe69c0cfd8d49e8567 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 9d495a1ccf5f5da307711a699e70c923dff7f43c 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 46e33eead585cd5e06189a5f0293220869063972 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 654ab8f7d5448d3e25f628c89b5239a178d14d55 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 d1bd1a38c727bcd444fc033eb909958d249bdf3a 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 697b4c9c6c7e0d17f087a8ffa696994ff1ba9ede 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 e6f99c2a9cef59a3831848a685625ee69b2f1f21 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 1db69cf2641a2ae781faeeea7f9eb0e51d544a93 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 d45a646a6024fb5ee2b62259746afa2a293de343 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 dce9861ab4e438211f4718e3fc9ba45e96e06062 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 da5e2a9a16cd676b77a8d5a393cfd556a2b5922e 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 f898069c933259c7f4461a9bd380111e30239cbe 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 73bf0913e1166928c6258d9760b24d3470fe9ea4 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 f67d44572c555a2b9dca00415e0593e4b74a04c9 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 39012199e29529d999028a1d52c9769fc1bb9afd 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 6c9949aed8266fdb90b9c6cb1ae5b9d767f1901b 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 7c9aac70f959f90643884c6fe8ab565fa4aeec15 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 f21d404b1f7ac52a0e98cc6557f74cab721a2e42 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 40da67a4193b6de474911190d9bc8ae81abcff55 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 0c00263743264e8326775954d92ba97f98ac0f89 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 a9d2bb5b098ec693620834e70094a8480277a4cf 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 9197f51f06e2578ec2a8bbd907084827fb278d0a 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 db3e3f1c9a68db6614d5e7f483c62da21bd9c771 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 82a7245a60425216af47f5445de2129d92bf318a 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 2086dab5e1bc0cbd969b4cfb9dbf282bd9df3899 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 9e015d664b458e15a925641805b342884c32f9e5 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 3fb35324b57e6f46d8e6eefcfa9cfc4d22735b19 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 0b151424054d8fe3cb4967337516ba38b1d1a329 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 0c170ace4a09f86ab6d03d0054f7b54f629c3891 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 40d8518dd43dd0edcd83a347f1854058b123c7ba 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 70fd726ff1da1dd42b3eeecf6bb077109c510d5e 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 38398012ed59d54cbf8dbb3b7645f1700960f3d0 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 4fd26ab4d6ce6b209922fcaa85c53e55e294c623 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 7109d4e308d6d7415b7e58866fdd294edd7f4385 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 ac2505e34311d46b4ff03eed67547499ee4450ca 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 016d555ff77ff6c82a4bbb31f4cde337bda46d31 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 afa720aeb9329b10f973ab396e5ad802f7650ccd 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 5bda464ec9adfe60232f40f93e553534d2e54438 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 ca6925f98f79c6d2b24a0440290c576cdaf967cf 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 83e4802d08870d5043c2c4c75cb518c6a01aa4b5 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 8eafce9ade881895f3975082272bba500bee99a2 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 d83d3dc01d2d9a613ffbe73c1dec578c9dbe7378 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 ce3dcf963822ce6aaccee34688909b6b797fff90 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 199e3e4d5bb523f0c17a7fc8866e5633ab2b3edd 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 4841f7eecd4fd3cc3e2018932515bfecbc977c2b 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 178318b25bc145a41ea9294e8c6b8bcdb233bb5d 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 4f6e7ade2ee9ab9e7e8c2851df3490c306b68342 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 9ab2ae6f442ac9844de92279afbafaab7add9889 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 c36bf20e3928fdd013098f61186338efc9c96a4a 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 ea6e4e3a7c8453674337c7773cf3b101f328c876 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 d6676f2bdd5717d8ca92ee44d5f23e5c9da34142 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 41b3f72bc94c7701c322fe7c390edd7d2ec1ee38 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 5c0e66058314fc994feef9e1a1879146ea3698b6 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 a9e44abc08f97c8239aa7145928954f4876353b8 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 ceaee811c240dcff5d52c95be00fec82cf430436 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 2468252d9190ebbf2da8d81b0132d7f2a67d86ec 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 3a4533ec3e88f1cce356869cf27b3cca97d14d29 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 95819b29c6f68978c963a1cfb689ce48fa432db3 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 03c312733fd70aefca8ba6f99c7ff01f5d9309d9 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 1991a62c2f6d1b5878ae33486b055c0d43d50b8d 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 d3f51974d4e74f08e7740db155e37518d19d8b6e 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 fc92d5c22a91ef020a1f9e2ade2078a397786ac8 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 81cc4a777fa00129b090e4d131a33f51a1c1e3bc 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 0c5c1e29b14c29c198840e0ef27aaf2b0477f49a 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 1a8f4be899b6aa990dbcfd58a7ea9c3600e48592 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 b0cc11d8a36cb1246c4cbe4f4a852302aab233ad 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 798fc48311c52fb9e83b9743fdc4dce1af1402ad 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 230db52ccd19c86a17548cdc826dbf5341b125c1 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 3d6680bf46834eae8d943961192034bd562a18dc 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 29f37ec79e879964e6ad7fe37500362517c880bd 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 25ffda983fd87306f41ff166aaf7825255bc1235 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 16404c435fdf9a32cfb306b4a41244a485f16d35 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 ad748865961323995365369347f19f6968ea90a9 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 7ca1dd2fc9f896372b71323fd5197a595a44652f 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 481825d90861b5b1deecef37f2f8602cc3b93f09 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 3c8e2c5913987b825880a936e31c2b03682bc21a 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 5856b2384e385efea01b23b68248f99a620af91c 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 f7aba6397bba68b94fd40c59b849026fe172765d 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 ca582b9c8467eca9a575b120c7b3981f10d600be 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 49b5388cc8b63c095f7a49c10a679368112f945c 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 c1bde6e9975f9cd9d3104633620399f127145f8c 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 34aa97b7a23d05be25a040c5e0d74a4a153dac29 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 e450925162962bfb372e896c0b9bbfcd9fd0d124 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 0099e6324887166b956c41542b6c017e150aeae8 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 29398176771782e9217a4b0cdaac200560d65d00 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 178d1d3260c97ab6eabc9b9c0e07ebec2c5c9936 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 ba1f45e8624e62e32603c65bcf3eb31f77f5d9e0 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 1bc26efb5dda9e01cfc1b9898f7488afdd874231 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 81e5a4f56e2219958579d220bd387a563e7bf7a4 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 b21d25b0046d180095aecfa03b9805f38aae1d0a 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 6ae0c2c9469571ec315902b3ecba64cba79501c7 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 007738a81ed06f7b5678129a857c8b4154fb3e99 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 341f197cfc0aaddfdeb97a82aa3289fa3a40adaf 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 bde66db4cb6acf7a5327896c6cca1d36e132ab5a 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 39d3c5531e7bb3f59fbd658715d410b3d9c80fd6 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 19ff998f1d27e1417b286ae0ec88fc19842d4f2f 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 25d677bbd67a12d5057931b1fe3db70bf26a9f84 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 d6fec458f06fd30d0cb3350ac772f161ca35866a 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 67284a267a4bddcc8610b47aa5f1f93dc68c885d 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 eb9fce219e5358b43d13383165e269c638783524 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 fce4219775043a768105cb85a5390ac09c96f6e1 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 00a5f87d1a2622b4dc4d39c0218d3f82952a9679 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 ab8bfdfcbd88e757ab7fbe215fe7fdb2ef72ecba 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 6c674eb2ba966d1db238cf2ab421b2b05724f28c 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 af2655d9889ffbf343049662ce5ecd8b54445b37 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 8d576f249ca283b53ccc59958fbe63660596e62a 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 a375493b05df8ebaba1d1c8b0f3675f02f702516 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 263652c471b0f2e81e4eacb0a665a7aef61106d2 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 f98c4c79e505cef57d0f37e8f27a8a062914321f 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 fbc4647710b6c5dd09b3ddcd95252354cc8ddbea 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 573320c29c87f019ac4d0caee9458b5006ee56ae 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 4d9afedd1a807d1b1b245c500b944e0779448192 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 2fb99690d4eb2895666b04a9537467c13679b5ad 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 d8054c8c828d5a2e5731c7a5bd73b682c68b7fcc 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 63ac0e4293f03143f112fee06352aaca8396ae79 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 4496c1f86ec80f5956ce8b95672df95bf6ac46ba 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 1337852095b6e7bc6fcb8c7122c30aed4440e358 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 91d8dfbc7afea5ea091f96fa6667d1a4e029de17 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 800f206086ad962450ccbfbe1de8c90bd29db70a 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 19496367fc60e64cf1e327bfd9845b03df0fabd3 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 3d6613f19f9d4308a63d3a5563badb9462bc0171 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 59a1da069f151e921b667d4b273d273ab3d00638 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 c051139a93606b98d8abd9430e832f2ac3b946d8 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 70d921aded38c65f3d0413e068866678fa028404 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 e00d4565bd41f65e44336a7c91c944a61f860b14 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 a7c4a5654e38386776c61b68238831b5c564271e 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 d9467d628aaa323af286e1e3c5c7f6b20fa2d5af 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 5c45f045c866c5e036586312101137bc7e684660 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 04fac1d6ce16a81b37d8f544fe8199a110ebba7d 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 38dc476f3fc0121fd8b4fb89b9b23d664d382cc3 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 cd9883d69d7fa94e4ef8c590d097b92ebd7d6f1c 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 e11e182067d66aef7bbe87bd9039508adf2dc1c1 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 37afe25c6e20b71d429feda8ae3ed0b57e4211c8 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 e7c506ae22ca46ecadcf05d408977965c0ecdb90 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 029f8c28ad22c9d99c55341a30d34f323978eebc 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 aede204cd032f89faeb18481a36713bdd48a8fab 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 2d175ac3b6e76ba5fdf18fedb54bf4f87cb33be8 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 8f3cbcaff7357492972476d2d7b76b20f82758f1 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 ca04ad88b50541505b1b199b65f69ed3fd4f7238 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 94a21d4811f8a4b0f8f3eb8db22c2d9ef54db9a5 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 524924680ca32d8299ff3110919131f6c94fab61 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 dc0e48d8666409e044ccb186c78cfbbff94b8aee 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 d9442f66f688adc0746dcf9ca44289d2188f9a4e 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 0847c1727203703b8d8cba27dfd77b1d52cc715b 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 ad4461c5290e948b2f7f07393aebb964b865ff9f 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 fa4b73f981d275cecff024b7344b67cf8cef3785 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 635dcbd6c069c737428ca8b7ac2c3e627ec5c481 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 84b92e0533a6b97b3c734dd0b145a2074da8ac67 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 8154b50e8d2c2e9ced72e9d0e250966aa143c3ef 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 7fc79f6f87811f739a556e2f9b4b65638d4afdfd 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 62d8467ef206afcad1d7fa09f9e4c302dbc15531 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 92270d2baaa6f9dac253c4ba0866103a99c7a683 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 8d69583f2d5145f9bae4780b19a64b65aa6862bf 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 46ded92dfbbc237aefa064f2be7db3b68ee82a86 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 26cb8ef4210e044ef9956a073e741d92b7cc9307 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 6d86631ffac1567835f28d79b163f829f9f86692 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 a7470df0fd617923c099f7e7af244362da6c3e95 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 1659ec8dd251bbeba0e2bcac37f95be3c474e39e 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 276a69d4308410e26f79cbde242b31a736190c18 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 179d5528b038d6fd1887b4c0a5e73025f5858fed 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 27e425db2b8e979ea121a0e12b6f8d0d5a126f47 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 988fb0b3f2d5547ddd0e9fcaaeff397387c6dd58 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 02847d31befb0ed59574c0154a945b7e07e04685 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 237981cefb4141636e53169fb0cc078d3807f41d 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 7be0c3c54a8555f61ceb6c733f77c553d83cc592 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 c2ff4739a617dff9e446db4ab046bd34c835ed2c 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 907305030bbb4b5ddcc814d6bd37f1e121a82c91 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 9b8a81d9212dc933b9ff3d92f808952ed0c3ca3a 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 a45e798741ca5dd9ba8e45513e387f905d8830ca 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 9e8555cfebb67a3e4fb540a0e7c196e309f5dbc1 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 369cff97fb5497267c7984e178434d68feb0e419 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 752bcb870d89dd67b571cdb1817053dea8a25caa 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 23c1b71f7778e1972fae3b16362289c011455a54 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 4f1a96a51e1cb30711b9d55c8db22c38bbb60cb6 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 a87f48135265857af4ae9423963c873292310064 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 b4fd3e2f7cd854e3afa969b2bd851458452e5075 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 835d45cdfcffaf5f00b0bced98e312953a7a0299 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 88c9b4d467981e5a85db33232c4d533c3dbe9e00 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 099f7e35e0126f0ef399347595d5dcadf157c3b7 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 4ce6bfec6504e0dff2d41da23448ad62003e4aa9 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 ddfcab8277bb0400f61f63fcf93553ec23bc1ff2 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 5f2e545985465cfa04351d73f308e8fa9854330c 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 71a49058037c3e136975e2802211f3541452e5ad 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 397fe449f84ca408185d8c842faad6b1a727d99f 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 42c50abec9ee5946e9283f6f6a702b14b40a8a86 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 c8cd7e0ecd8483d14c793ff2c70c1605d683815b 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 8b0e8cf7eaa3b4e500eee563d82fba22417e327a 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 99e1b9ddd5eeb209995e59a99825231ec47b178a 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 c9890f71bd693c50cf66b51dccd2bcfd06ea7164 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 de87d311d5a3a5752949acb41962a86f31ce2ef0 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 59b664d7553390a0ca5b7d78cfdb89086eec4933 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 48785a80b30b8a4acd1ac1b192505425331c8b4b 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 cafda8fc0f7e67b8a77659f47f9593a302b1a133 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 4bb6bef1fe13acb638e95d5f828ac7a51574c9bd 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 c0ebebb7a2963edb30211268a52876ad5e42dd1d 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 2bc91a930076ba9b2f2382b785de309f39f854f6 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 d40fe462791411c471021a29385868446f29f6b3 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 53958ee9043b05f9460b17f8a063cc70fe08be57 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 5a84e362017d4d6a1b59953ad4f0adf286351e59 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 2a67e1fc83c1530cd6e32f2a78594940592a9825 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 f1d9ccd296524129f2f0902511eadf525d4c4158 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 0a45be34ff59fcd8a643498fcbd84fe7a67c0d50 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 871e96ff9240099066411f61a0d573602ead5fca 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 8130bccfc026882ea2316c7cfe6249af5b3a514c 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 e1d1bbcf401b225d939d596f43429033ece84b18 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 14a8a9e1d0f706658ae147d6473e56d0f2187994 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 a2361cb0df8422ac3bda927455d098fe86bfe3c7 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 a9d0c2da076657a875e00973e5aeeb9c03dea9ea 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 cee0514180bf37a367865d723ec294c8c6cdcea0 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 1d9808f3020313998e59a9ca67206a2aa1d53a2b 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 bdfbe1dcc3b8e45db009c20ba2ed9fa264faa585 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 548bfbf50cf0b5851629b9fdb9c54b8fa61191f6 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 c4480730dd2c0555b4bd4845a1d5c98c70ced9ad 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 b7576d8e0f03ad51dd37e36665e6f9344d8c32b5 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 ce87a9bc0bdd3153b1c810e6fd5a87b16bbb3ca4 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 e8a2c6fe88a825fef0ea6ac501309de90adef02f 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 ff5b00fdf78b7bd95b651beb9ea704a0be8d5be7 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 d41c3c8f10b456aa3d75ea3107ce13f8b58f4598 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 fcece836e3ff8e100db9f11bede3564422ca89df 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 052a1969e83f7fbf263126a8939fc4ea48c1d835 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 c1bb0e19f4a96d26f3bc5033defd4934ef5c4521 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 ddca901b47d020e8cfa0029c841708d3ad8ebaab 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 87cc3e632eb9665d5257e9c9fbf2327639d8908d 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 9eff086093ba39e8060af8eafe5090985c3c6ce4 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 93d82fc616e9339b495e4244b9d1f66d7bcfe38d 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 61d06a7c4d5232e3e51dd736a78d6f3a4091f97c 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 42db2c4102debd716e217796e995eb0f9c774af4 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 1c7567304c778e347c16a819cec83250118ebf17 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 60694e0f8940ae0213a53074f7a3d8def55badc0 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 fa5f4113912baf113fc851e005d25506fbed1961 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 a88dae565a7adfb8b3d5cfb31523c8fddbb503cc 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 b0f2e314b55d84c2f775843bcc3e625e6c5ba1bc 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 c60b4e6002f08456a975e2c7c32bf2d6f484da56 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 98fe784a273bf2ae56522b73588deadace2d92af 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 2f98ae67481902237b290a3c76c2493c6735ef8a 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 9d5134f0bc665c99871884bda4c33aaa834d8f3a 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 c52a0d27f6370cbf42c9fe34fbe754569afce6cb 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 520977f1606b8de1d62ed0cf13e5195d13864b3e 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 8af58634154e537b4cbeb82d56de0e9ff1d588ec 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 cb5c7e185101448d0551890da3a3fde53bf3eb13 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 63bf164976eaa5d1fd5a54ce2e593c18151812a4 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 6e5f08e089b690f1420b57daf03c7508b47a5a8d 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 664e92a740fc61d651afe34c2e23552171c4f326 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 a1f6aa3db56711b897532eb15aa7b0c82787a590 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 d9f6e5e6a41fcdd984db5564743db0ca9328780c 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 adcdf2952ba52e6c3b68dec270a78096a6cedc15 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 2d9837560e0eba4601a96751e8e3908ef0e17d83 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 d0a692fce5408596ded6a4f40ce13844df72c62f 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 c3e7d0e8dfecf4c23ae2dc7832229c224fd08855 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 142723bd3ac8c757a9564c42615433c7e76c6616 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 9b9e9bf016ca6dd7552e5ed3169fedf40fcbe1a0 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 708599d7070f8274f36a6eabe16ce379413a552c 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 509fce20f6a5e880fe576eaf23f4a49075d72dc9 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 b6410a98a09e1d910000dfb045920e94f782443d 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 61002aa895d50414adfb835db81827fb00275679 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 0fad9b99568afaf017a545302abca2b4b36b319b 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 2325edb8908f06b956acb8e45869ff465f9819ad 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 d37531439e3622f019d3cdb79e68c9fb8a9ca9e0 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 4e37ef5254588f0263e980da944da106c178a969 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 5a2eb6842541e2d4bf0ed6416bd08ee269c84182 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 fbaa4b7774bb079f004dd5d7cefb8ae946b69db9 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 ca964886acb25e23dcbce589aa523c1ccf57cd57 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 ca7b1a37e885891ac52ecea393b16f8a6553a2ac 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 53000e55ae88f9c5e02c40fc09ee3a4587e7e7f5 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 f9f0914a0c870e5b486d133f35af7a469e6d9d75 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 b90dae083ffe9795893008ef071154a5fdec0a2d 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 420319c0f4236686cc5e1541636f03535d18146d 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 f57659ad6fe30d130cb27a09e61f3ac9c80c99a4 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 445b7f155136e7281b7d6113d6f47e3e684ec9e5 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 d08780661836f1156dd715c39c4aa590508d3583 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 5722c41774b1c4d6d0ecd43d494ff5fdffd0a0c8 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 c99d346829b31de8e6a7d5d9c82a872c902d20bd 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 92b5b6a909653128b74753dff6be369e11ea2fd4 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 b44e03bc44547970d86fad298e4fb78ee52bbc06 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 b41dab7140528ed820090e2f03782dc676521088 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 b252abcdaf20a365a03a360356c9fe336116c228 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 39feec0f1dd6132652755debecf3087be212aa87 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 9712d8a83ed5d0b5f82a54a507e6c3edbb7f31de 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 6cf5a14c21fdbb7bb709dd4c4e4a977f7ea240f3 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 f6ebb3ee0ac9abb01e628238e2d5369b2de00ad3 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 74ac6e544d5e967ca8ab7d92e707310e57745f36 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 719fb96b2a1934924aae8140699323bfa71f7496 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 996065285783f30ea7e2f7edeebe660126c44ad6 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 2524d8f197b9454046a962f74d8da0ea25fc1bbe 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 be4d075a2622882b58b4e88b4d5c1db2240986e1 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 36677752d17ca2f8f37f51fedf7a0b7793441b30 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 9d554f7d945277c5d5078daf59210bb266e5372d 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 2903d7003db32e7a33330f18e7cb87bd20473e8a 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 320916e59b819c51be11e87b78c5ef5962caea7f 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 eac29989106057e848dfd435e9a20a907436adba 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 ca1471c8b310bfa069ce6235a74d554bbc5c7829 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 2cdaf4f2b12be9801ab29d2002e227db13f9cc44 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 dcd0f4b14395ad9a0e102d8da5d2765d17e43ed0 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 2b049d0432dc33de4ae72548cf4dea4c594ca595 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 729c6f3e8127ebca0c3268e1c81eaa9ba6621028 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 8b6988a7c6b2f7cd7df3f9d6ee3a89c5a712a771 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 4add0054deed54696fc07bb0a1b95158460ec1ec 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 88ca99ac475f74e37ffb43704a954f5fc721617b 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 5628703e19d215283950d13a8b9e6351db1c7513 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 c5b789647be1b494757fffed349ca2347b9f7b3a 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 03bdd4ff177dfcf0c919d0cdeddd2943cc3ea04b 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 d9a1ec6df3fa47a33b371347dcfc80e941692bf2 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 b6841c65c6e5da4d6996891c68de4d5de452db99 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 e022fa2c850a6fb601e5bda1fffcb45c1c9a9249 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 3c04c042d10736b58ac3c8f52eb5b964d3f509c3 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 89714478eb9b2a903b36b4667c036f42339327f7 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 2bbe1d2fc1986e86f03c8181fc1f5749131a6da1 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 9908590cd0f890b6f0c3a16efaa4bbaaa63fc299 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 24896d504fc176c4d361f9e5cae820fd51da125b 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 63bf066480ffd6f6eb5910736ff5c1b54cceb99a 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 3806cde5bfd63545ad2be1d815b042a965e95175 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 052168fce0dc3449984ddd7e284ec0cc9c421880 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 710bb8c5440b467500c8b0df40344acf293b4bd8 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 3a7532a40fd25163a63f0bb3257118aaba6190b1 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 e2e9a6f81ec8cc64a4a97c508eb24cd2d4742679 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 47635bc2b38c31e60fc471cce2996ac43fb779ca 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 4ab4c61a713b2ed6b368fc2e7f9c842763698b33 Author: Hao Li Date: Mon Sep 21 17:41:13 2026 +0800 mm/slub: refill prefilled sheaves from the barn [ Upstream commit 1b87ea06a34b213e45e3e0c4effd5043f15046ed ] 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) [ sashal: Adapted by calling refill_sheaf_from_barn() directly in the two prefill/refill functions, since the upstream pfmemalloc prefill helper doesn't exist here. ] Signed-off-by: Sasha Levin commit 0a76b130866b8d48fd239179ce9cf55c669cabaa Author: Pauli Virtanen Date: Sat Aug 29 17:20:01 2026 +0300 Bluetooth: 6lowpan: avoid concurrent peer_del() in bt_6lowpan_disconnect [ Upstream commit df5175dfcf4879f6bcdadee614ac089e5627b721 ] bt_6lowpan_disconnect() looks up and accesses peer->chan, without holding locks guaranteeing peer_del() cannot free the peer concurrently. Take devices_lock to ensure peer can be dereferenced safely. Fixes: 15f32cabf426 ("Bluetooth: 6lowpan: add missing l2cap_chan_lock()") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz [ sashal: Kept this tree's existing lock/close/unlock sequence on the pinned channel instead of upstream's l2cap_chan_close_unlocked() helper, which is missing here. ] Signed-off-by: Sasha Levin commit 96ef644df93b44c2ea6d8616a892c53f525bbb62 Author: Nickolai Zeldovich Date: Sat Oct 24 00:13:33 2026 -0400 pidfs: do not report fields that do not fit into the caller's struct [ Upstream commit 1534c37167488f2b85c74de048e1d6a4ba3848de ] The documentation of struct pidfd_info promises that "If the structure size is too small to contain a field (requested or not), to avoid confusion the mask will not contain a bit for that field", and asks userspace to trust the returned mask when deciding which fields hold valid data. pidfd_info() does not keep that promise. It builds kinfo.mask without looking at the size encoded in the ioctl command, and copy_struct_to_user() then truncates the copy to that size. A caller that passes a 64-byte struct (PIDFD_INFO_SIZE_VER0) and requests PIDFD_INFO_COREDUMP or PIDFD_INFO_SUPPORTED_MASK gets a mask with PIDFD_INFO_COREDUMP, PIDFD_INFO_COREDUMP_SIGNAL, PIDFD_INFO_COREDUMP_CODE and PIDFD_INFO_SUPPORTED_MASK set, while the coredump_* and supported_mask fields behind the 64 bytes were never written. Trusting the mask as documented, userspace then reads whatever its own buffer held at those offsets. The same happens for a 72- or 80-byte struct and the fields added after it. Clear the bits of the fields that lie beyond the caller's size before the copy, in the one place that knows both the final mask and the size. A request for a field that cannot be returned is thereby answered the way the header describes: the field is simply absent from the mask. Fixes: 1d8db6fd698d ("pidfs, coredump: add PIDFD_INFO_COREDUMP") Signed-off-by: Nickolai Zeldovich Link: https://patch.msgid.link/20261024041334.831273-2-nickolai@csail.mit.edu Acked-by: Luca Boccassi Signed-off-by: Christian Brauner (Amutable) [ sashal: Dropped the COREDUMP_SIGNAL, COREDUMP_CODE and SUPPORTED_MASK clearing hunks, since those bits and struct sizes don't exist here, keeping only the PIDFD_INFO_COREDUMP check. ] Signed-off-by: Sasha Levin commit 90f8de0b7e70fe87a86b7a72ba9df3b766c35ece Author: Josef Bacik Date: Wed Oct 28 10:41:35 2026 -0600 blk-mq-dma: initialize the dma state for P2P, too [ Upstream commit 035236c9e135a2ce7d0f68cb56e63d4a3da2abe1 ] blk_rq_dma_map_iter_start() promises that the caller need not initialize the dma_iova_state, but the P2P bus address path returns before it does so. The state then holds what the last request with that tag left, and blk_rq_dma_map_coalesce() describes a transfer as one IOVA range that it isn't. Clear it on that path too. Fixes: 858299dc6160 ("block: add scatterlist-less DMA mapping helpers") Signed-off-by: Josef Bacik Reviewed-by: Christoph Hellwig Link: https://patch.msgid.link/20261028164415.1262013-33-axboe@kernel.dk Signed-off-by: Jens Axboe [ sashal: Kept the existing P2P request-flag code in the bus-address case and added the upstream memset of state after it, before the return. ] Signed-off-by: Sasha Levin commit 85525fab62d8dbec58445de0c1ced59da4bd2d70 Author: Jacob Keller Date: Tue Oct 27 17:05:37 2026 -0700 ice: use reference counting and SRCU for PTP port access [ Upstream commit d5d859a6efff473d799d35999a35aa764dcc185b ] The ice adapter structure maintains a list of ports associated with the adapter. This is used for supporting PTP, where the clock owner must handle many operations that require access to the PTP port structures of the associated PFs. This is implemented using a linked list and a mutex. This sort of works, but a few places within the code do not acquire the mutex when iterating the list. This includes ice_ptp_flush_all_tx_tracker(), ice_ptp_restart_all_phy(), and ice_ptp_prepare_rebuild_sec(). Fixing this is tricky, especially since it is not clear if we can simply acquire the lock around the complete iterations. The pattern of use for the port list is read-mostly with modifications only happening during PF initialization when elements are inserted. This typically only happens during early boot, though a PF could in principle be removed or loaded at arbitrary times via bind and unbind operations. The use of a mutex does mean the driver can sleep while holding it, but it still creates complicates with lock ordering and prevents iterating the list in any code path that *can't* sleep. Instead, use SRCU primitives for the port linked list, along with a reference count on the port. The kref reference counter ensures that a PF will have a valid lifetime and not be removed until the reference is released. Note that this change focuses solely on the port list and does not make an effort to resolve access to ctrl_pf, which is currently being investigated by another developer. Use of sleepable RCU is required because we often iterate the PTP port list and perform operations that might sleep. Attempts at implementing regular RCU have thus far not proven to be acceptable. The remove path first removes the port from the list, and we use kref_get_unless_zero to ensure that such ports are skipped when iterating the list. This ensures that once a port starts removing we will drop references and no longer be able to acquire new ones. This avoids loop iterations chaining together to indefinitely block removal. The ice_ptp_release_port_srcu() function is used as the release function for the kref_put() call. This uses wake_up_var() to wake the removing thread. The waiting thread will block until the final reference has been removed, then it will use synchronize_srcu() to ensure any outstanding SRCU critical sections have had the necessary grace period. This flow ensures that accesses to ports via the adapter port list will remain valid until both the SRCU critical sections have ended and all the references to the ports have been dropped. Strictly speaking, SRCU alone might be sufficient for existing code paths, but the reference count allows the option for passing a pointer to the port on to other functions if necessary in the future. Fixes: e800654e85b5 ("ice: Use ice_adapter for PTP shared data instead of auxdev") Reviewed-by: Maciek Machnikowski Signed-off-by: Jacob Keller Link: https://patch.msgid.link/20261027-reduction-v1-1-81237c67a361@intel.com Signed-off-by: Jakub Kicinski [ sashal: Dropped the cpi_phy_lock init/destroy context, used kzalloc(sizeof(*adapter), GFP_KERNEL) instead of kzalloc_obj(), and omitted the mutex.h include context line. ] Signed-off-by: Sasha Levin commit 88427a63afa99e11db98e12f9245bb5a626b9b1a Author: Kuniyuki Iwashima Date: Tue Oct 27 06:52:45 2026 +0000 ipv6: Protect multiple routes insertion by table lock. [ Upstream commit 4c6fbb1fbafa85029fa789b5b01f39ebcb459d1a ] syzbot reported the warning below. [0] While call_fib6_multipath_entry_notifiers() is called locklessly, fib6_siblings could be changed concurrently, leading to the warning (and later null-ptr-deref). Let's protect multiple routes insertion with tb6_lock. Along with that, __ip6_ins_rt() and ip6_route_del() are changed to fib6_add() and fib6_del(). Note that fib6_del() finally calls rt6_multipath_rebalance(), which requires rcu_read_lock(). [0]: i != fen6_info->nsiblings WARNING: drivers/net/netdevsim/fib.c:831 at nsim_fib6_event_init drivers/net/netdevsim/fib.c:831 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsim_fib6_prepare_event drivers/net/netdevsim/fib.c:947 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:1003 [inline], CPU#0: syz.0.157/6279 WARNING: drivers/net/netdevsim/fib.c:831 at nsim_fib_event_nb+0x1029/0x11d0 drivers/net/netdevsim/fib.c:1043, CPU#0: syz.0.157/6279 Modules linked in: CPU: 0 UID: 0 PID: 6279 Comm: syz.0.157 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:nsim_fib6_event_init drivers/net/netdevsim/fib.c:831 [inline] RIP: 0010:nsim_fib6_prepare_event drivers/net/netdevsim/fib.c:947 [inline] RIP: 0010:nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:1003 [inline] RIP: 0010:nsim_fib_event_nb+0x1029/0x11d0 drivers/net/netdevsim/fib.c:1043 Code: eb 0d 4d 89 fd e8 b7 c5 6c fa be 01 00 00 00 48 89 df e8 5a 38 85 fd 4d 89 ef 4c 8b 6c 24 20 e9 4a f3 ff ff e8 98 c5 6c fa 90 <0f> 0b 90 e9 db fa ff ff 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c df f0 RSP: 0018:ffffc900047bef10 EFLAGS: 00010293 RAX: ffffffff875b59a8 RBX: 0000000000000002 RCX: ffff888079770000 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffffc900047bf0a0 R08: ffff88805c0bb02f R09: 1ffff1100b817605 R10: dffffc0000000000 R11: ffffed100b817606 R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000001 R15: ffff88802c792000 FS: 00007f334ba076c0(0000) GS:ffff888123ad0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f334ba06ff8 CR3: 000000007a5b2000 CR4: 00000000003526f0 Call Trace: notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85 atomic_notifier_call_chain+0xda/0x180 kernel/notifier.c:223 call_fib_notifiers+0x31/0x60 net/core/fib_notifier.c:36 call_fib6_multipath_entry_notifiers+0xf5/0x160 net/ipv6/ip6_fib.c:428 ip6_route_multipath_add net/ipv6/route.c:5542 [inline] inet6_rtm_newroute+0x14f5/0x1a30 net/ipv6/route.c:5664 rtnetlink_rcv_msg+0x802/0xc00 net/core/rtnetlink.c:7163 netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2572 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7bd/0x940 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec+0x14e/0x190 net/socket.c:800 __sock_sendmsg net/socket.c:818 [inline] ____sys_sendmsg+0x54e/0x850 net/socket.c:2715 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2769 __sys_sendmmsg+0x273/0x4d0 net/socket.c:2858 __do_sys_sendmmsg net/socket.c:2885 [inline] __se_sys_sendmmsg net/socket.c:2882 [inline] __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2882 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f334ab9e1d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f334ba07028 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f334ae26090 RCX: 00007f334ab9e1d9 RDX: 04000000000001f2 RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007f334ac35888 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000fc R11: 0000000000000246 R12: 0000000000000000 R13: 00007f334ae26128 R14: 00007f334ae26090 R15: 00007ffd96688aa8 Fixes: 169fd62799e8 ("ipv6: Get rid of RTNL for SIOCADDRT and RTM_NEWROUTE.") Reported-by: syzbot+751b587577d0ebca10f2@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/6adbaed6.67317f00.38c4bc.001b.GAE@google.com/T/ Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Link: https://patch.msgid.link/20261027065247.2871134-1-kuniyu@google.com Signed-off-by: Jakub Kicinski [ sashal: Dropped the third RT_DEL_REASON_UNSPEC argument from the fib6_del() call in the multipath error path, since this tree's fib6_del() takes only two arguments. ] Signed-off-by: Sasha Levin commit 26d9be0889a453a1170664fd32602699da342c40 Author: Chuck Lever Date: Mon Oct 26 18:52:14 2026 -0700 tls: Honor O_NONBLOCK in tls_sw_splice_read() [ Upstream commit 78ded647d43e335891f981f68c5992a2e763cfcc ] tls_sw_splice_read() takes its blocking behavior from SPLICE_F_NONBLOCK alone. When splicing from a socket to a pipe, do_splice() sets that flag from the pipe's O_NONBLOCK, not the socket's. On a nonblocking socket, a splice(2) call without SPLICE_F_NONBLOCK therefore sleeps in tls_rx_rec_wait() until a record arrives. tcp_splice_read() instead reads sock->file->f_flags and returns -EAGAIN. Polling first does not avoid the sleep once tls_sw_splice_read() consumes zero-length records, as it does after a later patch in this series. tls_sw_sock_is_readable() reports the socket readable while any record sits on rx_list, including a zero-length record that delivers no bytes to the pipe. For TLS 1.3 the strparser announces a record before decryption, when its plaintext length is still unknown, so the readiness test cannot screen such a record out. A splice that consumes the record and waits for the next stalls every connection an event loop multiplexes. An LLM audit of the TLS read paths found this defect. Treat the socket's O_NONBLOCK as nonblocking too. A caller that sets O_NONBLOCK on the socket and splices without SPLICE_F_NONBLOCK now gets -EAGAIN where the splice blocked before. sendfile(2) from a TLS socket changes the same way, because do_sendfile() leaves the input file's O_NONBLOCK out of the splice flags. Both now behave as they do on a plain TCP socket. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Chuck Lever Link: https://patch.msgid.link/20261027015215.605919-2-kuba@kernel.org Signed-off-by: Jakub Kicinski [ sashal: Passed the branch's existing NULL psock argument to tls_rx_rec_wait() since its signature has an extra parameter, substituting only the nonblock variable for the flags check. ] Signed-off-by: Sasha Levin commit bf274719847ecdf1c19a0af3aed087b693033f25 Author: Josef Bacik Date: Wed Oct 28 10:41:37 2026 -0600 block: don't enter reclaim under rq_qos_mutex [ Upstream commit 045cbfc369f5929ed473f7c200dc2e8146569ce5 ] ioc_qos_write() and the wbt_lat_usec writers take rq_qos_mutex with the queue frozen, blkcg_deactivate_policy() does the same with blkcg_mutex, so nothing holding either may wait for IO. blkg_conf_prep() got GFP_NOIO for the blkg in commit 5d726c4dbeed, but the radix_tree_preload() right after it, the policy init functions and the GFP_KERNEL fallback in blkcg_activate_policy() can still enter reclaim there. lockdep reports the cycle on the first write to io.max. Use GFP_NOIO for all of them. Fixes: 9730763f4756 ("block: correct locking order for protecting blk-wbt parameters") Fixes: 5d726c4dbeed ("blk-cgroup: fix possible deadlock while configuring policy") Cc: Tejun Heo Signed-off-by: Josef Bacik Acked-by: Tejun Heo Link: https://patch.msgid.link/20261028164415.1262013-35-axboe@kernel.dk Signed-off-by: Jens Axboe [ sashal: Replaced upstream's kzalloc_obj(*ptr) allocator calls with kzalloc(sizeof(*ptr), GFP_NOIO) in blk-iocost.c and blk-iolatency.c, since this tree lacks kzalloc_obj. ] Signed-off-by: Sasha Levin commit 31ffda4233c5ee697113b811cde3f3aff2f1bc80 Author: Namjae Jeon Date: Tue Oct 27 14:12:59 2026 +0900 ksmbd: return complete and aligned stream information [ Upstream commit 206fc30f71b005156085fd8523ccc84a2c67791b ] FILE_STREAM_INFORMATION responses are assembled without aligning entries and truncated to the client buffer length after the fact. A short query can therefore return STATUS_BUFFER_OVERFLOW with an incomplete entry and a nonzero NextEntryOffset, which clients may reject as an invalid network response. Standalone queries can also exhaust the server response buffer and silently omit streams while reporting success. Allocate the same large response buffer used by other variable-length QUERY_INFO classes for stream queries. Pack only complete entries within the requested output length and available response space, aligning each entry to eight bytes and sizing names after UTF-16 conversion. Return STATUS_BUFFER_OVERFLOW when more entries remain, using an SMB2 error response if no entry fits. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Fixes: 6b8b79226bc3 ("ksmbd: fix partial file information responses") Link: https://github.com/namjaejeon/ksmbd/issues/522#issuecomment-6391152923 Signed-off-by: Namjae Jeon [ sashal: Only the FILE_STREAM_INFORMATION case was added to the large-response-buffer list in smb2_allocate_rsp_buf(), because FILE_NORMALIZED_NAME_INFORMATION isn't in that list here. ] Signed-off-by: Sasha Levin commit afd3039627d97a959214d544c660390cf28d6527 Author: Rishikesh Jethwani Date: Tue Oct 20 15:44:59 2026 -0600 tls: keep TX and RX hardware offload on the same device [ Upstream commit 1c8a70075235cd733095532a97f2405037c52a7b ] After TX is offloaded on device A, a route change, or a change in the usable-slave set of an 802.3ad or balance-xor (layer3+4) bond, can make RX setup program device B. tls_device_attach() sees the existing TLS destructor and keeps ctx->netdev pointing at A. The RX driver state on B is then untracked: tls_dev_resync() and tls_dev_del() are invoked on A for a context it never created, and neither socket close nor NETDEV_DOWN on B calls tls_dev_del() for B, so the driver context leaks. The reverse setup order has the same problem. Check the shared device binding under device_offload_lock before each tls_dev_add(). Permit the first attachment and a second direction on the same device. Reject a different device, including when the old binding was cleared by NETDEV_DOWN: the TLS destructor remains installed and tls_device_attach() cannot establish a new binding. Setup then falls back to software for the requested direction. The RX check precedes allocation and software setup. TX uses its existing resource unwind path without calling the driver. Document the shared binding and clarify that fallback is per direction. This issue was discovered during code review and subsequently reproduced on hardware using mlx5 and TLS 1.2 AES-GCM-128. Changing the route between TX and RX setup installed the second direction on a different device. Driver traces showed successful adds on both devices, but both deletes at socket close targeted the first device, leaving an orphaned context on the second. Both setup orders reproduced the leak, even though all current core TLS context counters returned to zero. No crash was observed. With the fix, the same tests correctly fall back to software for the second direction and leave no orphaned hardware context. Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload") Signed-off-by: Rishikesh Jethwani Signed-off-by: Dave Miller [ sashal: Kept the branch's kzalloc(sizeof(*context), GFP_KERNEL) instead of upstream's kzalloc_obj(*context) and placed the new tls_device_can_attach() check just before it. ] Signed-off-by: Sasha Levin commit 8ddc9a086da47489e7ca60a479782d1873b96f9e Author: Dudu Lu Date: Wed Oct 21 23:55:22 2026 +0800 net-sysfs: reject a one-entry RPS flow table [ Upstream commit 24927bdf0f62f63470a065c21d80fff7e4e9f207 ] store_rps_dev_flow_table_cnt() accepts rps_flow_cnt == 1. For count == 1 the round-up loop leaves mask == 0, which is stored as log == 0 in the tag (tag_ptr |= ilog2(mask) + 1). get_rps_cpu() then calls rfs_slot() -> hash_32(hash, rps_tag_to_log(tag_ptr)) with log == 0: include/linux/hash.h:68 return __hash_32(val) >> (32 - bits); /* bits == 0 -> shift by 32 */ The shift by 32 is undefined and yields the full 32-bit hash, which is used to index the one-entry rps_dev_flow[] table unchecked: UBSAN: shift-out-of-bounds in ./include/linux/hash.h:68:24 shift exponent 32 is too large for 32-bit type 'unsigned int' __ubsan_handle_shift_out_of_bounds+0x11c/0x208 get_rps_cpu+0x12fc/0x1344 netif_rx_internal+0x1e0/0x4d4 rps_dev_flow[] is then read (rflow->cpu) and written (last_qtail) out of bounds on the packet path. Require at least two entries. Fixes: f3483c8e1da6 ("net: rfs: hash function change") Signed-off-by: Dudu Lu Link: https://patch.msgid.link/20261021155522.67521-1-phx0fer@gmail.com Signed-off-by: Jakub Kicinski [ sashal: Context lines adapted to the older overflow checks and vmalloc code; the added if (!mask) return -EINVAL; block is otherwise identical to upstream. ] Signed-off-by: Sasha Levin commit 2bf613d098ffdeef30298d9306f6ff60461d7a3f Author: Junbin Zhang Date: Tue Oct 27 13:16:34 2026 +0800 sched_ext: Reject rq-lock-taking kfuncs in tracing programs [ Upstream commit b07a7450f6ef98c79ebd450a92fc4bb6b8f1e02e ] scx_bpf_cpuperf_set() and scx_bpf_cidperf_set() are members of scx_kfunc_ids_any, which is registered for BPF_PROG_TYPE_TRACING. A tracing program can run in a context which already holds the target rq lock, in which case scx_cpuperf_set() attempts to acquire the same lock again: __schedule() rq_lock(rq); /* rq->__lock is held */ trace_sched_switch(); BPF tracing program scx_bpf_cpuperf_set(smp_processor_id(), 1024); scx_cpuperf_set(); locked_rq = scx_locked_rq(); /* NULL */ rq_lock_irqsave(rq, &rf); /* same lock */ scx_locked_rq() only tracks rq locks held during SCX callback invocations, so it cannot detect an rq lock held by the surrounding kernel code. The deadlock can be reproduced with two BPF programs. The first is a minimal SCX scheduler, which only needs to be registered and enabled: SEC(".struct_ops.link") struct sched_ext_ops minimal_ops = { .name = "minimal", }; The second is a tracing program attached to tp_btf/sched_switch, which fires from __schedule() with rq->__lock already held: SEC("tp_btf/sched_switch") int BPF_PROG(on_sched_switch, bool preempt, struct task_struct *prev, struct task_struct *next, unsigned int prev_state) { scx_bpf_cpuperf_set(bpf_get_smp_processor_id(), 1024); return 0; } With both programs attached, the next context switch on any CPU deadlocks that CPU. Lockdep reports: WARNING: possible recursive locking detected 7.3.0-rc7 #3 Not tainted swapper/3/0 is trying to acquire lock: (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x1e/0x30 but task is already holding lock: (&rq->__lock){-.-.}-{2:2}, at: __schedule+0xeb/0x1430 Possible unsafe locking scenario: CPU0 ---- lock(&rq->__lock); lock(&rq->__lock); *** DEADLOCK *** Call Trace: print_deadlock_bug.cold+0xc0/0xd0 __lock_acquire+0x12fa/0x1b80 lock_acquire+0xd1/0x2f0 _raw_spin_lock_nested+0x32/0x40 raw_spin_rq_lock_nested+0x1e/0x30 scx_cpuperf_set+0x1e9/0x310 scx_bpf_cpuperf_set+0x9b/0x230 bpf_prog_..._on_sched_switch+0x3d/0x41 bpf_trace_run4+0x125/0x450 __traceiter_sched_switch+0x4b/0x70 __schedule+0x94a/0x1430 schedule_idle+0x26/0x50 cpu_startup_entry+0x2d/0x30 start_secondary+0xfc/0x100 The CPU remains locked up with interrupts disabled. scx_bpf_cidperf_set() is similarly affected, as it resolves the CID through scx_cid_to_cpu() before reaching the same rq-locking path. There is no reliable way for these kfuncs to determine whether the surrounding tracing context already holds an rq lock. Reject calls to both kfuncs from tracing programs at verification time, while preserving their availability to SCX struct_ops and syscall programs. Fixes: a11d6784d731 ("sched_ext: Fix missing rq lock in scx_bpf_cpuperf_set()") Signed-off-by: Junbin Zhang Signed-off-by: Tejun Heo [ sashal: Replaced the tracing-visible scx_kfunc_context_filter() check with a separate BTF kfunc set for scx_bpf_cpuperf_set(), registered only for struct_ops and syscall programs, and dropped the cid variant. ] Signed-off-by: Sasha Levin commit a034ee229f4af38a58c6f42d30db1fb5684a5fe1 Author: Denis Kulikov Date: Mon Oct 26 15:55:41 2026 +0300 ksmbd: use the resolved share path for the share root [ Upstream commit 03b47bdc9ac8e9dacbf1d66a1dfc54b328e283f2 ] If the share path is a mount point and crossmnt is not set (crossmnt = no, or ksmbd-tools that predate the option), the share root looks empty to clients: QUERY_DIRECTORY on it returns only "." and "..". Files created in the root go to the mounted filesystem, but a directory query cannot find them afterwards, so e.g. "rm" of a file that was just uploaded fails with STATUS_NO_SUCH_FILE. An empty name refers to the share root. For it, ksmbd_vfs_path_lookup() looks up share_conf->path again starting from its parent, and the mount on the last component is not followed, which gives the directory covered by the mount. All other names are looked up relative to share_conf->vfs_path, which was resolved through the mount when the share was set up. share_conf->vfs_path already refers to the share root, so return a reference to it instead of looking the path up again. Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name") Signed-off-by: Denis Kulikov Signed-off-by: Namjae Jeon [ sashal: Adapted the context to this branch's older ksmbd_vfs_path_lookup(), keeping do_lock and the getname_kernel() filename handling instead of for_remove and CLASS(filename_kernel). ] Signed-off-by: Sasha Levin commit b2244abcbec1946e9a2c5f414d818364c5663dc1 Author: Waiman Long Date: Sun Oct 25 19:53:59 2026 -0400 cgroup/cpuset: Release invalid isolated CPUs with a shrunk root partition parent [ Upstream commit ec0254b9eb49ebc9383dc3ae5cb69c8606f88499 ] It is also reported by sashiko that there may be leakages of isolated CPUs when a root partition parent shrinks its effective_xcpus with isolated partition children. Leakage here means that isolated_cpus may contain extra CPUs that are not in any isolated partitions and not boot time isolated. Those CPUs cannot be used in any isolated partitions anymore. There are 2 different cases here. The effective_xcpus becomes empty and the isolated partition should be invalidated in this case. Alternatively some of its effective_xcpus are not in parent's effective xcpus but still have some valid effective_xcpus left. The isolated partition can remain valid. In both cases, the invalid isolated CPUs will have to be released from isolated_cpus if appropriate. Fix that by calling isolated_cpus_release() to release those isolated CPUs from isolated_cpus. New test cases are added to test_cpuset_prs.sh to test this. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang Signed-off-by: Tejun Heo [ sashal: Test-matrix rows use this tree's explicit :S+ syntax, and a stray # comment line was added by conflict resolution; the cpuset.c change itself matches upstream apart from line offsets. ] Signed-off-by: Sasha Levin commit 4ad1d8f1abec24e3c3915c9f96c318e2544ecc65 Author: Waiman Long Date: Sun Oct 25 17:44:46 2026 -0400 cgroup/cpuset: Release invalid isolated CPUs in compute_partition_effective_cpumask() [ Upstream commit a7d89d92fdfbceb678d82710135d4eee2623d727 ] It is found by sashiko that when a child isolated partition with parent root partition is invalidated in compute_partition_effective_cpumask(), the switching of the isolated exclusive CPUs from child to parent will not be reflected in isolated_cpus leading to CPU leakage. Fix that by calling isolated_cpus_update() when that happens. Also simplify compute_partition_effective_cpumask() by doing child partition invalidation only for the special case of no more effective_cpus left in a populated parent. The other case doesn't actually warrant invalidation at this stage and subsequent iteration in update_cpumasks_hier() and update_parent_effective_cpumask() for that child should handle that. Also drop the make_partition_invalid() helper by inlining it into compute_partition_effective_cpumask() as it is the only caller. A new test case is add to test_cpuset_prs.sh to verify this. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang Signed-off-by: Tejun Heo [ sashal: Kept the existing nr_subparts decrement and reset lines in the context, and added the explicit ":S+" to the new selftest row to match this tree's test-matrix syntax. ] Signed-off-by: Sasha Levin commit a9fae9d9240fb912097be6fb45b84029725c0bab Author: Waiman Long Date: Sun Oct 25 17:44:44 2026 -0400 cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier() [ Upstream commit 10a6f00d82544a1baa901de8d28f41f28c364995 ] Guopeng reports that changing the cpumask of a remote partition root may set the effective_cpus of the top_cpuset incorrectly. It is due to the following call sequence: update_cpumask() -> partition_cpus_change() -> remote_cpus_update() -> update_sibling_cpumasks() -> update_cpumasks_hier() -> remote_cpus_update() The second remote_cpus_update() call passes in the cs->effective_xcpus instead of the trialcs->effective_xcpus of the first remote_cpus_update() call. As a result, the second call can revert what has been done in the first call leading to incorrect effective_cpus of the top_cpuset as well as subpartitions_cpus. Fix that by adding a new remote_partition_updating flag into the cpuset structure to indicate that a remote partition is being updated and update_cpumasks_hier() should skip the whole subtree as update_cpumask() or update_exclusive_cpumask() which calls partition_cpus_change() will eventually calls update_cpumasks_hier() for that subtree anyway. This new flag is currently set only in remote_cpus_update() to prevent recursive call of remote_cpus_update() on the same cpuset. A test case is added to test_cpuset_prs.sh to verify this change. Reported-by: Guopeng Zhang Link: https://lore.kernel.org/lkml/20261010075947.333549-2-guopeng.zhang@linux.dev Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang Fixes: f62a5d39368e ("cgroup/cpuset: Remove remote_partition_check() & make update_cpumasks_hier() handle remote partition") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo [ sashal: adjusted struct field placement because remote_partition bool is missing, and added :S+ to the new selftest row to match this tree's row format. ] Signed-off-by: Sasha Levin commit 34733f719cdade2bf95b70a52fa69869001a0ed5 Author: Waiman Long Date: Sun Oct 25 17:44:42 2026 -0400 cgroup/cpuset: Minor fixes to prstate_housekeeping_conflict() [ Upstream commit 40702b2ca8fa08fb64b926d8c72a4909d0330580 ] Commit 9527ff78a413 ("cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check") changes the way prstate_housekeeping_conflict() is being used by considering all the exclusive xcpus to be owned by the partition when doing housekeeping check. However there are two minor issues reported by sashiko with that patch: 1) In partition_cpus_change(), prstate_housekeeping_conflict() can be called with an invalid partition root. In that case, there are no isolated CPUs that are going to be returned back to the system to become housekeeping CPUs, so the calculation of the del_cpus cpumask is meaningless. 2) The checking of del_cpus in prstate_housekeeping_conflict() to see if it can contain an active housekeeping CPU that can be returned to the system ignores the fact that an active CPU not in HK_TYPE_DOMAIN_BOOT HK cpumask will not become an active housekeeping CPU when it is released by an isolated partition. Update the existing code to handle these two issues properly to make prstate_housekeeping_conflict() produce more accurate result. Fixes: 9527ff78a413 ("cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check") Signed-off-by: Waiman Long Reviewed-by: Guopeng Zhang Signed-off-by: Tejun Heo [ sashal: Replaced upstream's housekeeping_cpumask(HK_TYPE_DOMAIN_BOOT) with have_boot_isolcpus ? boot_hk_cpus : cpu_possible_mask, since that housekeeping type is missing here and boot_hk_cpus is only allocated with boot isolation. ] Signed-off-by: Sasha Levin commit 77d8acae37065b8c7a00543e0caea834de9cc837 Author: Waiman Long Date: Sun Oct 25 17:44:40 2026 -0400 cgroup/cpuset: Properly compute effective xcpus in update_parent_effective_cpumask() [ Upstream commit 69a75e4f377629928bd173747b864694c2af4e1c ] Since the introduction of cpuset.cpus.exclusive in commit e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2"), a compute_effective_exclusive_cpumask() helper which is later renamed to compute_excpus() is added to compute the effective xcpus of a partition root. However update_parent_effective_cpumask() is not updated in all proper places to use the new helper to check if a given cpuset should remain a valid partition root. This can cause a cpuset to incorrectly remain a valid partition root even if no effective xcpus is left. Fix that problem by using compute_excpus() to compute the effective xcpus into delmask in all cases except partcmd_disable, partcmd_invalidate or partcmd_update with newmask set and use it for tasks_nocpu_error() check as well as checking its emptiness. This enables us to catch invalid partition root more accurately in update_parent_effective_cpumask(). In the case of partcmd_update with newmask set, the passed in new effective xcpus value will directly be used in the tasks_nocpu_error() check without relying on old data in the cpuset. For the partcmd_update with NULL newmask case, the cpu exclusivity test there is also relaxed to be performed only if exclusive_cpus is empty. Some test case are added to test_cpuset_prs.sh for invalidating a partition root due to its effective xcpus becoming empty as well as making sure that an invalid partition can only be revived when exclusive CPUs are available agin. Fixes: e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") Signed-off-by: Waiman Long Reviewed-by: Guopeng Zhang Tested-by: Guopeng Zhang Signed-off-by: Tejun Heo [ sashal: Adjusted context for the older base (kept the xcpus declaration and subparts_delta lines, no PERR_ISOPARENT blocks) and added :S+ to parent cpusets in the selftest rows. ] Signed-off-by: Sasha Levin commit 9846a8c6246183722dddb9cb665aa54130f04838 Author: Waiman Long Date: Sun Oct 25 17:44:39 2026 -0400 cgroup/cpuset: Find furthest isolated ancestor for invalidated isolated partition [ Upstream commit 0bce85ff2cc0f7f7d8de16f5fdfc0ae7d29f21f1 ] Commit 46b885416c27 ("cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier()") searches for the closet partition root ancestor to determine if the isolated CPUs in a to be invalidated isolation partition should be removed from isolated_cpus or not. As reported by sashiko, this method may not work when there is a deeply nested isolated partition hierarchy. For instance, Consider a nested hierarchy A0 -> A1 -> A2 -> A3 where all four are PRS_ISOLATED: A0: effective_xcpus = 0-4 A1: effective_xcpus = 1-4 A2: effective_xcpus = 2-4 A3: effective_xcpus = 3-4 When A1 shrinks its exclusive_cpus from 1-4 to 1-2, A2 will update it effective_xcpus to 2. A3 will find its closet partition root ancestor A2 and decides that its effective_xcpus 3-4 should be removed from isolated_cpus which is incorrect. Address this corner case by adding a new isolated_cpus_release() helper to replace the existing ancestor_partition() helper. This new helper will search for the furthest isolated partition root ancestor to decide if some or all of its isolated CPUs should be removed from isolated_cpus and also perform the removal when appropriate. The is_remote_partition() and is_local_partition() helpers are also moved up so they can be used in earlier functions. There are other pre-existing problems that will still prevent the above test case to work correctly. These problems will be addressed in subsequent patches. Fixes: 46b885416c27 ("cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier()") Signed-off-by: Waiman Long Reviewed-by: Guopeng Zhang Signed-off-by: Tejun Heo [ sashal: Replaced the upstream cs->remote_partition check in is_remote_partition() with this tree's remote_sibling list test, and adjusted context around the plain isolated_cpus_update(). ] Signed-off-by: Sasha Levin commit 8bb3738c3959959eaa20243ca90b00bd8833d001 Author: Pooyan Azad Date: Tue Sep 29 09:18:46 2026 +0200 zram: fix short reads from block_state [ Upstream commit 372012202260db088b489ed00059c4571a602552 ] read_block_state() formats each entry directly into the buffer supplied by read(). If the remaining buffer is too small for one complete record, snprintf() returns the full record length and the function stops without copying data or advancing the file position. A read from this debugfs file which is smaller than a record therefore returns zero at a non-EOF position and cannot make progress. Convert block_state to seq_file so formatted records are buffered independently of the userspace read size. Keep dev_lock held across each seq_file iteration and continue to protect individual entries with their slot locks. Link: https://lore.kernel.org/20260929071846.24829-1-pooyan.azadparvar@gmail.com Fixes: c0265342bff4 ("zram: introduce zram memory tracking") Signed-off-by: Pooyan Azad Signed-off-by: Andrew Morton Closes: https://lore.kernel.org/r/CANC3H+LdtoydSp+o2ecErAw7k6R2+gRf9LyxcaoHv_mGhJmyQQ@mail.gmail.com/ Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Jens Axboe [ sashal: Renamed this tree's older helpers and lock (init_lock, zram_slot_lock, zram_allocated, etc.) in place of upstream's, and kept the ktime_t-based timestamp formatting instead of upstream's integer ac_time print. ] Signed-off-by: Sasha Levin commit 80592f7cb3a2ff5565a9e04abec5db564073c594 Author: Ian Rogers Date: Tue Oct 20 13:58:51 2026 -0700 perf lock contention: Filter events before creating lock_stat [ Upstream commit c58d1598e79554cc8f587668ab2ebcaeb616b076 ] In report_lock_contention_begin_event(), lock_stat_findnew() was called before checking filters.nr_types (-Y), filters.nr_addrs (-L), and match_callstack_filter() (-S). When a filtered-out lock event (such as a mutex contention when running with -Y spinlock) shared the same aggregation key as a subsequent matching event (for example, contention on the mutex's internal wait_lock spinlock from the same caller), the first event created the lock_stat entry with the filtered-out lock's flags and the second event reused that entry, causing non-spinlock entries to appear in -Y spinlock output. Check the type, address, and callstack filters before looking up or creating the lock_stat entry. Fixes: b4a7eff93c39f985 ("perf lock contention: Add -Y/--type-filter option") Reviewed-by: Namhyung Kim Signed-off-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo [ sashal: Used the tree's lock_contention_caller(evsel, sample, ...) signature, with the extra evsel argument, in the moved lock_stat lookup block instead of upstream's lock_contention_caller(sample, ...). ] Signed-off-by: Sasha Levin commit 7b136cf182f0628951632facee2b181673e88dda Author: Ajanesh Lal Date: Thu Oct 22 02:24:53 2026 +1200 ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5) [ Upstream commit ed7995e4ec3789a90e37eb826bfccf43cc85d2fd ] The HP ENVY Laptop 16-h1xxx (PCI SSID 103c:8be5) uses an ALC245 codec with CS35L41 I2C speaker amplifiers. No LED fixup is applied for this subsystem ID, so the speaker mute LED and the microphone mute LED are never driven and do not follow their keys. Add a fixup that calls the existing ALC245 mute LED COEF helper and the GPIO mic-mute LED helper directly, then chains to the CS35L41 I2C amplifier setup so the speakers keep working. Use it for 103c:8be5. Tested on an HP ENVY Laptop 16-h1xxx running kernel 7.2.11: the hda::mute and hda::micmute LEDs appear and follow their keys, and the speaker amplifiers still bind (CS35L41 Bound in dmesg). The mic LED GPIO pin and polarity are not verified on other hardware. Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models") Assisted-by: Claude:claude-haiku-5-5 Signed-off-by: Ajanesh Lal Link: https://patch.msgid.link/20261021142453.177174-1-ajaneshlal3@gmail.com Signed-off-by: Takashi Iwai [ sashal: Added the new enum value and fixup table entry after the tree's last entries, since the context entries the upstream patch anchors on are missing, and left out the unneeded ALC245_FIXUP_CS35L41_I2C_2_MUTE_LED additions. ] Signed-off-by: Sasha Levin commit 767ad17d14d71f04fa676174c9274cf912cbd48e Author: Namjae Jeon Date: Sun Oct 4 09:58:56 2026 +0900 ksmbd: fix durable reconnects for root shares [ Upstream commit 25e36df831a47597c03c6239fbc71285e7d714c2 ] When a share exports "/", ksmbd_validate_name_reconnect() expects another slash after the share path. For a file at /foo, this rejects the valid reconnect name "foo" even though the file is in the share. Compare the requested name with the rendered file path after its leading slash when the resolved share root is "/". Keep the exact-root/empty-name check and reject rendered paths without an initial slash. Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2") Reported-by: Dairui Zhang Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 4fe85727c2cf5f9521194496317a56aed30a77ae Author: Namjae Jeon Date: Sun Oct 4 09:58:34 2026 +0900 ksmbd: cache the resolved share path for durable reconnects [ Upstream commit 2a90ba573d41efa82e075ba9ac532bb3ec0519c4 ] A share configured as /a/link/b, with /a/link pointing to /real, is opened relative to share->vfs_path at /real/b. However, ksmbd_validate_name_reconnect() compares the file's d_path() result against the original /a/link/b string and rejects a valid reconnect. Render share->vfs_path with d_path() after the existing kern_path() lookup and cache a copy in real_path along with its length. Use the resolved string for durable reconnect name validation. Keep path and path_sz as the configured spelling for existing consumers, including the volume serial calculation and path lookups. Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2") Reported-by: Dairui Zhang Signed-off-by: Namjae Jeon [ sashal: Dropped the scoped_with_init_fs() wrapper around the share_config_resolve_path() call and the fs_struct.h include, since this tree has neither and calls the helper directly. ] Signed-off-by: Sasha Levin commit 5ede854d6c4250279fce4cc61f87951b545f12d4 Author: Namjae Jeon Date: Wed Sep 30 07:37:38 2026 +0900 ksmbd: disconnect on invalid encryption transform flags [ Upstream commit 0882f124ae329eefb66b00e63b9043f24c006b0e ] MS-SMB2 3.3.5.2.1.1 requires the Flags/EncryptionAlgorithm field in an SMB2 transform header to be 0x0001. The server must disconnect the connection when it has any other value. smb3_decrypt_req() currently ignores this field. A client with the session key can therefore send a correctly authenticated encrypted request with invalid flags and have it processed. Check the field before looking up the session key or decrypting the request. The caller aborts the connection when this check fails. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: Namjae Jeon [ sashal: Added a transform-flags check to smb3_decrypt_req() unchanged, but anchored it after the "Transform message is too small" check because the surrounding length-check code differs on this branch. ] Signed-off-by: Sasha Levin commit 15be811958a55bb80da6edcefeab3d8918829299 Author: Chi Zhiling Date: Sat Sep 5 13:49:51 2026 +0800 exfat: take bitmap_lock at the start of exfat_alloc_cluster() [ Upstream commit 48acff2eedef7fecdfbd39be1b6f4463a9e43e3e ] exfat_alloc_cluster() checks sbi->used_clusters against the total number of data clusters before acquiring sbi->bitmap_lock. A concurrent allocation can update sbi->used_clusters after the check but before the lock is acquired, making the check stale. This can allow the allocation to proceed even though there are not enough free clusters, causing it to fail partway through. Acquire sbi->bitmap_lock before checking sbi->used_clusters so that the free-space check and subsequent cluster allocation are serialized with concurrent allocations. Fixes: f55c096f62f1 ("exfat: do not zero the extended part") Signed-off-by: Chi Zhiling Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 8dd879d08328fdf47a29700b89015a8dca53aefd Author: Chi Zhiling Date: Sat Sep 5 13:49:50 2026 +0800 exfat: fix used_clusters accounting during cluster allocation [ Upstream commit cb9dbf8a4e34b4fdf311598835ab4d76ed7e07c1 ] In the current exfat_alloc_cluster(), p_chain->size is incremented as each cluster is allocated so that the partially allocated chain can be freed by __exfat_free_cluster() on the error path. However, sbi->used_clusters is still updated only after all clusters have been allocated, while __exfat_free_cluster() unconditionally subtracts the number of freed clusters from sbi->used_clusters. Therefore, when allocation fails partway through, the partially allocated clusters are subtracted from sbi->used_clusters even though they were never added to it. This corrupts the free-space accounting and can cause sbi->used_clusters to underflow. Increment sbi->used_clusters together with p_chain->size as each cluster is allocated. This keeps the accounting consistent with __exfat_free_cluster() on both the success and error paths. This issue is caught by generic/476 with 256k cluster size: Ran: generic/476 Failures: generic/476 Failed 1 of 1 tests *** fsck.exfat output *** ERROR: : more clusters are allocated. truncate to N bytes ... /dev/vdc: corrupted. directories 331, files 526 /dev/vdc: files corrupted 9, files fixed 0 *** end fsck.exfat output *** Fixes: d5c514b6a0c0 ("exfat: fix the newly allocated clusters are not freed in error handling") Signed-off-by: Chi Zhiling Signed-off-by: Namjae Jeon [ sashal: Dropped the blank line after the removed sbi->used_clusters += num_alloc; because this tree's success block lacks the done: label and uses num_alloc instead of p_chain->size. ] Signed-off-by: Sasha Levin commit 94f69d492ed7642250110e925e9ae5fd67808ec4 Author: Eric Dumazet Date: Sat Oct 17 12:42:28 2026 +0200 ip6mr: clear skb->cb[] in reg_vif_xmit() [ Upstream commit 238164201431a425e48dfcb8e9a59de63caf175b ] reg_vif_xmit() hands the skb to ip6mr_cache_report() as an MRT6MSG_WHOLEPKT report. skb_realloc_headroom() copies skb->cb[] into the report, which is queued to the mroute socket, where rawv6_recvmsg() reads it as IP6CB. By the time the pim6reg device transmits the packet, skb->cb[] is not IP6CB anymore: qdisc_pkt_len_init() overwrites iif and ra, and any qdisc installed on the device (fq, fq_codel, pie, cake...) or a tc BPF program writing skb->cb[] fills the area holding dst0, srcrt, dst1, lastopt and flags. Since commit dd433671fef3 ("ipv6: validate extension header length before copying to cmsg") these stale offsets can no longer cause out-of-bounds reads, but the mroute socket can still receive bogus IPV6_PKTINFO ifindex and extension header ancillary data. Clear IP6CB before building the report. The skb is freed right after, so nothing else depends on its control block. Fixes: 14fb64e1f449 ("[IPV6] MROUTE: Support PIM-SM (SSM).") Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski [ sashal: Kept the branch's rcu_read_lock(); line as context and inserted the upstream memset and comment after it. ] Signed-off-by: Sasha Levin commit d20aa0909529597e07b83771a980e070d767c945 Author: James Hilliard Date: Wed Oct 14 12:33:48 2026 -0600 xsk: freeze deferred pool teardown without blocking unregister [ Upstream commit fece8420e76fe53ee84f0439f18d026b4c7641da ] Deferred pool destruction calls ndo_bpf() under RTNL. system_wq is not frozen during system sleep, so that callback can run after a device has suspended and gated its clocks. Use system_freezable_wq so running destruction finishes before device suspend and new work waits until process thaw. Keep assigned pools visible to NETDEV_UNREGISTER independently of the socket list. A released socket has already left that list, but its final pool put can queue destruction after workqueues freeze. A resume-time unregister would then wait for a device reference whose release cannot run until the resume completes. Track assigned pools per netdev with netdev operations locking and detach remaining pools after the notifier socket walk, including copy-mode pools. This also covers leased queues without scanning pools from unrelated devices or network namespaces. Remove the entry on assignment failure and normal teardown. The deferred worker still owns the pool and later observes the cleared device pointer, avoiding a second driver detach or put. The lifetime problem was identified by code inspection of the deferred release and system-sleep paths. Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem") Signed-off-by: James Hilliard Reviewed-by: Björn Töpel Reviewed-by: Jason Xing Acked-by: Stanislav Fomichev Link: https://patch.msgid.link/20261014-xsk-suspend-teardown-v4-1-27795582e4a3@gmail.com Signed-off-by: Paolo Abeni [ sashal: Replaced the missing netdev_assert_locked_ops_compat() with this tree's equivalent netdev_ops_assert_locked(), and dropped the old assertion before ndo_bpf() so it isn't duplicated. ] Signed-off-by: Sasha Levin commit c0c910987bef7c332cc7ee2004605e390122b802 Author: Serhat Kumral Date: Sun Oct 18 17:49:07 2026 +0300 RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler [ Upstream commit bb75e5580b15cd23ededf15683a5ad67d7b61aab ] In MLX5_IB_METHOD_STEERING_ANCHOR_CREATE, the user-supplied u16 priority is passed directly to _get_flow_table() without an upper bound check. This can lead to out-of-bounds array accesses on dev->flow_db priority tables. Check that priority does not exceed MLX5_IB_FLOW_LAST_PRIO before calling _get_flow_table(), matching the existing validation in raw_fs_rule_add() and mlx5_ib_create_flow(). Fixes: 0c6ab0ca9a66 ("RDMA/mlx5: Expose steering anchor to userspace") Signed-off-by: Serhat Kumral Link: https://patch.msgid.link/20261018144907.20123-1-serhatkumral1@gmail.com Signed-off-by: Leon Romanovsky [ sashal: Kept the branch's kzalloc(sizeof(*obj), GFP_KERNEL) as context instead of upstream's kzalloc_obj(*obj), with the same 3-line priority bounds check added before it. ] Signed-off-by: Sasha Levin commit 52e75bbfc1942e275b71eb7402acdfbb65ece5c1 Author: Waiman Long Date: Mon Oct 19 14:10:16 2026 -0400 cgroup/cpuset: Properly disabling partition when partition state switching fails [ Upstream commit db27a748a399e24af715c54c12a7e928e32d15b0 ] Before commit 103b08709e8a ("cgroup/cpuset: Fail if isolated and nohz_full don't leave any housekeeping"), the partition state can be freely switched from "root" to "isolated" and vice versa. After that commit, the switch from "root" to "isolated" can fail if it exhausts all the housekeeping CPUs. Later on, the switch from "isolated" to "root" can also fail if some of the partition CPUs are boot-time isolated by "isolcpus". A local or remote partition is made invalid when the switch fails. However there are 2 problems with the existing invalidation code. 1) Both the subpartitions_cpus and isolated_cpus are not properly updated. 2) In the case of remote partition with remote_partition flag set, it is not cleared. Fix this by calling the proper partition disabling function in this case. On an x86 test system with boot option "isolcpus=10 cgroup_debug" set and more than 16 cores, the following commands were executed after boot. # cd /sys/fs/cgroup # echo +cpuset > cgroup.subtree_control # cat cpuset.cpus.isolated 10 # mkdir A # echo 10-12 > A/cpuset.cpus # echo isolated > A/cpuset.cpus.partition # cat A/cpuset.cpus.partition isolated Before the patch: # echo root > A/cpuset.cpus.partition # cat A/cpuset.cpus.partition root invalid (partition config conflicts with housekeeping setup) # cat cpuset.cpus.isolated .__DEBUG__.cpuset.cpus.subpartitions 10-12 10-12 After the patch: # echo root > A/cpuset.cpus.partition # cat A/cpuset.cpus.partition root invalid (partition config conflicts with housekeeping setup) # cat cpuset.cpus.isolated .__DEBUG__.cpuset.cpus.subpartitions 10 Reported-by: Tejun Heo Link: https://lore.kernel.org/lkml/7f4c57b26ad120ab30adf35653f1dd94@kernel.org/ Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup") Fixes: 103b08709e8a ("cgroup/cpuset: Fail if isolated and nohz_full don't leave any housekeeping") Reviewed-by: Guopeng Zhang Signed-off-by: Waiman Long Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit ac1d3a930f8e6cb58f0bb9dba3da19560e022869 Author: Waiman Long Date: Mon Oct 19 14:10:15 2026 -0400 cgroup/cpuset: Do housekeeping check before converting invalid partition to valid [ Upstream commit 2c0a5742fc459cd8416607acff4a38a1abcb2e1b ] When a hotplug event happens or when update_cpumasks_hier() is called, an invalid partition may be converted back to valid. However check against housekeeping conflict isn't being done which can lead to a partition state that violates the housekeeping rules. Update the code to allow reviving an invalid partition only if it can pass the housekeeping check. Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup") Reviewed-by: Guopeng Zhang Signed-off-by: Waiman Long Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 3674883f70fa48d7549ee3e7d2f0aa870c92a9b8 Author: Waiman Long Date: Mon Oct 19 14:10:14 2026 -0400 cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check [ Upstream commit 9527ff78a413e2b4089e78953926af77b98fd43f ] When prstate_housekeeping_conflict() is called to perform housekeeping check with cpumask changes, the cpumask changes are passed in via add_cpus and del_cpus parameters. With this arrangement, the exclusive CPUs owned by the child partitions and not affected by the cpumask change, if any, are excluded in the analysis. The only places where there are separate add and delete masks are when the cpuset.cpus or cpuset.cpus.exclusive is being changed. In both cases, partition_cpus_change() is a good place to perform the housekeeping check. If we allow a root partition to be created under an isolated partition, it is possible the cpumask change will still leave active housekeeping CPUs but then no housekeeping CPUs will be left when the child partitions are disabled or invalidated. As a first step to protect against this possibility, all the exclusive CPUs of the cpuset should be considered to be owned by the current cpuset when doing housekeeping check. At the same time, we do want to know if some housekeeping CPUs are going to be removed from the isolated partition that there will be no danger of losing all the active housekeeping CPUs. So the current add_cpus paremeter is renamed as new_cpus to indicate that it includes the complete set of effective xcpus. With the new check in partition_cpus_change(), the housekeeping check in update_parent_effective_cpumask() with partcmd_update and newmask is now duplicative and can be removed. The housekeeping check in remote_cpus_update(), however, will still be useful as this function can be called directly from update_cpumasks_hier() without going through partition_cpus_change(). The update_parent_effective_cpumask() call from update_cpumasks_hier() is partcmd_update with no cpumask which still have the housekeeping check and so is covered. Fixes: 103b08709e8a ("cgroup/cpuset: Fail if isolated and nohz_full don't leave any housekeeping") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo [ sashal: Replaced the upstream HK_TYPE_DOMAIN_BOOT housekeeping checks with this tree's have_boot_isolcpus and boot_hk_cpus, keeping the add_cpus to new_cpus rename. ] Signed-off-by: Sasha Levin commit 92d57f975b3a01a73a7d37e4b425a0712277029b Author: Waiman Long Date: Mon Oct 19 14:10:13 2026 -0400 cgroup/cpuset: Consolidate isolated_cpus_can_update() into prstate_housekeeping_conflict() [ Upstream commit 53bbfb33b1f4fd669c5bffcb7670c4099ecbb225 ] The isolated_cpus_can_update() and prstate_housekeeping_conflict() are checking different aspects of upcoming cpumask changes that may conflict with the current setting of the housekeeping cpumasks. There are places where both are called together. There are also places where only one of them is called. That inconsistency can contribute to missing check where invalid cpumask changes may be allowed to move forward. Fix that by consolidating isolated_cpus_can_update() into prstate_housekeeping_conflict() and call prstate_housekeeping_conflict() in all the places where either one of them or both are called. The exception is the validate_partition() function where the prstate_housekeeping_conflict() call is removed. It is because validate_partition() is called only from partition_cpus_change() where prstate_housekeeping_conflict() will be called from either remote_cpus_update() or update_parent_effective_cpumask() with partcmd_update if not for partition invalidatation or disablement. Now prstate_housekeeping_conflict() will be called in the following locations: - when a partition is enabled in remote_partition_enable() or in update_parent_effective_cpumask() with partcmd_enable*. - when a cpumask is updated in remote_cpus_update() or in update_parent_effective_cpumask() with partcmd_update. - when a partition state changes from root to isolated or vice versa in update_prstate(). Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup") Fixes: 103b08709e8a ("cgroup/cpuset: Fail if isolated and nohz_full don't leave any housekeeping") Reviewed-by: Guopeng Zhang Signed-off-by: Waiman Long Signed-off-by: Tejun Heo [ sashal: Replaced this tree's boot-isolcpus variables (have_boot_isolcpus, boot_hk_cpus) for the missing HK_TYPE_DOMAIN_BOOT housekeeping checks, with context adjusted for earlier backports. ] Signed-off-by: Sasha Levin commit dcdb224f6d355d5766e9a40e4061b824e532b910 Author: Waiman Long Date: Mon Oct 19 14:10:12 2026 -0400 cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier() [ Upstream commit 46b885416c27214072272b85adb898ed91801062 ] It is found that when a local isolated partition is being invalidated because its parent partition is no longer valid, the isolated_cpus cpumask may not be properly updated. Those isolated CPUs may or may not needed to be removed from isolated_cpus depending on if there is a local isolated partition ancestor that will now own those isolated CPUs instead. Fix that by calling a new ancestor_partition() helper to return the closeset valid partition root ancestor. If that ancestor is PRS_ROOT, the isolated CPUs will have to be removed from isolated_cpus. For a PRS_ISOLATED ancestor, the isolated CPUs are checked against the ancestor's ones to see if any of them should be removed as it is possible that the invalidation of the parent may be caused by change in the effective xcpus of that ancestor. If any of the isolated CPUs should be removed, isolated_cpus_update() will be called under callback_lock. An existing test case in test_cpuset_prs.sh is modifed and a new one added to test that. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo [ sashal: Selftest TEST_MATRIX rows were adapted to the older format with explicit ":S+" markers on non-leaf cpusets, while the cpuset.c changes match upstream. ] Signed-off-by: Sasha Levin commit c7e3a385cef3ea56f07dbc05beef25b09e822336 Author: Lorenzo Bianconi Date: Mon Oct 19 11:54:03 2026 +0200 netfilter: flowtable: reset transport header after nf_flow_encap_pop() [ Upstream commit 08f7882637f2db5b98f521498eeaf94770383a6e ] nf_flow_encap_pop() pulls vlan/pppoe or ip tunnel headers and resets the network header, but leaves the transport header pointing into the removed outer header. Reset the transport header to the inner L4 header, otherwise later consumers (e.g. GSO segmentation) parse a bogus header. Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Pablo Neira Ayuso [ sashal: adjusted nf_flow_encap_pop() call context to the older two-argument form (skb, tuplehash) in the IPv6 hunk, since this tree's helper lacks the ctx parameter. ] Signed-off-by: Sasha Levin commit 7e3a5e1e3d57034d11e7aba5146daf3e8d460864 Author: Woojin Ji Date: Sun Oct 18 13:21:41 2026 +0900 bpf: Zero-extend the index in inlined bpf_get_func_arg() [ Upstream commit 1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5 ] bpf_get_func_arg() takes a u32 index, but the inlined expansion compared only the low 32 bits of R2 with the argument count and then shifted the full 64-bit register to compute the context address. R2 is ARG_ANYTHING, so nothing guarantees that its upper bits are zero: an index of 1ULL << 32 passes the bounds check as index zero while the load is performed at ctx + (1ULL << 35). Shift the index as a 32-bit value. When the 32-bit bounds check passes, the low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline arm masks the argument count with 0xFF and the raw_tp arm uses the BTF argument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS. The 3-bit shift therefore cannot overflow and it clears the upper bits of the register. Widening the comparison instead would reject indices whose low 32 bits are valid. The check itself is unchanged, so this cannot change which programs are accepted, only the address that is computed. Fixes: f92c1e183604 ("bpf: Add get_func_[arg|ret|arg_cnt] helpers") Signed-off-by: Woojin Ji Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261018-get-func-arg-v2-1-048848b3eddf@gmail.com [ sashal: Replaced a 64-bit shift with a 32-bit one in the inlined bpf_get_func_arg() code in verifier.c, since the fixups code isn't split into its own file here. ] Signed-off-by: Sasha Levin commit fbd565d1df8802ae5273824472ed163899d20e60 Author: Sasha Levin Date: Sun Oct 18 09:29:07 2026 -0400 locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local() [ Upstream commit 8cebaa3be829c88a59957900f8de98fed09daefe ] Commit ccb88db8dac8 ("bpf: Don't hand out a linked element as extra element") made alloc_htab_elem() take the per-cpu spare element with try_cmpxchg_local(), the first caller of cmpxchg_local() outside of architecture code. It doesn't build on arc, hexagon and openrisc: include/linux/atomic/atomic-arch-fallback.h:384:27: error: implicit declaration of function 'arch_cmpxchg_local'; did you mean 'raw_cmpxchg_local'? [-Werror=implicit-function-declaration] raw_cmpxchg_local() maps to arch_cmpxchg_local() unconditionally, but these three architectures don't define it, and unlike nios2 and microblaze they don't get it from asm-generic/cmpxchg.h either. cmpxchg_local() only has to be atomic with respect to the local CPU, so an architecture's own arch_cmpxchg() can serve for the sizes it supports. arc uses its relaxed LLOCK/SCOND variant when ARC_HAS_LLSC is set and its atomic_ops_lock() variant otherwise, and openrisc uses its LL/SC arch_cmpxchg(), the way arm64, riscv and s390 alias theirs. The hexagon arch_cmpxchg() only handles 32-bit words, so hexagon uses the generic version that disables interrupts, like sh, sparc32 and xtensa do. Linux has no NMIs on hexagon, so that is sufficient there. Fixes: ccb88db8dac8 ("bpf: Don't hand out a linked element as extra element") Reported-by: kernelci.org bot Reported-by: kernel test robot Signed-off-by: Sasha Levin Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261018132907.3823160-1-sashal@kernel.org Closes: https://d.kernelci.org/i/maestro:78b65519ee4561df1fbf1e72f1dec9da7e5b153e Closes: https://lore.kernel.org/oe-kbuild-all/202610181750.BoqAddaF-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202610182048.aEaiBP8W-lkp@intel.com/ Signed-off-by: Sasha Levin commit e09c38abd0f8e1e1738544f2a572558cf6d511e1 Author: Josef Bacik Date: Sat Oct 17 23:09:44 2026 +0000 bpf: Don't take a dynptr argument for a local dynptr [ Upstream commit b7f97db88948aa511bcd989978f181e1367e0e8b ] A global function is verified on its own. A dynptr which it gets as an argument is assumed to be of type BPF_DYNPTR_TYPE_LOCAL, but the callers may pass one of any type, that of an skb for example. The type decides whether a write through the dynptr invalidates packet pointers, and whether a slice of it is invalidated together with them. Inside of the function neither happens. It can take a packet pointer from its context argument, or a slice from the dynptr, write through the dynptr and go on using the pointer, although the write may have reallocated the head of the skb. Assume the type of an skb dynptr instead. Nothing becomes forbidden for the dynptr itself, and a clone inherits the caution. The dynptr which the callback of bpf_user_ringbuf_drain() gets is known to be local, and stays so. Fixes: a64bfe618665 ("bpf: add support for passing dynptr pointer to global subprog") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017230950.802052-11-alexei.starovoitov@gmail.com [ sashal: Kept this branch's ARG_PTR_TO_DYNPTR | MEM_RDONLY condition and dropped the extra 0 argument to the four-argument __mark_dynptr_reg(), changing the type to BPF_DYNPTR_TYPE_SKB. ] Signed-off-by: Sasha Levin commit 30c3198b5751f53a867ee34e25beb1522e78f142 Author: Josef Bacik Date: Sat Oct 17 23:09:43 2026 +0000 bpf: Let bpf_dynptr_write() mark a global function [ Upstream commit 589998616e0f9190ba6f6644a19532c5b2ba66d0 ] The caller of a global function loses its packet pointers if the function may change packet data. That is found out by a scan for calls of the helpers which bpf_helper_changes_pkt_data() lists. bpf_dynptr_write() is not on the list, because it depends on the type of the dynptr: check_helper_call() looks at it. The scan cannot do that, and so a global function which makes a dynptr from the skb, or gets one as an argument, and writes through it counts as harmless. The write can reallocate the head of the skb, and the caller goes on with pointers into the old one, which has been freed. Let every call of bpf_dynptr_write() mark the function, as a tail call does. The same mark decides whether a program may replace a function. Fixes: 51081a3f25c7 ("bpf: track changes_pkt_data property for global functions") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017230950.802052-10-alexei.starovoitov@gmail.com [ sashal: Applied the same change in kernel/bpf/verifier.c instead of kernel/bpf/cfg.c, which doesn't exist here, with one differing context line (struct bpf_kfunc_call_arg_meta meta;). ] Signed-off-by: Sasha Levin commit e4bee26f640d6d150f2f9dc2da6f952b897e57de Author: Josef Bacik Date: Sat Oct 17 16:37:32 2026 +0000 bpf: Free what map_free() unlinks for sleepable readers [ Upstream commit 5bdd61e98da5468140aff5b5abc0e8544deaf2ee ] bpf_local_storage_map_free() takes the elements of the map off the lists of their owners, which are alive, and frees them, and the storage of an owner with its last element, behind a plain RCU grace period. Nobody uses the map any more, but the other maps of these owners are in use. A sleepable program calls the get and delete helpers under rcu_read_lock_trace() only. While it walks the list of an owner for its own map, or is about to lock the storage, the element it stands on, or the storage, can be freed under it. Whatever else takes an element off the list of a live owner frees it behind an RCU Tasks Trace grace period, which implies a plain one. Do so in bpf_local_storage_map_free() as well. It waits for these callbacks before it frees the map. This does not help a sleepable program that hands an owner to the helpers which nobody holds, and which may be gone by then. Fixes: dcf456c9a095 ("bpf: Fix usage of trace RCU in local storage.") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-31-alexei.starovoitov@gmail.com [ sashal: Replaced the upstream change in the missing bpf_selem_unlink_nofail() with flipping bpf_selem_unlink(selem, true) to false in bpf_local_storage_map_free(). ] Signed-off-by: Sasha Levin commit f1863768d15944d3856d539c0c4044c94555150f Author: Josef Bacik Date: Sat Oct 17 16:37:29 2026 +0000 bpf: Assume no bounds for a writable tp with tail calls [ Upstream commit cd0490e671d70326d70c7d36e82388939fd9b071 ] A writable raw tracepoint hands a buffer to the program. The verifier notes how far the program reaches into it, and bpf_probe_register() refuses a program that reaches further than the tracepoint allows. A program that does not touch the buffer passes, and can tail-call one of its type that reads and writes behind it. Take a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE program with a tail call to reach as far as can be, as for the stack, the packet and the buffers of iterators. It cannot be attached any more. Plain raw tracepoint programs, for which the limit is zero, cannot get at the buffer, and a tail call stays within one type: they are left alone. Fixes: 9df1c28bb752 ("bpf: add writable context for raw tracepoints") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-28-alexei.starovoitov@gmail.com [ sashal: Moved the added max_tp_access = U32_MAX lines into do_misc_fixups() in verifier.c, since this tree still has the fixups code there and not in a separate file. ] Signed-off-by: Sasha Levin commit d27a5bdee454ebab3eda81ac1670d828d9bb5857 Author: Josef Bacik Date: Sat Oct 17 16:37:27 2026 +0000 bpf: Assume no bounds for buffers behind a tail call [ Upstream commit 7fa323d77688e8b62b2f0bf6c3208a2c96d4a5e7 ] The bpf_map_elem, bpf_sk_storage_map and sockmap iterators hand the key and the value of an element to the program as buffers. The verifier notes how far a program reaches into them, and the iterator compares that with the map when the program is attached. A program that does not touch the buffers passes. It can tail-call another program of the same target, which gets the same context, and whose reach nobody compares with the map: BUG: KASAN: slab-out-of-bounds in ___bpf_prog_run+0xa46a/0xae80 The program array can be filled at any time, so there is nothing to look at when the link is made. For the same reason a program with a tail call is taken to use the whole stack and the whole packet. Take it to reach as far as can be into the buffers as well, so that these iterators refuse it with -EACCES. Fixes: d6c4503cc296 ("bpf: Implement bpf iterator for hash maps") Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map") Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-26-alexei.starovoitov@gmail.com [ sashal: Moved the added max_rdonly_access = U32_MAX line into do_misc_fixups() in verifier.c, since this tree still has the fixups code there and not in a separate file. ] Signed-off-by: Sasha Levin commit 29c908a15d033256d9434cce335db4f8f6719d7f Author: Josef Bacik Date: Sat Oct 17 16:37:25 2026 +0000 bpf: Count sleepable callbacks as sleepable map users [ Upstream commit 927c9c985f3ef4d30c086884b7e0ecb933f742ef ] map->sleepable_refcnt tells bpf_map_fd_put_ptr() whether an inner map that is taken out of its outer map has to wait for an RCU Tasks Trace grace period as well. It counts the sleepable programs that use the outer map. The bpf_wq or bpf_task_work callback of a program that is not sleepable runs under rcu_read_lock_trace() only, and is not counted. Such a callback can look an inner map up and keep it while user space deletes it from the outer map. The inner map is freed behind a plain RCU grace period, under the callback: BUG: KASAN: slab-use-after-free in array_map_update_elem+0x6bc/0x7d0 Count a program with such a callback. The maps are bound before the verifier meets the callback, so raise the count of those that are bound when it does. Fixes: 8e83da9732d9 ("bpf: add bpf_wq_start") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-24-alexei.starovoitov@gmail.com [ sashal: Kept the local static bool is_may_goto_insn() name in the context line instead of upstream's bpf_is_may_goto_insn(), with the new helper inserted above it. ] Signed-off-by: Sasha Levin commit 20a0245bc0b28cdf471be673015bd7192eb41244 Author: Josef Bacik Date: Sat Oct 17 16:37:24 2026 +0000 bpf: Keep a program until its bpf_wq callback has ended [ Upstream commit 1e28a5e52d32b7d3f4c9fb24898774f941166d2b ] bpf_wq_work() runs the callback under rcu_read_lock_trace() only, since the callback may sleep. The program it belongs to need not be sleepable, and such a program is freed behind a plain RCU grace period. The reference that the bpf_wq holds is dropped when the map element goes, or when another callback is set, no matter whether the work is running. If that was the last reference the program is freed under the running callback, and the worker goes on in the freed JIT image: Oops: int3: 0000 [#1] SMP NOPTI RIP: 0010:0xffffffffc0600947 All it takes is to close the map and the program while the callback runs. Note in the program that it has a callback that runs sleepable, and wait for an RCU Tasks Trace grace period, which implies a plain one, before such a program is freed. Let bpf_wq_work() enter its read side critical section before it reads callback_fn. bpf_task_work holds a reference to the program until the callback is done. Fixes: 8e83da9732d9 ("bpf: add bpf_wq_start") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-23-alexei.starovoitov@gmail.com [ sashal: Dropped the nonexistent tramp_linked context line and the __bpf_prog_put_rcu_tasks() hunk, and used bpf_prog_runs_sleepable() in the simpler if/else of __bpf_prog_put_noref(). ] Signed-off-by: Sasha Levin commit 00ea598142f5bdf6c4f3da2f8e66cbbd2ec2c60d Author: Josef Bacik Date: Sat Oct 17 16:37:06 2026 +0000 bpf: Don't hand out a linked element as extra element [ Upstream commit ccb88db8dac8fabde58656d5d4a33711e89c480a ] When htab_map_update_elem() replaces an element of a preallocated map, alloc_htab_elem() takes the spare element of this cpu and puts the old element into the per-cpu slot right away, long before the old element is unlinked from its bucket. The bucket lock disables interrupts, but it does not keep out an NMI, or a tracing program on the return of alloc_htab_elem(). bpf_prog_active only helps if both programs are kprobe, tracepoint or perf_event programs. A program that updates an existing key in another bucket of the same map gets to use the slot: htab_map_update_elem(k1) tc, xdp, fentry, raw_tp, ... alloc_htab_elem() l_new = *pl_new *pl_new = l_old still linked in bucket 1 htab_map_update_elem(k2) perf_event program l_new = *pl_new the l_old of the outer update hlist_nulls_add_head_rcu(l_new, bucket 2) hlist_nulls_del_rcu(k2's old element) hlist_nulls_add_head_rcu(l_new, bucket 1) hlist_nulls_del_rcu(l_old) If l_old was the first element of bucket 1, the outer add points its pprev at l_new, and the delete takes it out of bucket 1 only. l_new->next now leads into bucket 2, where l_old stays with a poisoned pprev, on which a delete of k2 crashes. If it was not the first, the delete takes it out of bucket 2: k2 is gone from the map, and the chain of bucket 1 still contains l_old, whose next pointer leads into bucket 2. Either way a walk of bucket 1 ends on the nulls value of bucket 2. lookup_nulls_elem_raw() restarts whenever that happens, so every lookup in bucket 1 which does not find its key spins forever: rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: __htab_map_lookup_elem+0x354/0x4d0 BUG: KASAN: wild-memory-access in htab_map_delete_elem+0x30c/0x670 Write of size 8 at addr dead000000000122 by task extra/102 An NMI between the load and the store of the slot makes both updates use the same element, with much the same result. Empty the slot when the spare element is taken, in a way that is atomic on this cpu, and put the old element in only after it has been unlinked and its timers and the like have been cancelled. A nested update that finds the slot empty, which is the case that corrupted the map, fails with -EBUSY. Fixes: 8c290e60fa2a ("bpf: fix hashmap extra_elems logic") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-5-alexei.starovoitov@gmail.com [ sashal: Replaced check_and_cancel_fields() with the older check_and_free_fields() helper in htab_map_update_elem(), since the cancel helper does not exist here. ] Signed-off-by: Sasha Levin commit 101f1998aebe7ccc1185216759e13514b6462d9a Author: Ivan Vecera Date: Sun Oct 11 08:12:10 2026 +0200 dpll: zl3073x: make embedded sync follow the output carrier frequency [ Upstream commit bf6f105f2cb6477e36a9312477d0aa32a43aa13d ] The eSync period and width are relative to the output carrier, but changing the output frequency did not update them, so eSync ran at a wrong frequency and duty cycle. For a 1 Hz carrier esync_get() returns -EOPNOTSUPP, so eSync left enabled could not be disabled. Factor out zl3073x_out_esync_{is_enabled,enable,disable}() helpers and use them in frequency_set() to recompute the eSync period and width for the new carrier, or to disable eSync for a 1 Hz carrier. Also compute the reported pulse width in 64 bits, as 50 * esync_n_width overflows u32 for low carrier frequencies. Hit during development, confirmed on an oscilloscope. Fixes: ce26d7ca50a5 ("dpll: zl3073x: Add support to get/set frequency on pins") Fixes: 634ca2cb06d2 ("dpll: zl3073x: Add support to get/set esync on pins") Reviewed-by: Petr Oros Signed-off-by: Ivan Vecera Link: https://patch.msgid.link/20261011061211.448373-5-ivecera@redhat.com Signed-off-by: Jakub Kicinski [ sashal: adapted new eSync helpers in out.h to open-code clock type get/set with FIELD_GET/FIELD_PREP, and rebased esync_get/esync_set onto the older open-coded form, since the clock type accessors are missing. ] Signed-off-by: Sasha Levin commit 158ae6ffd3ae516d6d526d1e4ba4d9d24db8ac07 Author: Ju Nan Date: Thu Oct 15 00:09:17 2026 +0800 pinctrl: stm32: Fix the unit of the hwspinlock timeout [ Upstream commit 544b3f8042dd7c18baa48dcb1a393ff8b6742322 ] HWSPNLCK_TIMEOUT is passed to hwspin_lock_timeout_in_atomic(), whose timeout argument is in milliseconds, not microseconds: atomic_delay += HWSPINLOCK_RETRY_DELAY_US; if (atomic_delay > to * 1000) return -ETIMEDOUT; The hwspinlock core documents this explicitly: If the mode is HWLOCK_IN_ATOMIC (called from an atomic context) the timeout is handled with busy-waiting delays, hence shall not exceed few msecs. Fixes: 290a9f937e5a ("pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API") Signed-off-by: Ju Nan Signed-off-by: Linus Walleij [ sashal: Dropped the two hunks touching the skipped I/O-sync and skew-delay functions (absent here), so only the HWSPNLCK_TIMEOUT_MS rename and the five existing callers apply. ] Signed-off-by: Sasha Levin commit e0746acaf920d6d49f8a9cee5d16bbe38a749591 Author: Pengpeng Hou Date: Sun Sep 20 11:42:36 2026 +0800 irqchip/mst-intc: Validate the DT interrupt range [ Upstream commit 16f25d326e5d3b9fd51bc5e3916ecbffbca63e7b ] The driver takes an inclusive interrupt range from the device tree without checking its endpoints. A reversed range wraps the unsigned count calculation, and a range larger than MST_INTC_MAX_IRQS exceeds the controller capacity used by the driver. Reject these ranges before calculating nr_irqs or creating the domain. Check the difference after ordering the endpoints so the validation itself cannot wrap. The issue was found by our static-analysis tool. Fixes: ad4c938c92af ("irqchip/irq-mst: Add MStar interrupt controller support") Signed-off-by: Pengpeng Hou Signed-off-by: Thomas Gleixner Assisted-by: gpt 5 Reviewed-by: Radu Rendec Link: https://patch.msgid.link/20260920034236.16229-1-hppiscas@163.com [ sashal: Context adjusted: the upstream range check is inserted above this tree's older kzalloc(sizeof(*cd), GFP_KERNEL) call instead of kzalloc_obj(*cd). ] Signed-off-by: Sasha Levin commit 3fa45f375372dd6b4b334d158583ab2f50fada7b Author: Kevin Dewald Date: Mon Nov 23 00:13:59 2026 -0500 Bluetooth: hci_event: Fix LE link drop on remote features command status [ Upstream commit 91638f53ff2b8234195ff27ec913e068269a28e9 ] When the local controller supports peripheral-initiated features exchange, the LE Read Remote Features procedure also runs for incoming connections, and it fails with Unsupported Remote Feature (0x1a) if the central does not support that feature. hci_le_remote_feat_complete_evt() and hci_le_read_all_remote_features_evt() handle this and let the connection transition into connected state. A controller can also return that error in the Command Status event instead. An Intel controller does so for a central that does not support peripheral-initiated features exchange, presumably because it already has the features of the central. hci_cs_le_read_remote_features() and hci_cs_le_read_all_remote_features() then confirm the connection as failed while it is still in BT_CONFIG, and the hci_conn_drop() in le_read_features_complete() disconnects it right away: > HCI Event: LE Meta Event (0x3e) plen 31 LE Enhanced Connection Complete (0x0a) Status: Success (0x00) Role: Peripheral (0x01) < HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 > HCI Event: Command Status (0x0f) plen 4 LE Read Remote Used Features (0x08|0x0016) ncmd 1 Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a) < HCI Command: Disconnect (0x01|0x0006) plen 3 Reason: Remote User Terminated Connection (0x13) Data the central sends afterwards is reported as: Bluetooth: hci0: ACL packet for unknown connection handle 3585 Handle Unsupported Remote Feature in the command status the same way as in the complete events. Fixes: 0fe29fd1cd77 ("Bluetooth: Read LE remote features during connection establishment") Fixes: a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set") Assisted-by: Claude:claude-opus-5.5 Signed-off-by: Kevin Dewald Signed-off-by: Luiz Augusto von Dentz [ sashal: Dropped the hunk for hci_cs_le_read_all_remote_features() (function absent here) and placed the fix inside the nested if (conn) { if (conn->state == BT_CONFIG) } form of hci_cs_le_read_remote_features(). ] Signed-off-by: Sasha Levin commit 60df0cc136d4550af18fec3b291c4f40b63d255c Author: Ravindra Date: Mon Sep 28 22:40:01 2026 +0530 Bluetooth: btintel_pcie: fix PM flow for S0ix, S3 and S4 [ Upstream commit 2926eb396711f1f843a0aafee6778822f50e9021 ] Fix two issues in the PM suspend/resume path: 1. S3 was handled the same as S0ix, keeping the controller on the D3hot-style path. That caused resume instability because S3 can remove power from the controller, unlike s2idle/S0ix. Use pm_suspend_target_state to distinguish them: D3_HOT for S0ix and D3_COLD for S3/S4. Add .restore to force FLR-based firmware recovery after S4 and S3 (PM_SUSPEND_MEM), as power is lost. S0ix resumes via a normal D0 transition. 2. During hibernation, .freeze() puts the controller into the D3cold state without any loss of power, and the flow normally continues to .poweroff(). If hibernation instead fails, .thaw() is called to bring the controller back up, and the old code routed it through btintel_pcie_resume(), which forced FLR-based firmware recovery whenever data->pm_sx_event was PM_EVENT_FREEZE. That check was incorrect: since the controller's power was never actually removed on this failed-hibernation path, FLR-based recovery is unnecessary. Remove pm_sx_event and route .thaw through a normal D0 transition instead; FLR-based recovery is retained only in .restore, where genuine S4 power loss requires it. Tested with: S0ix: sudo sh -c 'echo "+40" > /sys/class/rtc/rtc0/wakealarm' && \ echo freeze | sudo tee /sys/power/state S3: sudo rtcwake -m mem -s 60 S4: sudo rtcwake -m disk -s 60 Fixes: e57362f4911b ("Bluetooth: btintel_pcie: Add support for _suspend() / _resume()") Assisted-by: GitHub-Copilot:GPT5 Signed-off-by: Ravindra Tested-by: Sergey Lebedev Reviewed-by: Paul Menzel Signed-off-by: Luiz Augusto von Dentz [ sashal: Replaced the btintel_pcie_request_reset(data, FLR) call with btintel_pcie_reset() and kept the gp0_received = false resets, because the set_dxstate retry rework is missing here. ] Signed-off-by: Sasha Levin commit 80e69239e07016b253d70a14b2ce711c6ea2885f Author: Chandrashekar Devegowda Date: Fri Sep 4 05:59:36 2026 +0530 Bluetooth: btintel_pcie: remove duplicate BTINTEL_PCIE_MAGIC_NUM definition [ Upstream commit 937363063afde2dce1f45d8f22514db99b9eba6b ] Two identical definitions of BTINTEL_PCIE_MAGIC_NUM were present in btintel_pcie.c, one indented with spaces and one with a tab. Remove the space-indented duplicate and the surrounding blank lines. Kernel coding style requires tabs for indentation, so keep the tab-indented copy. No functional change. Assisted-by: Copilot:claude-opus-4.7 sparse Fixes: 6ed83047389c ("Bluetooth: btintel_pcie: Setup buffers for firmware traces") Signed-off-by: Chandrashekar Devegowda Signed-off-by: Luiz Augusto von Dentz [ sashal: Removed the duplicate space-indented BTINTEL_PCIE_MAGIC_NUM define and one blank line, since the two defines are not adjacent in this tree and the context differed. ] Signed-off-by: Sasha Levin commit 7cbb88f601c26aa5391ee4989c6595961f731559 Author: Selvin Xavier Date: Tue Oct 13 07:04:27 2026 -0700 RDMA/bnxt_re: Unpublish QP table before freeing it [ Upstream commit 978361dd2ccff357d4fe6aac6ce057d1bfae8312 ] bnxt_re_dev_uninit() frees the QP table before the RCFW channel is disabled, so the CREQ tasklet can still look up rcfw->qp_tbl while it is being freed. Clear rcfw->qp_tbl under tbl_lock before freeing it, and have the QP error notification handler bail out if the table is gone. Fixes: 82f1f575aa13 ("RDMA/bnxt_re: Fix allocation of QP table") Signed-off-by: Selvin Xavier Link: https://patch.msgid.link/20261013140427.256612-3-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin commit fb126666cf5a526326371abdba480afa693f4a1d Author: Abhishek Mohapatra Date: Tue Oct 13 07:04:26 2026 -0700 RDMA/bnxt_re: Use kvzalloc for QP table allocation [ Upstream commit 724a39b36af94787d32094da87729f24a28888b7 ] The QP table size depends on the firmware reported max_qp, so it can be large and a physically contiguous kzalloc may fail. Use kvzalloc_objs() and free it with kvfree(). Fixes: 82f1f575aa13 ("RDMA/bnxt_re: Fix allocation of QP table") Signed-off-by: Abhishek Mohapatra Signed-off-by: Selvin Xavier Link: https://patch.msgid.link/20261013140427.256612-2-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky [ sashal: Replaced kzalloc_objs() with kvcalloc() for the QP table allocation, since the older kcalloc() form is what this branch had and kvzalloc_objs() doesn't exist here. ] Signed-off-by: Sasha Levin commit 662c7cbf5b5b39e2d4eac27811a2e6b45579662b Author: Vikas Gupta Date: Tue Oct 6 19:49:28 2026 +0530 bnge: skip dev_addr when building the VNIC unicast list [ Upstream commit 0b3fc7fe6f3f68569b9f9139893491b61a4b45b9 ] The default VNIC programs the device's MAC as L2 filter 0 in bnge_init_chip() via bnge_hwrm_set_vnic_filter(bn, 0, 0, dev_addr). bnge_cfg_rx_mode() then walks dev->uc and programs each unicast address as a further L2 filter, without excluding dev_addr. Skip dev_addr when building uc_list, since it is already installed as filter 0. As dev_addr now takes neither a uc_list slot nor an l2_filters[] slot, count only the non-dev_addr entries for the uc_list overflow check too, otherwise an input such as {dev_addr, A, B, C} would needlessly fall back to promiscuous mode even though A, B and C fit in exact-match filters. bnge_uc_list_updated() applies the same skip and count so the change detection stays consistent and does not loop. This issue was caught by Sashiko (nipa). Tested on Thor Ultra device. Fixes: 9afad4a17174 ("bng_en: Configure default VNIC") Signed-off-by: Vikas Gupta Reviewed-by: Dharmender Garg Link: https://patch.msgid.link/20261006141928.1432927-1-vikas.gupta@broadcom.com Signed-off-by: Paolo Abeni [ sashal: Adapted to the older API: kept dev-based netdev_for_each_uc_addr() iteration and locking in bnge_cfg_def_vnic() instead of the upstream uc/snapshot parameters and bnge_cfg_rx_mode(). ] Signed-off-by: Sasha Levin commit 52b450b7c700bd03799f25808f816584e5e45f27 Author: Jiale Yao Date: Sat Oct 3 17:21:01 2026 +0800 wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup [ Upstream commit 94c7b50351fd30e1dfe1b4051197a1445d8547e1 ] The pending management TX cleanup walks txmgmt_idr with idr_for_each(), and its callback removes the current entry. This can invalidate the radix-tree iterator retained by idr_for_each(). Use idr_for_each_entry() so every iteration starts with a fresh lookup. Continue to remove each entry under txmgmt_idr_lock before freeing its skb, preventing concurrent TX completion from finding a stale skb pointer. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Jiale Yao Reviewed-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20261003092104.520135-5-yaojiale02@163.com Signed-off-by: Jeff Johnson [ sashal: adjusted context lines in core.c, mac.c and mac.h to match the older tree; the functional change is identical to upstream. ] Signed-off-by: Sasha Levin commit b3101cb2147ae94fb09465fd2861d970facdfc35 Author: Aaradhana Sahu Date: Thu Oct 1 10:24:23 2026 +0530 wifi: ath12k: Fix NAPI resource leaks in AHB external IRQ paths [ Upstream commit ebc938ba1d5ff33652013b99c7b9a74f05690336 ] Currently, NAPI instances and their associated netdevs allocated for AHB external IRQ groups are not released when external IRQ configuration fails. They are also not freed when arch_init() fails after ath12k_ahb_config_irq() succeeds during probe, or when the driver is unloaded. Fix this by adding a common cleanup helper to release the NAPI instances and associated netdevs. Call it from the external IRQ configuration error path, probe error path, and driver cleanup path. Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1 Fixes: 6cee30f0da75 ("wifi: ath12k: add AHB driver support for IPQ5332") Fixes: 614c23e24ee8 ("wifi: ath12k: Support arch-specific DP device allocation") Signed-off-by: Aaradhana Sahu Reviewed-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20261001045423.493121-1-aaradhana.sahu@oss.qualcomm.com [renamed label err_free_irq] Signed-off-by: Jeff Johnson [ sashal: Dropped the arch_init/arch_deinit parts missing on this branch and routed the ath12k_core_init() failure in probe to the new err_free_ext_napi label. ] Signed-off-by: Sasha Levin commit edac9ae03c844a8977368f91500b6bffda47748c Author: Lorenzo Bianconi Date: Sun Nov 22 23:39:35 2026 -0500 net: stmmac: align real_num_tx_queues to mqprio configuration [ Upstream commit ac1ca0c3e139a2ebef2fc6c570af6647329726f1 ] stmmac_hw_setup() unconditionally sets the number of real TX queues to plat->tx_queues_to_use on every device open. When a tc-mqprio qdisc is offloaded the driver reduces netif_set_real_num_tx_queues() to the number of queues enabled by the offload, but the next device open reverts it to plat->tx_queues_to_use while the netdev TC map is still the one programmed by the qdisc, leaving the two inconsistent. Track the number of TX queues enabled by the current qdisc configuration in the per-qdisc state (priv->xmit_qdisc.num_tx_queues) and use it in stmmac_hw_setup(). The field defaults to plat->tx_queues_to_use at probe time and when the mqprio qdisc is destroyed, meaning no offload is active and the number of real TX queues must match the number of queues the driver allocated, and it is updated to the offloaded queue count on a successful mqprio setup. mqprio only validates the requested queue ranges against dev->real_num_tx_queues, which can be larger than plat->tx_queues_to_use while the interface has not been opened yet. Reject a qopt whose highest referenced queue (offset + count) exceeds plat->tx_queues_to_use, so xmit_qdisc.num_tx_queues can never be larger than the number of TX queues the driver provisions. Otherwise stmmac_hw_setup() would expose TX queues without an allocated DMA ring. Refuse to lower the number of TX queues below the count required by the active mqprio offload in stmmac_reinit_queues(), otherwise netif_set_real_num_tx_queues() would leave real_num_tx_queues inconsistent with the netdev TC map. The issue has been reported by sashiko and the patch has been tested on a Qualcomm RB3-Gen2 board. Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio") Tested-by: Maxime Chevallier Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-2-d7da93419784@oss.qualcomm.com Tested-by: Daniel Thompson Signed-off-by: Paolo Abeni [ sashal: Moved the queue-range check into a pre-pass before any state change, since the local mqprio setup lacks upstream's staging arrays, and used the existing num_stack_tx_queues variable. ] Signed-off-by: Sasha Levin commit 4a6679a337c365f7f019a60da07a3a50d78113d1 Author: Lorenzo Bianconi Date: Sun Nov 22 23:36:33 2026 -0500 net: stmmac: set real_num_tx_queues to max(offset + count) [ Upstream commit d128212667593c548a3c67d30031063ed46c29b7 ] tc_setup_dwmac510_mqprio() computes the number of real TX queues as the sum of the per-TC queue counts. mqprio_validate_queue_counts() only rejects out-of-bounds or overlapping ranges, so layouts with gaps or a non-zero first offset are accepted, and in those cases the sum is smaller than the highest queue referenced by the netdev TC map. netif_set_real_num_tx_queues() then passes this too-small count to netif_setup_tc(). However stmmac_set_ndev_tcs() has already zeroed dev->prio_tc_map() through netdev_reset_tc(), so when netif_setup_tc() runs every priority maps to TC0 and only the TC0 range is checked. A layout whose TC0 range fits but where a later TC references a queue beyond the new real_num_tx_queues is left with num_tc set and its TC map pointing at queues that are no longer real, without any warning; only when TC0 itself is out of range is the mapping disabled. The real prio_tc_map is programmed later by the qdisc, after this call, so the driver cannot rely on netif_setup_tc() to catch those cases. Compute num_tx_queues as the maximum of offset[i] + count[i] instead of the sum of the counts, so real_num_tx_queues always covers the highest queue referenced by the TC map. This is a no-op for the contiguous channel-mode layouts where offset[i] == i and count[i] == 1. The issue has been reported by sashiko and the patch has been tested on Qualcomm RB3-Gen2 board. Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-1-d7da93419784@oss.qualcomm.com Tested-by: Daniel Thompson Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit f737e2f3f0a3fdc29328b5341d9429dba24ce7d3 Author: Adrián Larumbe Date: Mon Oct 12 15:47:58 2026 +0100 drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove [ Upstream commit e9672bf9382ff80be21d586f88e50339b85f5766 ] During device probe(), failure to do a PM get() will leave the usage_count set to 0, which is the value assigned at device creation time. That means when the autosuspend delay expires, runtime suspend callback won't be invoked, so the device will remain powered on forever. On top of that, failure to call PM put() during device unplug means Panfrost device's PM usage_count increases monotonically for every new module reload. The outcome of both of the above meant that: - Devfreq OPP transition notifications would be printed all the time, even when no jobs are being submitted. This quickly fills the kernel ring buffer with junk. - Because MMU interrupts are only enabled when the device is reset, the very first job targeting the tiler heap BO after device probe() would always time out, since the driver's PM runtime resume callback would not be invoked. To fix the above: - Manually adjust the PM refcnt at device probe and removal time. - Ensure pm_runtime_dont_use_autosuspend is called in the wind-down path. - Call pm_runtime_put_autosuspend() when device is ready to accept jobs Fixes: 635430797d3f ("drm/panfrost: Rework runtime PM initialization") Fixes: 876b15d2c88d ("drm/panfrost: Fix module unload") Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patch.msgid.link/20261012-claude-fixes-v15-6-bc0a6c498553@collabora.com Signed-off-by: Adrián Larumbe [ sashal: Replaced pfdev->base.dev with pfdev->dev, and placed pm_runtime_put_autosuspend() after panfrost_gem_shrinker_init() since this tree's probe has that extra step and error label. ] Signed-off-by: Sasha Levin commit 2593dedca98f2fa981dabfb0f63c319f391f3f20 Author: Kaifeng Wang Date: Mon Oct 12 15:54:20 2026 +0200 net: devmem: check uid and netns in net_devmem_get_binding() [ Upstream commit 3a82195416fd71fdd6cb4ff80f611ec28073be16 ] NETDEV_CMD_BIND_TX is unprivileged, and dmabuf binding IDs are allocated from a single global xarray. Currently net_devmem_get_binding() looks up the binding by ID without checking whether the sending socket belongs to the same user or network namespace that created the binding. Record the creating netlink socket's network namespace and UID on the binding, and verify both in net_devmem_get_binding() before checking the route destination device. Return -EINVAL on mismatch so callers cannot distinguish non-existent IDs from bindings owned by other users. Fixes: bd61848900bf ("net: devmem: Implement TX path") Signed-off-by: Kaifeng Wang Acked-by: Stanislav Fomichev Reviewed-by: Bobby Eshleman Signed-off-by: Paolo Abeni [ sashal: Kept this branch's simpler net_devmem_bind_dmabuf() signature, adding nl_sk without the vdev/niov_shift parameters or the netkit bind-device logic, and adjusted the struct hunk context. ] Signed-off-by: Sasha Levin commit d80ceef58d49694ce9ee1aee38d73adad54125c2 Author: Linus Walleij Date: Sat Oct 10 00:58:53 2026 +0200 dmaengine: ste_dma40: Preserve the LCPA I/O address space [ Upstream commit 42c31fec1ca76b8b5f7759def122d418dff2cd4b ] The LCPA area is mapped with devm_ioremap(), but lcpa_base and the per-channel lcpa pointer lack __iomem annotations. This loses the I/O address space and makes sparse warn when d40_current_addr() assigns LCPA register addresses to its __iomem pointers. Annotate both pointers and the LCPA argument of d40_log_lli_lcpa_write() to preserve the I/O address space from the mapping to the register accessors. This also fixes the existing LCPA read and write warnings without changing the generated code. Fixes: c80edceff29e ("dmaengine: ste_dma40: Fix cyclic transfer residue") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202610090216.pjMRxhRL-lkp@intel.com/ Assisted-by: LLM Signed-off-by: Linus Walleij Reviewed-by: Frank Li Link: https://patch.msgid.link/20261010-dma40-smatch-fix-v1-1-26ca10043957@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 9f3ec4b8c4fece57789f518a8fd299640cb24504 Author: Jacob Moroni Date: Tue Oct 6 15:29:08 2026 +0000 RDMA/core: Clear driver_udata before destroying objects in rdma_core [ Upstream commit d37e98844afea39a9614cac0de837701263c90f7 ] When uobject creation fails while copying user output data (i.e., after the HW object has been created), it calls rdma_alloc_abort_uobject() with hw_obj_valid=true which then invokes the object's destroy callback, but passes the uverbs_attr_bundle from the original creation command. The issue is that drivers are expected to validate the udata and return an error if there's unexpected content, and data from the wrong command counts as "unexpected content", so this ends up causing the driver's destroy call to fail. A similar issue exists in the rereg_mr path when a new MR is created and the old one is destroyed. Fix this by clearing driver_udata before invoking the driver's destroy method. Fixes: 6e0954b11c05 ("RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr") Fixes: 0ac8903cbbe6 ("RDMA/core: Allow the ioctl layer to abort a fully created uobject") Signed-off-by: Jacob Moroni Link: https://patch.msgid.link/20261006152908.888059-1-jmoroni@google.com Signed-off-by: Leon Romanovsky [ sashal: Backport keeps only the two rdma_core.c call-site hunks and drops the helper move to an inline, the create_qp() change and the NULL-attrs handling, since the helper stays a plain function in uverbs_cmd.c here. ] Signed-off-by: Sasha Levin commit 0f42d81c94332b4973f1f77ec3902eb08b9712f3 Author: Quanye Yang Date: Mon Oct 5 02:01:15 2026 -0700 RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq [ Upstream commit 3255d6b83491574b115806ec958d8f6ca090fa9c ] On disconnect the client error recovery path calls ib_drain_qp(), which requires one free RQ slot and that no recv WQEs are posted while the queue is being drained. When the server is loaded with always_invalidate=N, the path does not advertise RTRS_MSG_NEW_RKEY_F. A client-requested invalidation is then a standalone SEND_WITH_INV. The recv completion path did not repost that WQE; it posted two empty recv WQEs later, when the RDMA-with-IMM response carried RTRS_IO_RSP_W_INV_IMM. If the invalidate receive never arrived, each such response increased RQ occupancy by one until ib_post_recv() started returning -ENOMEM and __ib_drain_rq() failed with: failed to drain recv queue: -12 Repost one empty recv WQE for every receive completion, including SEND_WITH_INV completions on the always_invalidate=N path, and only while the path is still connected so CQ polling cannot race with ib_drain_qp(). Size IO connection RQs to 2 * queue_depth + 1 to match the posted recv count and leave the drain slot. Tested with a synthetic RTRS client flooding unpaired RTRS_IO_RSP_W_INV_IMM messages; error recovery no longer triggers __ib_drain_rq() warnings. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Quanye Yang Link: https://lore.kernel.org/linux-rdma/CA+0ovCihE2_pxLimjmmR8NMz4g-ie8dvvq1jmAj-Om33y3Vzfg@mail.gmail.com Link: https://patch.msgid.link/20261005-rtrs-fix-ib-drain-rq-v2-1-35535a3ed115@proton.me Tested-by: Quanye Yang Reported-by: Farhad Alemi Acked-by: Jack Wang Signed-off-by: Leon Romanovsky [ sashal: Adjusted context for the older error-log format and the min_t() form of the max_recv_wr computation, then applied the same repost and queue_depth * 2 + 1 changes. ] Signed-off-by: Sasha Levin commit 5774a1043cabe12d69c6261eba960a0d8e15ef64 Author: Maksim Krasutski Date: Sat Oct 10 20:53:35 2026 +0200 ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx [ Upstream commit dd83323e4d5e22bd04f7506a9ec33533465c8393 ] The HP ENVY Laptop 17-cr1xxx with subsystem ID 103c:8be8 uses an ALC245 codec and two CS35L41 I2C speaker amplifiers. Its existing quirk configures the amplifiers but does not enable the speaker and microphone mute LED handlers. Select ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS to retain the amplifier setup and enable both mute indicators. The equivalent change was tested on an HP ENVY 17-cr1xxx running Kubuntu 26.04.1 with kernel 7.0.0-38-generic. Both keyboard mute indicators were confirmed working. Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models") Assisted-by: LLM Signed-off-by: Maksim Krasutski Link: https://patch.msgid.link/20261010185335.30949-1-krasutskimaksim@gmail.com Signed-off-by: Takashi Iwai [ sashal: Adjusted context lines: the neighbouring 0x8be9 quirk entry differs in this tree, so only the 0x8be8 line was changed to the HP mute-LEDs fixup. ] Signed-off-by: Sasha Levin commit 35939aa04c41e2674ce1728c26390a48cc80eb4e Author: Dave Jiang Date: Thu Oct 1 08:47:44 2026 -0700 cxl/port: Attach endpoints to a dport under the lock that pins it [ Upstream commit bcda00c78d075340fe30cb6c980507fac711e7d1 ] devm_cxl_enumerate_ports() and add_port_attach_ep() look up or create a dport under its port's device lock, drop the lock, then pass the dport to cxl_add_ep(). add_ep() reads dport->port before taking the lock, and cxl_gpf_port_setup() reads and writes the dport with no lock held. A concurrent cxl_detach_ep() for another memdev below the same port can free the dport in that window: it calls del_dports() under the port lock when the last endpoint leaves. The enumerating memdev then dereferences freed memory. Attach the endpoint and set up GPF while the port lock from the lookup is still held. Make add_ep() assert that lock instead of taking it. Under the lock, a dport found in port->dports is still live, since removal erases it from the xarray before freeing it. [ dj: Added kdoc update from Alison. ] Fixes: de516b40116e ("cxl/port: Record dport in endpoint references") Reported-by: Li Ming Closes: https://lore.kernel.org/linux-cxl/0c68324c-cfc7-46b2-9344-24ae40e88923@zohomail.com/ Assisted-by: LLM Reviewed-by: Li Ming Reviewed-by: Alison Schofield Link: https://patch.msgid.link/20261001154744.1095902-4-dave.jiang@intel.com Signed-off-by: Dave Jiang [ sashal: Replaced the dport lookup's lock guard with a single guard(device)(&port->dev) in the helper because port_to_host() doesn't exist here, so upstream's two-lock scheme was dropped. ] Signed-off-by: Sasha Levin commit 34644966b0b48e476aa1fc629361e73eff6aeceb Author: Marek Szyprowski Date: Wed Sep 30 15:57:32 2026 +0200 dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case [ Upstream commit 5e3bc6b44c8853bcc7782eac122c5baf2d02f399 ] Commit 849facea92fa ("dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling") moved the DMA_ATTR_NO_KERNEL_MAPPING shortcut in dma_direct_alloc() in front of the arch_dma_alloc() call. Architectures providing their own DMA coherent allocator (CONFIG_ARCH_HAS_DMA_ALLOC) therefore no longer see such requests. ARM 32bit is one of such. Lack of the call to arch_dma_alloc() results in the lack of proper cache management on HighMem pages. Take the dma-direct shortcut only for coherent devices or when the architecture doesn't provide arch_dma_alloc(). While touching this, move that check into separate function to avoid duplication in alloc and free paths. Fixes: 849facea92fa ("dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling") Reported-by: Aneesh Kumar K.V Closes: https://lore.kernel.org/all/yq5ams2akznl.fsf@kernel.org/ Assisted-by: Claude Opus 5.5 Link: https://lore.kernel.org/r/20260930135734.1013905-1-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski [ sashal: Adapted the helper's attribute check to use force_dma_unencrypted() instead of the newer __DMA_ATTR_ALLOC_CC_SHARED flag, which this tree lacks. ] Signed-off-by: Sasha Levin commit 4350e90113ce807548104c8a5aab3dbef4a535df Author: Johannes Berg Date: Mon Oct 5 22:47:55 2026 +0200 wifi: nl80211: reject zero RNR/MBSSID elements [ Upstream commit c767e1173aeab7825a8dfb197041d3996db84e39 ] That's a nonsensical configuration, and we get errors reported further down in mac80211 for it; hostapd has code that only adds the nested element if it'll not be an empty list. Remove an unnecessary NULL check while at it. Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP") Assisted-by: LLM Link: https://patch.msgid.link/20261005224950.97db49d9d104.I5765a3310528b3d1cb1673dc90ad5ab5fc3ea571@changeid Signed-off-by: Johannes Berg [ sashal: Kept the existing kzalloc(struct_size(...), GFP_KERNEL) allocation instead of upstream's kzalloc_flex(), adding the zero-element guard above it in both parse functions. ] Signed-off-by: Sasha Levin commit 692d4d068ef1f09b12e6cb536b1a4e2c36d9f597 Author: Vineeth Karumanchi Date: Mon Oct 5 16:38:55 2026 +0530 net: macb: configure ENST registers for all queues [ Upstream commit 04a943067baa670fef3c1424ea616a2ed87d3d19 ] When a taprio config only covered a subset of queues, the driver programmed the ENST registers only for the queues named in the config and left the remaining queues holding stale register values. This produced an inconsistent hardware setup that affected the scheduling of the configured queues. This was observed on a GEM instance with four hardware queues, all enabled: Initial configuration: - All four queues are enabled. - enst_on_time_qX registers are left at their reset value (0x0001FFFF). - Only q0 and q1 are configured with valid, non-overlapping ENST schedules (T0 and T1 respectively). - Traffic streams p0 and p1 are bound to q0 and q1. - ENST is enabled only on q0 and q1. Observed behavior: - During T0 on-time, both p0 and p1 packets are transmitted. - During T1 on-time, both p0 and p1 packets are transmitted. With the unused queues (q2 and q3) explicitly programmed with enst_on_time = 0x0: - During T0 on-time, only p0 packets are transmitted. - During T1 on-time, only p1 packets are transmitted. Leaving the ENST on-time registers of unused queues at their reset value (0x0001FFFF) disrupts the scheduling of the configured queues, whereas programming them with 0x0 yields the expected ENST operation. Program the ENST registers for every queue unconditionally. The per-queue configuration array is now allocated for bp->num_queues and indexed directly by queue_id; unconfigured queues are left zero-initialized by kzalloc_objs(), so their registers are cleared. Indexing the array by queue_id also makes the queue_id field in struct macb_queue_enst_config redundant, so drop it. Fixes: 89934dbf169e ("net: macb: Add TAPRIO traffic scheduling support") Reviewed-by: Théo Lebrun Signed-off-by: Vineeth Karumanchi Reviewed-by: Jacob Keller Link: https://patch.msgid.link/20261005110855.1669249-1-vineeth.karumanchi@amd.com Signed-off-by: Jakub Kicinski [ sashal: Queue index is computed with hweight32(bp->queue_mask & (gate_mask - 1)) instead of upstream's order_base_2(gate_mask), since sparse queue masks are possible here, and kcalloc replaces kzalloc_objs. ] Signed-off-by: Sasha Levin commit c3e8fd22927da000865655b864f1b3b99ba4242c Author: Takashi Iwai Date: Wed Oct 7 19:25:23 2026 +0200 ALSA: aloop: Avoid a bad mixure of guard() and goto [ Upstream commit f7faf5d9b5668919cae84a6247f8f7b4e2c0227c ] The rewrite of aloop driver code using guard() leaded to a mixture of guard() and some goto; although it currently works, it isn't really a good match. For avoiding the bad match, just move the code using goto into a function and wrap it with guard(). Fixes: ebd9b6c91d4e ("ALSA: aloop: Use guard() for mutex locks") Reported-by: Sashiko Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261007172533.14667-6-tiwai@suse.de [ sashal: Kept the existing kzalloc(sizeof(*dpcm), GFP_KERNEL) call in the context instead of upstream's kzalloc_obj(*dpcm), since the file still uses plain kzalloc. ] Signed-off-by: Sasha Levin commit 1202b86596a7ddf99bab1d6666d8c0a02ca2b0cc Author: Takashi Iwai Date: Wed Oct 7 19:25:20 2026 +0200 ALSA: pcmtest: Fix leak at probe error [ Upstream commit d0f2ca62e89f3c666d0ec203eaa23b8d965e5443 ] When an error happens at probe of pcmtest driver before snd_card_register() succeeds, we have to release the card explicitly, but it's not done, leading to a potential memory leak. Also, pcmtest driver manages struct pcmtst object unnecessarily complicatedly by a dynamic allocation and release. This patch fixes and cleans up the resource management: - Use card's private_data allocation for struct sndpcmtst at the card creation, which is released automatically together with the card - Since the allocation of pcmtest is gone, snd_pcmtst_create() is rather pointless, so just directly calling snd_pcmtst_new_pcm() - Use the new auto-clean mechanism to handle the error case at probe. - Many release handlers became superfluous and dropped In the end we got a good amount of code reduction. Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver") Reported-by: Sashiko Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261007172533.14667-3-tiwai@suse.de [ sashal: Dropped the deleted snd_pcmtst_create() function in full, including its older kzalloc(sizeof(*pcmtst), GFP_KERNEL) line where upstream had kzalloc_obj(*pcmtst), since the branch lacks that helper. ] Signed-off-by: Sasha Levin commit adb6aba011b9ae7eda1fb4da55a51e82f9116382 Author: Lorenzo Bianconi Date: Thu Oct 1 11:26:12 2026 +0200 net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path [ Upstream commit 237782c3d416b392a12642f32959e9d3c94e0c26 ] tx_coal_frames[] is written by ethtool (stmmac_set_coalesce) and read locklessly from the TX fast path (stmmac_xmit, stmmac_tso_xmit, stmmac_xdp_xmit_zc and stmmac_xdp_xmit_xdpf), so pair every access with READ_ONCE()/WRITE_ONCE() to mark the intentional data race and read a consistent value into a local variable. Moreover, ethtool allows disabling TX coalescing by setting tx_max_coalesced_frames to 0: guard the modulo operation in stmmac_xdp_xmit_xdpf() against a zero tx_coal_frames[queue] to avoid a division by zero. Both issues were found by code inspection while extending the XDP TX path with multi-buff support, and neither has ever been triggered, so they are only theoretical. Tested on the Qualcomm RB3-gen2 board. Fixes: db2f2842e6f5 ("net: stmmac: add per-queue TX & RX coalesce ethtool support") Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20261001-b4-stmmac-xmit-mb-v4-1-664e0c3eb289@oss.qualcomm.com Signed-off-by: Jakub Kicinski [ sashal: Dropped the duplicate pay_len, mss, queue declaration and kept this branch's local variable names (des, has_vlan, set_ic, proto_hdr_len) instead of upstream's declaration changes. ] Signed-off-by: Sasha Levin commit 481b2bacf375df8a7104670adcb40bdbd7d013d0 Author: Dmitry Morgun Date: Sun Jul 12 15:15:49 2026 +0000 fs/ntfs3: check return values in indx_delete_entry() [ Upstream commit 131f7d7abf0f10edc6ea6b032f8a3908bdb13ce8 ] When the index tree collapses down to an empty root, indx_delete_entry() calls attr_set_size() and ni_remove_attr() for both ATTR_ALLOC and ATTR_BITMAP, but their return values are overwritten by the following call without being checked. In most other call sites of these functions the return value is checked, so add the same checks here in case an error at this point is meaningful. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Dmitry Morgun Signed-off-by: Konstantin Komarov [ sashal: added the missing NULL argument to both attr_set_size() calls to match this branch's older function prototype. ] Signed-off-by: Sasha Levin commit 39db31551eb41760669bd5f45fd22351d563e21d Author: Melissa Wen Date: Thu Sep 24 23:10:07 2026 +0200 drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class [ Upstream commit 6c4f8c5cc00326f6c709bff0d640d504c90862ca ] Don't create an amdgpu_dm_atomic_state_template event since this is just a template. Declare the template as an event class that will be used by actual event tracers. Fixes: e8a982355f96 ("drm/amd/display: Add tracepoint for amdgpu_dm") Signed-off-by: Melissa Wen Reviewed-by: Tvrtko Ursulin Tested-by: Dan Wheeler Reviewed-by: Roman Li Signed-off-by: Alex Deucher [ sashal: Replaced struct drm_atomic_commit with struct drm_atomic_state in TP_PROTO and __field, since the rename isn't present in this tree. ] Signed-off-by: Sasha Levin commit 933b525ee6ccf97901664baa7c419b4fb566dbbd Author: Felix Fietkau Date: Wed Oct 7 13:24:13 2026 +0200 wifi: mt76: mt7921: fix of_node reference leaks in regd update [ Upstream commit 2f209a8dca88507bc094de370e582adefc55723e ] mt7921_regd_channel_update() and __mt7921_mcu_set_clc() never release the nodes returned by mt76_find_power_limits_node(), of_get_child_by_name() and mt76_find_channel_node(). Each regulatory domain change and each CLC update on a device with DT power limits leaks these references. Release every node after use. This relies on mt76_find_power_limits_node() also returning a reference for the fallback node, which it does since commit 3a62c9f7ec3d ("wifi: mt76: Fix of_node reference leak in mt76_get_rate_power_limits()"). Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed") Link: https://patch.msgid.link/20261007112419.1277594-3-nbd@nbd.name Signed-off-by: Felix Fietkau [ sashal: Applied the fix inside mt7921_regd_channel_update() in init.c (no regd.c here) and inlined the mt7921_regd_dt_has_channel() helper, with no goto out on the 5 GHz check. ] Signed-off-by: Sasha Levin commit e360d46ddcf22a185115547c4d49ed693eb95775 Author: Felix Fietkau Date: Tue Oct 6 22:59:20 2026 +0200 wifi: mt76: mt7996: free the WTBL index if a link allocation fails [ Upstream commit 36f1934a2bf04f355e748c68ba7f7cbb5e6950fc ] mt7996_mac_sta_init_link() takes a WTBL index from wcid_mask before it allocates the msta_link of a link other than the first one. If that allocation fails, the function returns -ENOMEM and the index stays set in wcid_mask, so no later station can use it. Return the index to wcid_mask on that error. Fixes: dd82a9e02c05 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks") Link: https://patch.msgid.link/20261006205936.669125-11-nbd@nbd.name Signed-off-by: Felix Fietkau [ sashal: Kept the older kzalloc(sizeof(*msta_link), GFP_KERNEL) allocation instead of kzalloc_obj(*msta_link) as the context line, then applied the same fix on top. ] Signed-off-by: Sasha Levin commit bbc2cf06db8f51c267520d926c68712e6959ca82 Author: Linus Walleij Date: Sun Sep 27 11:03:16 2026 +0200 dmaengine: ste_dma40: Recover coalesced cyclic callbacks [ Upstream commit db28400d92cd97005065dad230b8a5d72ab121cb ] DMA40 has one terminal-count status bit per channel, so cyclic period interrupts can coalesce. Use the memory-side pointer displacement to queue the minimum observable number of callbacks. If sampling fails, queue one callback and invalidate the saved position; the next successful sample resynchronizes without recounting it. The pointer is modulo the cyclic buffer: a displacement of d periods can mean d plus n complete iterations of the buffer. Report d, so the driver could have missed n iterations of the buffer; DMA40 has no counter to recover them. For an unchanged pointer, report one callback rather than risk a spurious full-buffer burst. This condition has not been seen in practice and is only a product of review comments that the buffer can miss interrupts. The preceding cyclic-residue fix ensures that every cyclic period fits in one LLI, so each boundary corresponds to one client callback. Fixes: 0c842b551063 ("dma40: cyclic xfer support") Assisted-by: LLM Signed-off-by: Linus Walleij Reviewed-by: Frank Li Link: https://patch.msgid.link/20260927-dma40-fixes-v7-3-89f595e8851d@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit f9a85ef22f46389358ab70f7b176b33d03b62570 Author: Linus Walleij Date: Sun Sep 27 11:03:15 2026 +0200 dmaengine: ste_dma40: Fix cyclic transfer residue [ Upstream commit c80edceff29ee212987c2d2c851b2cb2eb4b477a ] DMA40 reads residue from the element count of the currently active LLI. For a cyclic transfer this reports at most one period, not the bytes remaining until the cyclic buffer wraps. Once DMA40 advertises burst granularity, DMAengine PCM uses this residue directly. For a four-period PCM buffer it consequently reports the hardware pointer near three periods after every period interrupt. ALSA eventually stops playback with -EIO although DMA period callbacks continue. Calculate cyclic residue from the current memory-side hardware pointer instead. Read the destination pointer for capture and the source pointer for playback. Sample the split logical channel pointer coherently and retain the last valid residue during relink transitions. Make at most three residue sampling attempts: one initial read plus two retries. The retries let transient split-register updates or LLI relink windows settle, while the limit prevents unbounded polling if hardware does not yield a valid pointer. This avoids counting terminal-count interrupts, which races with hardware advancing to the next LLI and cannot account for coalesced interrupt status. Also reject cyclic periods that expand into multiple LLIs because logical cyclic LLIs each request a terminal-count interrupt and would generate more than one callback per period. Reject invalid cyclic geometries before dividing or constructing the scatterlist as well. Reported-by: Frank Li Closes: https://lore.kernel.org/dmaengine/aq2wIPJW6viUxyy9@SMW015318/ Fixes: 15c606686541 ("dmaengine: ste_dma40: indicate granularity on channels") Assisted-by: LLM Reviewed-by: Frank Li Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260927-dma40-fixes-v7-2-89f595e8851d@kernel.org Signed-off-by: Vinod Koul [ sashal: Replaced the kzalloc_objs() allocation call with kcalloc() for the scatterlist in dma40_prep_dma_cyclic(), since the newer helper is missing here. ] Signed-off-by: Sasha Levin commit fa7894deb868a21530f19094b31cfb45d684b49f Author: Qing Ming Date: Fri Oct 2 17:11:28 2026 -0400 dlm: validate node weights before building member array [ Upstream commit 7f662eb1807ed732ac7d5e119753c8185f241bb8 ] DLM node weights are parsed as signed integers and copied into the member list. make_member_array() uses their sum as the allocation count, but only positive weights contribute entries to the array. A negative weight can therefore reduce the allocation without reducing the number of writes. The issue was found through static analysis of the configfs input and member array construction. With two recovery members weighted -31 and 32, the sum is 1, so recovery allocates one int and then writes the positive member's node ID 32 times. A reproducer using dlm_controld and dlm_tool triggered the same report on a KASAN kernel: BUG: KASAN: slab-out-of-bounds in dlm_recover_members [dlm] Write of size 4 by task dlm_recoverd Call Trace: dlm_recover_members dlm_recoverd kthread ret_from_fork Reject negative weights at the configfs input boundary. Also detect overflow when adding non-negative weights to the signed allocation count, and propagate array construction errors to the recovery path. Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM") Signed-off-by: Qing Ming Assisted-by: Codex:gpt-5 Acked-by: Alexander Aring Signed-off-by: Alexander Aring Signed-off-by: David Teigland [ sashal: Kept the branch's kmalloc_array() allocation in make_member_array() where upstream context uses kmalloc_objs(), and dropped the early ls_total_weight assignment. ] Signed-off-by: Sasha Levin commit 922c1cb1af60c27049f3c064d857f285e25c0f5f Author: Dmitry Baryshkov Date: Sun Sep 20 14:08:52 2026 +0300 drm/msm/a5xx: don't read the GPMU registers on GPUs without a GPMU [ Upstream commit 77e3ffcf69065c4ce92c725540e0b4db14f43ad7 ] Only a530/a540 have a GPMU. On the other a5xx parts, reading the 0xa800-0xac60 GPMU aperture during a crashdump resets the board -- on sda660 (a512) a GPU hang thus reboots the SoC instead of recovering. Split the GPMU block into its own array and collect it only when a GPMU is present. Fixes: e20c9284c8f2 ("drm/msm/adreno: Add support for Adreno 510 GPU") Assisted-by: LLM Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/754867/ Message-ID: <20260920-a5xx-no-gpmu-v1-1-714200254f76@oss.qualcomm.com> Signed-off-by: Rob Clark [ sashal: Replaced upstream's kzalloc_obj(*a5xx_state) with kzalloc(sizeof(*a5xx_state), GFP_KERNEL) because the helper doesn't exist here, and kept the added adreno_gpu declaration. ] Signed-off-by: Sasha Levin commit 7bd2c17d756a97c8fd590460382eac97bd74ccc9 Author: Nicolin Chen Date: Wed Sep 23 13:11:25 2026 -0700 iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node [ Upstream commit 2888520bdcbe0599cfc77b2fad8dc6c95505a3cb ] arm_smmu_insert_master() skips inserting a stream whose StreamID duplicates one the same master already owns (bridged PCI devices can present duplicate IDs), leaving that master->streams[i].node zeroed and unlinked from the smmu->streams rb-tree. Both the insert error-rollback loop and arm_smmu_remove_master() then call rb_erase() on every master->streams[i].node unconditionally. rb_erase() on a zeroed node sees a NULL parent, treats the node as the tree root and sets root->rb_node = NULL, silently emptying the whole SID tree and breaking SID lookups (and DMA) for every other master on the SMMU. Mark each node with RB_CLEAR_NODE() after sort_nonatomic() reorders the array, since sorting relocates the entries and would leave the earlier self-referential RB_CLEAR_NODE() pointer stale. An un-inserted node then stays RB_EMPTY_NODE() and is skipped in both erase loops; inserted nodes are linked by rb_find_add() and erased as before. Fixes: b00d24997a11 ("iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids") Assisted-by: LLM Signed-off-by: Nicolin Chen Reviewed-by: Mostafa Saleh Signed-off-by: Will Deacon [ sashal: Placed the RB_CLEAR_NODE() loop right after master->num_streams is set, since this tree has no sort() or build_invs context, and dropped the upstream sort comment. ] Signed-off-by: Sasha Levin commit 1f21b3989c40ff5b53e73b23acbda5d73844342a Author: Niklas Cassel Date: Tue Sep 29 10:25:05 2026 +0200 scsi: scsi_debug: Enforce physical block alignment of zoned writes [ Upstream commit 63cb3900be261fccc05cadcf3402058418a5fada ] ZBC-3 r06 (T10/BSR INCITS 579), 4.5.3.3.2, requires a write to a sequential write required zone to be terminated with ILLEGAL REQUEST / UNALIGNED WRITE COMMAND both when it does not start at the write pointer and when it does not end on a physical block boundary. That is why sd_zbc_read_zones() sets the zone_write_granularity queue limit to the physical block size of a host-managed device. check_zbc_access_params() implements the first condition but not the second. So with zbc=managed sector_size=512 physblk_exp=3, a write of a single logical block at the write pointer is accepted and advances the write pointer by one logical block, leaving it off the granularity that was advertised: nothing can write at it any more, and the zone can only be used again after being reset. Check the ending LBA as well, with the same sense data, as the standard gives both conditions the same. An entire medium write same command, which the standard excludes, needs no special case: the preceding check already terminates it with WRITE BOUNDARY VIOLATION. Sequential write preferred zones are left alone, as writes to them need not be sequential, and with the default physblk_exp=0 the check is a no-op. Assisted-by: LLM Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands") Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Link: https://patch.msgid.link/20260929082456.857423-23-cassel@kernel.org Signed-off-by: Martin K. Petersen (Oracle) [ sashal: changed the mk_sense_buffer() call to the older four-argument form (LBA_OUT_OF_RANGE, UNALIGNED_WRITE_ASCQ) used by neighbouring code, since the combined UNALIGNED_WRITE_COMMAND form is not used here. ] Signed-off-by: Sasha Levin commit cda6fbc73ecf181ff11bfa3f619b0bb9eeeb1ac4 Author: Yuan Chen Date: Mon Sep 28 17:11:21 2026 +0800 bpf: Roll back freplace link state when bpf_arch_text_poke() fails [ Upstream commit 5ec398d9ec8fe13f8058af9a2e5f5e8f46e0a35a ] A freplace attach claims the target prog by bumping tgt_prog->aux->freplace_link_cnt and setting tr->extension_prog. bpf_arch_text_poke() then makes the extension take effect. If the poke fails, the claims are never released: the attach unwinds through bpf_link_cleanup(), which clears link->prog, so bpf_trampoline_unlink_prog() never runs. Drop the link count under ext_mutex on the error path, and set tr->extension_prog only after the poke succeeded. The count is still bumped before the poke: it blocks prog_array updates while the entry is patched. Fixes: d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace") Fixes: be8704ff07d2 ("bpf: Introduce dynamic program extensions") Suggested-by: Leon Hwang Signed-off-by: Yuan Chen Signed-off-by: Alexei Starovoitov Acked-by: Leon Hwang Link: https://patch.msgid.link/20260928091121.219333-1-chenyuan_fl@163.com [ sashal: Adapted the freplace fix to the older bpf_arch_text_poke() four-argument form and link->link.prog, instead of the newer BPF_MOD_NOP call and node->link->prog. ] Signed-off-by: Sasha Levin commit 5853ffdd61233bc7c0061d80ec6dc4c4cd969851 Author: Lance Yang Date: Thu Oct 1 00:04:32 2026 +0800 mm/memory_hotplug: fix missing rollback in __add_pages() [ Upstream commit c31bb839fb829958101250ee5acfa4f94fdb7ecd ] __add_pages() returns on a sparse_add_section() failure without removing the sections already added in the same request. For memremap_pages(), the failed range is not counted in pgmap->nr_range, so memunmap_pages() skips it. The sections already added in that range retain their vmemmap mappings and subsection bits. Retrying a section-aligned range can then fail with -EEXIST. Save the initial PFN and remove [start_pfn, pfn) on failure. For a vmemmap population failure, section_activate() already cleans up the current section, so the rollback excludes it. If the first section fails, __remove_pages() receives an empty range and does nothing. Link: https://lore.kernel.org/all/BAD58999-1EDD-4A37-ABA0-DB1BD8AB3453@linux.dev/ Suggested-by: Muchun Song Signed-off-by: Lance Yang Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") Acked-by: Muchun Song Link: https://patch.msgid.link/20260930160432.5564-1-lance.yang@linux.dev Signed-off-by: David Hildenbrand (Arm) [ sashal: Dropped the fourth params->pgmap argument from the __remove_pages() rollback call, since this tree's __remove_pages() takes only three arguments. ] Signed-off-by: Sasha Levin commit 221dfe3a07e0b5d64505984a8c5ff726315f98b6 Author: Nathan Chancellor Date: Sun Sep 27 01:01:17 2026 +0200 serial: 8250_mid: Add missing module namespace import for SERIAL_8250 [ Upstream commit 789f52f83305032ecfaaf7efae9a8ba75815c01b ] After commit 1c305d5f1daa ("serial: 8250_mid: wait for LSR tx empty before setting termios"), modpost errors (or warning with CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y): ERROR: modpost: drivers/tty/serial/8250/8250_mid.ko: module uses symbol 'serial8250_wait_for_xmitr' from namespace 'SERIAL_8250', but does not import it. Add the missing module namespace import to clear up the error/warning. Fixes: 1c305d5f1daa ("serial: 8250_mid: wait for LSR tx empty before setting termios") Signed-off-by: Nathan Chancellor Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/20260927-tty-8250_mid-ns-import-v1-1-84d0482e1c5d@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit 0a97cd8b8ae6029fe046864086b60436ad12a3c6 Author: Takashi Iwai Date: Wed Sep 30 17:53:51 2026 +0200 ALSA: usb-audio: Fix UAC2 mixer unit request handling [ Upstream commit 0458d97859840506c3688a963dcd4f72b4a23083 ] For a request for a Mixer Unit on UAC2 (also UAC3), the wValue is different from UAC1 and an incompatible value must be passed. Namely, UAC1 takes a word consisting of 1-based input channel in the high byte and 1-based output channel in the low byte. Meanwhile, UAC2/3 takes UAC2_MU_MIXER in the high byte and a MCN (0-based bit position of input/output channels) in the low byte. The current driver implementation blindly assumes the UAC1 way, hence it would cause a firmware error. This patch attempts to implement the conversion to UAC2 MCN at get_ctl_value_v2() and snd_usb_mixer_set_ctl_value() for mixer units. At the points above, the old wValue containing ICN and OCN is converted to the corresponding MCN, and it's used as the proper wValue. Reported-by: Zipdox Closes: https://lore.kernel.org/d46fcac6-bd7e-4fc4-95e1-4e8d39f92ad3@zipdox.net Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0") Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260930155356.348608-3-tiwai@suse.de Signed-off-by: Sasha Levin commit 7d223c5f704f4cf83e9e94bf056e6fc6d37adf41 Author: Ian Rogers Date: Mon Sep 28 23:58:31 2026 -0700 perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events [ Upstream commit 7c89ea1bd4c612eb5cc2e6c01f77ebfc21d5c95d ] On kernels without the fix ("perf/core: Restore header fields in sideband output callbacks") to restore event_id.header.size in perf_event_ksymbol_output(), perf_event_bpf_output(), and perf_event_text_poke_output(), concurrent perf sessions cause those sideband records to be emitted with header.size inflated by multiple id_header_size increments while the single id_sample is written immediately after the event payload. Indexing backwards from event->header.size reads uninitialized ring-buffer bytes at the end of the record, causing evlist__event2evsel() to fail with -EFAULT. Add evsel__event_size() to clamp the effective size used to locate the trailing id_sample for PERF_RECORD_KSYMBOL, PERF_RECORD_BPF_EVENT, and PERF_RECORD_TEXT_POKE to payload + id_hdr_size while leaving event->header.size intact for advancing the ring-buffer/file stream. Fixes: 9aa0bfa370b278a5 ("perf tools: Handle PERF_RECORD_KSYMBOL") Fixes: 45178a928a4b7c60 ("perf tools: Handle PERF_RECORD_BPF_EVENT") Fixes: 246eba8e9041c477 ("perf tools: Add support for PERF_RECORD_TEXT_POKE") Link: https://lore.kernel.org/r/20260929014206.4175245-1-irogers@google.com Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Song Liu Signed-off-by: Arnaldo Carvalho de Melo [ sashal: Replaced evlist__id_pos()/evlist__is_pos() accessors with direct evlist->id_pos/is_pos field reads, and adapted perf_evsel__parse_id_sample() to the pointer-walk array form instead of an index. ] Signed-off-by: Sasha Levin commit 9fb01e49101c3f4ad7a51f07630cd1fabd8353ef Author: Venkat Rao Bagalkote Date: Wed Sep 9 18:02:40 2026 +0530 powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard [ Upstream commit 644ffb02746690c0ebfe143e066f81c9bde2975e ] radix_enabled() uses a jump label which is only valid after setup_feature_keys() is called. Before that point, on a pSeries hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in cur_cpu_spec->mmu_features, but the jump label has not yet been patched, so radix_enabled() incorrectly returns true. The dangerous usage window where it goes wrong in early_setup(): early_setup: configure_exceptions(); setup_feature_keys(); If an NMI occurs in this window, !radix_enabled() evaluates to false in DEFINE_INTERRUPT_HANDLER_NMI. The handler fails to skip NMI entry in real mode and attempts to access memory outside the Real Mode Area (RMA), hanging the boot. Since common interrupt wrappers do not have the context of early or late, using early_radix_enabled() is the safer option. It does a plain bitmask check against cur_cpu_spec->mmu_features and is correct at all times. Console logs from a pSeries HASH guest showing values across boot stages: [ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=0 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!) [ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=0 radix_enabled=1 [ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=0 radix_enabled=0 (should now match!) [ 0.057124] DEBUG: post secondary CPU bringup: early_radix_enabled=0 radix_enabled=0 (should match!) Console logs from a RADIX guest showing values across boot stages: [ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=1 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!) [ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=1 radix_enabled=1 [ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=1 radix_enabled=1 (should now match!) [ 0.057016] DEBUG: post secondary CPU bringup: early_radix_enabled=1 radix_enabled=1 (should match!) Add the missing #include in alphabetical order since early_radix_enabled() is declared there. Fixes: 8d0e21012743 ("powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash") Signed-off-by: Venkat Rao Bagalkote Reviewed-by: Mukesh Kumar Chaurasiya Reviewed-by: Shrikanth Hegde Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20260909123240.58786-1-venkat88@linux.ibm.com [ sashal: Applied the early_radix_enabled() change in the interrupt_nmi_enter_prepare() and interrupt_nmi_exit_prepare() helpers instead of the DEFINE_INTERRUPT_HANDLER_NMI macro body, since the logic was already refactored there. ] Signed-off-by: Sasha Levin commit 28ef22ce656e3faad2e202eb88a7412b67d943c9 Author: Abhishek Dubey Date: Mon Sep 28 10:43:54 2026 +0530 powerpc/bpf: Move out dummy_tramp_addr after Long branch stub [ Upstream commit 6652b9941a6c9b6814ca6d2eb153dbf162b89a02 ] Move the long branch address field to the bottom of the long branch stub. This allows uninterrupted disassembly until the last 4/8 bytes. The last bytes exclusion is logically necessary to prevent disassembly failure, otherwise the actual program layout is never altered. Hence no effect on overall program size. Also, align dummy_tramp_addr field with 8-byte boundary. Following is disassembler output for test program with moved down dummy_tramp_addr field: ..... ..... pc:68 left:44 a6 03 08 7c : mtlr 0 pc:72 left:40 bc ff ff 4b : b .-68 pc:76 left:36 a6 02 68 7d : mflr 11 pc:80 left:32 05 00 9f 42 : bcl 20, 31, .+4 pc:84 left:28 a6 02 88 7d : mflr 12 pc:88 left:24 14 00 8c e9 : ld 12, 20(12) pc:92 left:20 a6 03 89 7d : mtctr 12 pc:96 left:16 a6 03 68 7d : mtlr 11 pc:100 left:12 20 04 80 4e : bctr pc:104 left:8 c0 34 1d 00 : Failure log: Can't disasm instruction at offset 104: c0 34 1d 00 00 00 00 c0 Disassembly logic can truncate at 104, ignoring last 8 bytes. Update the dummy_tramp_addr field offset calculation from the end of the program to reflect its new location, for bpf_arch_text_poke() to update the actual trampoline's address in this field. All BPF trampoline selftests continue to pass with this patch applied. Fixes: d243b62b7bd3 ("powerpc64/bpf: Add support for bpf trampolines") Signed-off-by: Abhishek Dubey Signed-off-by: Saket Kumar Bhaskar Tested-by: Yeswanth Krishna Tellakula Tested-by: R Nageswara Sastry Reviewed-by: Hari Bathini Acked-by: Hari Bathini Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/552225fc257381fb83d282b3040c6ad363246465.1789982239.git.skb99@linux.ibm.com Signed-off-by: Sasha Levin commit c071dea874b21799363138997f8bbfe45ee6334b Author: Selvin Xavier Date: Mon Sep 21 23:12:28 2026 -0700 RDMA/bnxt_re: Serialize dcb_wq access against async notifier [ Upstream commit 81caf9240dfb082c0eb2b24feef8266268fd152f ] bnxt_re_async_notifier() runs in NAPI/softirq context via bnxt_en's RCU-protected ULP ops dispatch, never under rtnl_lock, so it isn't serialized against bnxt_re_uninit_dcb_wq() destroying rdev->dcb_wq. A concurrent notifier call can queue_work() on a workqueue that is being, or has just been, destroyed. Add a spinlock scoped to dcb_wq: the notifier takes it before checking dcb_wq and queuing work, and bnxt_re_uninit_dcb_wq() takes it to atomically clear dcb_wq before destroying it. Initialize the lock at rdev allocation so it is valid on every teardown path, including bnxt_re_dev_init()'s early failure labels. Fixes: 51dc5312dcd9 ("RDMA/bnxt_re: Add support to handle DCB_CONFIG_CHANGE event") Signed-off-by: Selvin Xavier Signed-off-by: Leon Romanovsky [ sashal: Used the branch's kzalloc(sizeof(*dcb_work), GFP_ATOMIC) in place of upstream's kzalloc_obj(*dcb_work, GFP_ATOMIC) in the DCB_CONFIG_CHANGE notifier, to fit the surrounding code. ] Signed-off-by: Sasha Levin commit b5ff026b41d2ff4c7708e8ce9750388ea09e6e96 Author: Yishai Hadas Date: Tue Sep 15 17:09:31 2026 +0300 RDMA/mlx5: Set QP event handler before firmware QPC insertion [ Upstream commit 05a078c97eb0bb7158526dae414b853737692485 ] Four QP creation paths assigned base->container_mibqp and base->mqp.event after the firmware create call that inserts the QP into dev->qp_table.tree. A firmware error EQE in that window reaches qp->event() with a NULL pointer. Move both assignments before the firmware call. Also set ibqp.qp_num inside mlx5_qpc_create_qp() before create_resource_common() so an EQE arriving early does not observe qp_num==0. In addition, add a WARN_ON_ONCE(!qp->event) guard in rsc_event_notifier() as a safeguard for future regressions. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Yishai Hadas Link: https://patch.msgid.link/20260915140933.40580-14-yishaih@nvidia.com Signed-off-by: Leon Romanovsky [ sashal: Moved the base->container_mibqp and mqp.event assignments ahead of the firmware QP creation call, with context adjusted for the older base (no attrs argument in create_raw_packet_qp_sq()). ] Signed-off-by: Sasha Levin commit 153910941c06e0ece5adc82742d195193d74d78c Author: Yishai Hadas Date: Tue Sep 15 17:09:21 2026 +0300 RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access [ Upstream commit 89abac4b60b708037595255ea2614b6967c86ee5 ] pvrdma embeds a pvrdma_ring_state header directly inside the QP and SRQ ring buffers, and the hypervisor writes cons_head into that header. Pinning with access=0 does not force a private page copy (no FOLL_WRITE), so the hypervisor may write into a shared page. Pass IB_ACCESS_LOCAL_WRITE for all three rings. The SRQ ring_state is not currently used by the driver but is pinned writable for consistency. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Signed-off-by: Yishai Hadas Link: https://patch.msgid.link/20260915140933.40580-4-yishaih@nvidia.com Signed-off-by: Leon Romanovsky [ sashal: Replaced ib_umem_get_va() calls with the older ib_umem_get() name while changing the access argument from 0 to IB_ACCESS_LOCAL_WRITE. ] Signed-off-by: Sasha Levin commit 5683fed6767704069a1d017bb0fd11d05cb9ddfc Author: Danish Khateeb Date: Fri Sep 25 16:15:58 2026 -0500 tools/nolibc: fix readdir_r() with 64-bit directory offsets [ Upstream commit 00c81514ad49110574e4b9bdbc448551004161f2 ] readdir_r() stores the result of _sys_lseek() in an int. Directory offsets are opaque cookies which can use all 64 bits: ext4, for instance, gives 64-bit processes 63-bit hashes, and 0x7fffffffffffffff as the offset after the last entry. Truncated to an int, such an offset is negative about half the time, and readdir_r() takes it for an error. Since commit 4ada5679f18d ("tools/nolibc/dirent: avoid errno in readdir_r"), readdir_r() fails at the first entry whose offset has bit 31 set, which on ext4 is usually one of the first few, and returns the truncated offset as the error number. Before that, only -1 counted as an error, which the last entry always hits: readdir_r() then returned errno, usually 0, without filling in the entry, so the caller got the previous entry a second time and never saw the last one. 32-bit processes get 31-bit hashes from ext4 and are not affected. Keep the offset in an off_t. Fixes: 665fa8dea90d ("tools/nolibc: add support for directory access") Assisted-by: LLM Signed-off-by: Danish Khateeb Link: https://patch.msgid.link/20260925211600.119116-2-danishkhateeb03@gmail.com Signed-off-by: Thomas Weißschuh [ sashal: Renamed _sys_lseek() to sys_lseek() in the readdir_r() hunk, since this tree still uses the older helper name. ] Signed-off-by: Sasha Levin commit 8c22349f05366cd5ab04c16ed8132e570f0fe2e6 Author: Daniel Borkmann Date: Sun Nov 22 19:46:18 2026 -0500 bpf: Rebase the exception callback subprog when dead subprogs are removed [ Upstream commit 8608ec8e981974b18834e2d67ed39638a9ec2e63 ] adjust_subprog_starts_after_remove() compacts subprog_info[] and the func_info when whole subprograms are removed as dead code, but leaves env->exception_callback_subprog alone, so an exception callback declared through the exception_callback decl tag which sits behind a removed subprogram keeps its old index. jit_subprogs() then takes the exception callback from func[] at that index, which is past the end when the callback was the last subprogram, or another subprogram otherwise. Rebase the index along with the entries it refers to. Fixes: b9ae0c9dd0ac ("bpf: Add support for custom exception callbacks") Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260925175244.1136329-4-daniel@iogearbox.net [ sashal: Applied the fix to the same function in kernel/bpf/verifier.c, since this tree predates the split into fixups.c; the three added lines and surrounding context are otherwise identical. ] Signed-off-by: Sasha Levin commit 33070fc10c501da535560b316d02a904bf85d049 Author: Mohd Ayaan Anwar Date: Tue Aug 4 00:57:59 2026 +0530 arm64: dts: qcom: lemans-evk: fix SerDes PHY regulator supplies [ Upstream commit 457cf65a7997e398d8d6cef08601b4ea61b58e38 ] The SerDes PHY nodes were configured with 'phy-supply = <&vreg_l5a>', which was incorrect on two counts: vreg_l5a is not a supply the PHY requires, and only one rail was described whereas the hardware needs two. The PHY requires vdda-0p9 (vreg_l4a) and vdda-1p2 (vreg_l1c). Replace the incorrect phy-supply with these two named properties on both the base EVK node and the IFP mezzanine overlay. Fixes: 71ee90ed1756 ("arm64: dts: qcom: lemans-evk: Enable 2.5G Ethernet interface") Signed-off-by: Mohd Ayaan Anwar Reviewed-by: Bartosz Golaszewski Tested-by: Bartosz Golaszewski Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260804-b4-sgmiieth_serdes_regulator-v2-3-c4bc688177dd@oss.qualcomm.com Signed-off-by: Bjorn Andersson [ sashal: dropped the lemans-evk-ifp-mezzanine.dtso hunk (&serdes1) because that overlay file doesn't exist in this tree; the &serdes0 hunk in lemans-evk.dts applies with adjusted context. ] Signed-off-by: Sasha Levin commit c7eecfebfedcc192c584bf01dd19461cc28d3e50 Author: Sudeep Holla Date: Tue Sep 22 15:43:01 2026 +0100 ACPI: PCC: Free channel on OpRegion deactivation [ Upstream commit fa9c7ee692988edddc1da74bc5257d53dd3c7130 ] ACPICA calls the address space setup callback with ACPI_REGION_DEACTIVATE when a PCC OperationRegion is torn down. The PCC setup callback currently allocates a fresh pcc_data and requests the mailbox channel before looking at the function argument. If ACPICA deactivates a region, this can leave the existing region context and mailbox channel unreleased, and may also request a channel during teardown. Handle ACPI_REGION_DEACTIVATE before allocation. Free the PCC mailbox channel, release the region context and clear the context pointer. Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype") Reviewed-by: Huisong Li Signed-off-by: Sudeep Holla Link: https://patch.msgid.link/20260922144302.3847593-4-sudeep.holla@kernel.org Signed-off-by: Rafael J. Wysocki [ sashal: kept the existing kzalloc(sizeof(*data), GFP_KERNEL) allocation line instead of upstream's kzalloc_obj(*data), which only affected the surrounding context. ] Signed-off-by: Sasha Levin commit 1649dbcdfb1b7e16ec863d45349295d397c62451 Author: Pardeep Kaur Date: Wed Aug 19 11:02:40 2026 +0530 wifi: ath12k: fix out-of-bounds access on TX stats arrays [ Upstream commit c8f83d3389d1d1b318ac3bd2ae3d60c2862c90b4 ] The fw_tx_status[], tx_wbm_rel_source[], and tqm_rel_reason[] arrays are indexed directly by values read from hardware without bounds checks. Values at or beyond MAX_FW_TX_STATUS, HAL_WBM_REL_SRC_MODULE_MAX, or MAX_TQM_RELEASE_REASON respectively would write past the end of the arrays causing memory corruption. Add likely() bounds checks before incrementing each counter. For tx_wbm_rel_source[] and tqm_rel_reason[], add WARN_ON_ONCE() on the out-of-bounds else branch. For fw_tx_status[], no WARN_ON_ONCE is added since the switch statement that follows already calls ath12k_warn() in its default: branch for unknown values, avoiding a double-warn. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6.r1-00402-QCAHKSWPL_SILICONZ-1 Fixes: c5c62287e690 ("wifi: ath12k: Add device dp stats support") Signed-off-by: Pardeep Kaur Reviewed-by: Rameshkumar Sundaram Reviewed-by: Baochen Qiang Link: https://patch.msgid.link/20260819053247.1420393-2-pardeep.kaur@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Applied the same three bounds checks to the pre-wifi7-split dp_tx.c and used ab->device_stats instead of dp->device_stats. ] Signed-off-by: Sasha Levin commit a453c6fa39d5f47d283c60e03e2eb7044dbc286c Author: Kang Yang Date: Wed Sep 16 14:03:24 2026 +0800 wifi: ath12k: fix skb leak on monitor PPDU ID wraparound [ Upstream commit 97b144b82e2388efef1f78269626d61de0480feb ] ath12k_dp_mon_comp_ppduid() updates *ppdu_id and returns msdu_ppdu_id to indicate that a PPDU transition was detected. When PPDU IDs wrap around, msdu_ppdu_id can be 0. In that case the function updates *ppdu_id but returns 0, causing ath12k_wifi7_dp_rx_mon_mpdu_pop() to interpret the result as "no PPDU update" and continue processing the MPDU. The MSDUs are then linked into head_msdu while their RX descriptors have already been detached. Later, ath12k_wifi7_dp_rx_mon_dest_process() detects the PPDU mismatch and exits with the partially built MSDU chain, leaking the SKBs. kmemleak reports the leak through: kmemleak_alloc() __netdev_alloc_skb() ath12k_dp_rx_bufs_replenish() ath12k_wifi7_dp_rx_mon_dest_process() Fix this by returning a boolean value from ath12k_dp_mon_comp_ppduid() so the update notification is independent of the actual PPDU ID value. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 72bfbf19b7da ("wifi: ath12k: add support to reap and process mon dest ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260916060325.854-6-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Kept the function static in dp_mon.c and dropped the header hunk, since this tree has no prototype; only the return type changed to bool. ] Signed-off-by: Sasha Levin commit 488d185727acda42ac8cad65c2ad2a5c841b38fa Author: Kang Yang Date: Wed Sep 16 14:03:23 2026 +0800 wifi: ath12k: place dp_mon_mpdu on stack in mon dst reap loop [ Upstream commit 8b1d2f4c3805b9f1bddd5dc3bd241edd1f9ab2d9 ] ath12k_wifi7_dp_rx_mon_dest_process() allocates a dp_mon_mpdu with kzalloc(GFP_ATOMIC) for each delivered MPDU. On allocation failure it breaks out of the reap loop without calling ath12k_hal_srng_dst_get_next_entry(), leaving the destination ring tail pointer parked on the current entry -- the same entry will be peek()ed on every subsequent NAPI schedule, stalling monitor RX until the mon_dest_ring_stuck_cnt recovery path resyncs the PPDU ID. The head_msdu chain accumulated for this iteration is also orphaned since the break bypasses both the delivery and the cleanup paths. kmemleak reports these skbs in field testing: kmemleak_alloc() __netdev_alloc_skb() ath12k_dp_rx_bufs_replenish() ath12k_wifi7_dp_rx_mon_dest_process() dp_mon_mpdu is used only within a single reap loop iteration and is passed synchronously to ath12k_wifi7_dp_mon_rx_deliver(); the callee does not retain the pointer. Place it on the stack instead of using kzalloc(GFP_ATOMIC). This eliminates the allocation failure path (and the ring stall it caused) and saves a kzalloc/kfree pair per delivered MPDU. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 72bfbf19b7da ("wifi: ath12k: add support to reap and process mon dest ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260916060325.854-5-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Replaced the kzalloc'd dp_mon_mpdu with a stack variable, adapted to the pre-wifi7-split file path and function names (ath12k_dp_mon_rx_deliver(ar, ...)). ] Signed-off-by: Sasha Levin commit 3b310cba823d61cbd18deb45c5e6819c477fa0e6 Author: Kang Yang Date: Wed Sep 16 14:03:22 2026 +0800 wifi: ath12k: fix stale tail_msdu pointer returned from mpdu_pop [ Upstream commit 1a10a558555072dba8510ded23a9174b2a00d079 ] ath12k_wifi7_dp_rx_mon_mpdu_pop() assigns *tail_msdu from the loop cursor msdu at function exit. That cursor reflects the state of the last msdu_list entry processed, not the end of the accumulated MSDU chain: on next_msdu paths (invalid skb, drop_mpdu, first-MSDU rx_desc invalid) it is set to NULL, and on the set_pktlen failure path it becomes a dangling pointer to a freed skb. When these occur on the final iteration, callers see head_msdu populated with a valid chain while tail_msdu is NULL or points to freed memory. The chain end is already tracked by the local variable last, which is updated only after each MSDU has been validated and linked. Use it as the source for tail_msdu so head_msdu and tail_msdu are either both NULL or both point into the same live chain. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 72bfbf19b7da ("wifi: ath12k: add support to reap and process mon dest ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260916060325.854-4-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Applied the one-line change to the pre-split dp_mon.c, using the old function name, since the wifi7 split of ath12k does not exist here. ] Signed-off-by: Sasha Levin commit 7e1740e12245e6c648fc378ddcd69f435e66a493 Author: Kang Yang Date: Wed Sep 16 14:03:21 2026 +0800 wifi: ath12k: free pending MSDUs on duplicate mon link descriptor [ Upstream commit d8e8eac3fcffc114a79f7d07d7cb73cc16645381 ] ath12k_wifi7_dp_rx_mon_mpdu_pop() aborts processing when a duplicate monitor link descriptor is detected. Previous iterations may already have linked MSDUs onto *head_msdu and detached the corresponding RX buffers from their descriptors. Returning without completing or freeing the chain leaves those skbs orphaned, resulting in a memory leak. kmemleak reports these skbs in field testing: kmemleak_alloc() __netdev_alloc_skb() ath12k_dp_rx_bufs_replenish() ath12k_wifi7_dp_rx_mon_dest_process() Free the accumulated MSDU chain before returning and clear *head_msdu so callers observe a consistent state. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 72bfbf19b7da ("wifi: ath12k: add support to reap and process mon dest ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260916060325.854-3-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Applied to the pre-split monitor RX file with the function name ath12k_dp_rx_mon_mpdu_pop() instead of the wifi7 path and name; the two-line change itself is identical. ] Signed-off-by: Sasha Levin commit 0e473e27d57b8b5c43f630341f5036a4ddcad26a Author: Kang Yang Date: Wed Sep 16 14:03:20 2026 +0800 wifi: ath12k: fix skb leak on paddr mismatch in wifi7 mon RX pop [ Upstream commit 4dfe8e3ac731c3372b5c1f1f73b0676c301c3916 ] When rxcb->paddr does not match the MSDU-list paddr reported by the link descriptor, ath12k_wifi7_dp_rx_mon_mpdu_pop() sets drop_mpdu = true and continues to the next MSDU. At that point the skb is still attached to the descriptor via desc_info->skb; the local msdu variable only holds a copy of that pointer. The continue skips the rest of the loop body, which would normally DMA-unmap the buffer, free the skb, clear desc_info->skb, and append the descriptor to used_list in the next_msdu block. The descriptor therefore stays in_use with the skb attached forever. The skb is never DMA-unmapped, delivered, freed or replaced, and HW does not write into it either because the descriptor is no longer posted to any SRNG. The descriptor is also never returned to used_list, so ath12k_dp_rx_bufs_replenish() cannot allocate a fresh buffer for it and the RX refill ring gradually drains. The skb is still reachable via dp->rxbaddr[][].skb and is reclaimed at teardown by ath12k_dp_cc_cleanup(), so this is not a kmemleak-style unreachable leak. Nevertheless, both the descriptor slot and the skb memory are wasted for the module lifetime, and under sustained mismatches monitor RX stalls. Remove the continue so drop_mpdu remains true, execution reaches the DMA unmap and dev_kfree_skb_any() below, and the descriptor is returned to used_list via the next_msdu block for replenish. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 72bfbf19b7da ("wifi: ath12k: add support to reap and process mon dest ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260916060325.854-2-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Renamed the file path from the wifi7 split (wifi7/dp_mon.c, ath12k_wifi7_dp_rx_mon_mpdu_pop) to ath12k/dp_mon.c with ath12k_dp_rx_mon_mpdu_pop; the one-line continue removal itself is unchanged. ] Signed-off-by: Sasha Levin commit 8d3b90e49526c3c54154f2929d6701d279aa6920 Author: Abel Vesa Date: Tue Sep 22 10:51:18 2026 +0300 arm64: dts: qcom: x1-asus-vivobook-s15: Mark the EC reset gpio as reserved [ Upstream commit 94a0d3a2595821878de98d495e89691f694a2083 ] GPIO 65 from TLMM is used by the embedded controller as its reset line. On some devices, toggling the embedded controller reset line makes the device not power up at all, unless the battery is unplugged. So reserve it in order to prevent Linux from requesting or reconfiguring it. Fixes: d0e2f8f62dff ("arm64: dts: qcom: Add device tree for ASUS Vivobook S 15") Signed-off-by: Abel Vesa Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-9-fde7f8a53382@oss.qualcomm.com Signed-off-by: Bjorn Andersson [ sashal: Applied the one-line GPIO 65 reservation to the single-file Vivobook S 15 devicetree, since the upstream shared .dtsi file does not exist here. ] Signed-off-by: Sasha Levin commit 4b42329695898049a61e015694da4a7c478310cd Author: Ian Rogers Date: Thu Sep 17 23:26:20 2026 -0700 perf machine: Add session back pointer to fix out of bounds read [ Upstream commit d227b45fc162ce9134bb96f33f71e6952ec36ea5 ] thread__e_machine_endian() decides whether a thread is live, and so whether to read /proc/pid/exe rather than fall back to the perf.data environment, by recovering the session from the machine: session = container_of(machine->machines, struct perf_session, machines); is_live = !session->data; That only holds when the struct machines is the one embedded in a struct perf_session. It is not the only one. aslr_tool keeps its own in struct aslr_tool, and hists_cumulate, hists_filter, hists_link, hists_output and thread-maps-share each put one on the stack. For those the container_of subtracts offsetof(struct perf_session, machines) from an address that was never inside a session, and the following load of session->data reads outside the object, which is what ASan reports. Replace the derivation with an explicit link. machines__init() takes the owning session, or NULL when the machines is standalone, and thread__e_machine_endian() reads it back through machines__session(). A NULL session is treated as live. The tests use synthetic pids that have no /proc entry, so the read fails there and the e_machine falls back to EM_HOST as before, rather than being decided by whatever the out of bounds read happened to return. perf inject registers its session with the aslr tool once the session exists, before any event is processed, so that tool keeps reporting file based threads as not live. Fixes: 70351029b556 ("perf thread: Add support for reading the e_machine type for a thread") Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo [ sashal: adapted to machines__init() returning void and dropped the ASLR hunks since that code is absent, so the test callers pass NULL as a plain statement. ] Signed-off-by: Sasha Levin commit 6cf5184cef19de8dab99abda819a99df3c24b7ca Author: Michael J. Ruhl Date: Wed Sep 23 11:11:16 2026 -0700 platform/x86/intel/pmt: complete pcidev to device update [ Upstream commit b86e5062cb881f6e5c1ddb8913c1357a9508f6db ] The update that moved struct pci_dev usage to struct device is incomplete. Only telemetry endpoints are covered. Other PMT features (crashlog) are now blocked from using the callback mechanism. Change struct intel_pmt_entry pci_dev member to device. Update callback usage to use the intel_pmt_entry rather than the telemetry endpoint. Reviewed-by: Rodrigo Vivi Fixes: 353042d54d82 ("platform/x86/intel/vsec: Switch exported helpers from pci_dev to device") Signed-off-by: Michael J. Ruhl Link: https://patch.msgid.link/20260923181115.2514193-23-michael.j.ruhl@intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen [ sashal: Removed the entry->pcidev = pci_dev; line from the single intel_pmt_populate_entry() here, since this tree lacks upstream's pmt_resolve_access_pci() split, and added entry->dev there. ] Signed-off-by: Sasha Levin commit 9797c6738718dadcf3d0fe8b303182add22a9ccc Author: Joanne Koong Date: Thu Sep 3 21:56:51 2026 -0700 fuse: zero the correct range on a short read reply [ Upstream commit d0a079b5b94bf5e10f1c00bd092eda0333782037 ] When a read reply is shorter than the requested range, fuse_copy_folio() zeroes everything in the folio outside the copied bytes. However, for folios with block sizes smaller than the folio size, this can clear blocks outside the requested range which are uptodate, or dirty and have not yet been written back. Move the zeroing logic into fuse_copy_folios(), since descs[i].length needs to be used, and clear only the tail of the requested range that the server did not send. The range is also no longer cleared upfront in the non cs->skip_folio_copy case. This is fine since a failed copy leaves those blocks non-uptodate, so the uncopied bytes are never visible. This also matches the pre-existing behavior in the non-short-read case (a failed copy doesn't zero out the range in the folio). This lets the zeroing logic stay the same regardless of whether the folio copy is skipped or not. Fixes: a4c9ab1d4975 ("fuse: use iomap for buffered writes") Reported-by: Sashiko Reported-by: Kanishka De Silva Signed-off-by: Joanne Koong Signed-off-by: Miklos Szeredi [ sashal: Moved zeroing into fuse_copy_folios() in dev.c, kept fuse_copy_folio() static so the dev.h hunk is dropped, and omitted the skip_folio_copy/folio_zero_segments logic that isn't present here. ] Signed-off-by: Sasha Levin commit e81530cbce0b751936d962cabe43a8436aaae109 Author: Hao Sun Date: Fri Sep 25 10:28:13 2026 +0200 bpf: Fix uninit read for helper mem args on partially spilled slots [ Upstream commit b3861495d2b2f7459cddf49e63fa0758ba430583 ] check_stack_range_initialized() takes the spilled register path when bpf_is_spilled_reg(ss) holds, which, however, only looks at the last byte of the slot. Hence, a partially spilled scalar (on the lower part) bypasses the check and the following loads: 0: (b7) r1 = 1 ; R1=1 1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1 2: (18) r1 = 0x0 ; R1=map_ptr(map=rb,ks=0,vs=0) 4: (bf) r2 = r10 ; R2=fp0 R10=fp0 5: (07) r2 += -8 ; R2=fp-8 6: (b7) r3 = 8 ; R3=8 7: (b7) r4 = 0 ; R4=0 8: (85) call bpf_ringbuf_output#130 ... When executed, it dumps the uninit four bytes: RINGBUF: 01 00 00 00 ff ff ff ff This is the same root cause as the non-fetch atomic case fixed in commit 5a84b4424db8 ("bpf: Fix uninit read for non-fetch atomics on partially spilled slots"). Fix by only taking the spilled register path for the bytes marked STACK_SPILL, so the rest of the slot goes through the usual checks. Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill") Suggested-by: Kumar Kartikeya Dwivedi Signed-off-by: Hao Sun Link: https://lore.kernel.org/bpf/20260925082814.1554771-1-sunhao.th@gmail.com Signed-off-by: Kumar Kartikeya Dwivedi [ sashal: Context lines differ because the target tree still uses is_spilled_reg() on state->stack[spi] where upstream uses bpf_is_spilled_reg(ss); the patch was applied by hand with identical added and removed lines. ] Signed-off-by: Sasha Levin commit a2021a80256fe24a2146718033600b3a19fb1f24 Author: Hao Sun Date: Thu Sep 24 15:13:41 2026 +0200 bpf: Fix uninit read for non-fetch atomics on partially spilled slots [ Upstream commit 5a84b4424db8ae07f0ac682ab031c37a91dce50b ] check_stack_read_fixed_off() skips partial spill checks for non-fetch atomics; the following prog can be loaded: 0: (b7) r1 = 1 ; R1=1 1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1 2: (db) lock *(u64 *)(r10 -8) += r1 ; R1=1 R10=fp0 fp-8=mmmmmmmm 3: (79) r0 = *(u64 *)(r10 -8) ; R0=scalar() R10=fp0 fp-8=mmmmmmmm 4: (77) r0 >>= 32 ; R0=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) 5: (95) exit When test run: retval=4294967295 Note fp-8 is ????1 at #1, yet it becomes fp-8=mmmmmmmm after the non-fetching atomic add at #2; hence the high 32 bits are leaked. Fix by applying the partial load check; after the patch, the prog is rejected: Verification failed: Memory Safety: Uninitialized stack read Reason: This rejected read uses 8 bytes at stack offset -8, but byte 4 in that range is uninitialized on this path. Programs loaded with CAP_PERFMON can be allowed to read uninitialized stack bytes, but this program is being rejected without that allowance. At: ... 0 | (b7) r1 = 1 1 | (63) *(u32 *)(r10 -8) = r1 >>> 2 | (db) lock *(u64 *)(r10 -8) += r1 3 | (79) r0 = *(u64 *)(r10 -8) 4 | (77) r0 >>= 32 This affects CAP_BPF only. Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill") Signed-off-by: Hao Sun Link: https://lore.kernel.org/bpf/20260924131342.934290-1-sunhao.th@gmail.com Signed-off-by: Kumar Kartikeya Dwivedi [ sashal: Context lines differ because the target tree has an older subreg_def comment block where upstream has a get_reg_width() check; the patch was applied by hand with identical added and removed lines. ] Signed-off-by: Sasha Levin commit fe416645a7c67cd7d1127ea707e7027145ddf2c5 Author: Alexei Starovoitov Date: Thu Sep 24 23:31:29 2026 +0000 bpf: Don't converge a loop on an iterator that was created anew [ Upstream commit 6f3ee3516305da3043f1787e3890381a54151730 ] When the verifier reaches bpf_iter_*_next() in a state that is equal to a state that is still being explored it concludes that the loop converged, since an active iterator will be drained eventually. states_equal() matches ids through idmap, so the same is concluded for an iterator that was destroyed and created again since the old state: bpf_iter_num_new(&it, 0, 10); loop: if (bpf_ktime_get_ns()) goto remake; next: if (!bpf_iter_num_next(&it)) goto out; goto loop; remake: bpf_iter_num_destroy(&it); bpf_iter_num_new(&it, 0, 10); goto next; Such prog is accepted when the call of bpf_iter_num_next() is the first prune point after bpf_iter_num_new() and it never returns. Otherwise it's rejected with "infinite loop detected". Require the iterator to have the same id in both states. Fixes: 06accc8779c1 ("bpf: add support for open-coded iterator loops") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260924233130.1213812-8-alexei.starovoitov@gmail.com [ sashal: Compares ref_obj_id instead of id for iterator identity, since iterators have no id here, and applies the check in is_state_visited() in the old verifier layout with old_frame added to the existing declaration. ] Signed-off-by: Sasha Levin commit cd6f4f06637dff4df789ff733585c93ddbec8fb8 Author: Alexei Starovoitov Date: Thu Sep 24 23:31:27 2026 +0000 bpf: Fix overflow of jump offset in may_goto expansion [ Upstream commit 8a12a00f6c5dba70a6d908fe27a3c980d42b9515 ] may_goto is expanded into 'if AX == 0 goto off + 5' when it's timed, off + 2 when it's not and off - 1 when it jumps backward. The sum is stored into 16-bit off without a range check, so may_goto +32763 turns into: if r12 == 0x0 goto pc-32768 and the prog jumps backward when may_goto expires. Emit 'if AX != 0 goto +1; gotol' when the offset doesn't fit and compute the offset from the number of insns in the expansion. JITs that don't support gotol will reject such prog. Fixes: 011832b97b31 ("bpf: Introduce may_goto instruction") Fixes: e723608bf428 ("bpf: Add verifier support for timed may_goto") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260924233130.1213812-6-alexei.starovoitov@gmail.com [ sashal: Ported the may_goto overflow fix into verifier.c, since this tree has no fixups.c, and used the older do_misc_fixups() and is_may_goto_insn() names. ] Signed-off-by: Sasha Levin commit e76fc81e1f1494ee117be80ce843737aa7957371 Author: Alexei Starovoitov Date: Thu Sep 24 23:31:25 2026 +0000 bpf: Adjust pc-relative insn copied into its own patch [ Upstream commit 67a3b916a7ae7c1a6bed08555417d444de6f5838 ] bpf_do_misc_fixups() inits may_goto count by patching the first insn of a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses() patches insn that needs a barrier with [nospec, insn]. bpf_adj_branches() doesn't adjust insns inside the patch, so when the copy is a call, ld_imm64 of a func or a jump that points backward its target is off by the number of insns in front of it: static int A(void) { return 1; } static int A2(void) { return 2; } static int B(void) { int i, ret = A(); for (i = 0; i < 10 && can_loop; i++) ... return ret; } When A is placed in front of B and may_goto is timed 'call A' becomes call of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise the prog is rejected with "verifier bug: No program to jit at insn". Add bpf_adj_moved_insn() and use it for both copies. Fixes: 011832b97b31 ("bpf: Introduce may_goto instruction") Fixes: d6f1c85f2253 ("bpf: Fall back to nospec for Spectre v1") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260924233130.1213812-4-alexei.starovoitov@gmail.com [ sashal: Applied the changes to kernel/bpf/verifier.c instead of fixups.c, using the local function names convert_ctx_accesses() and do_misc_fixups() in place of the bpf_-prefixed upstream ones. ] Signed-off-by: Sasha Levin commit 1545deb8c5266812cfb4f355fbdb8436bbae83bb Author: Alexei Starovoitov Date: Thu Sep 24 23:31:23 2026 +0000 bpf, x86: Fix timed may_goto with private stack [ Upstream commit bb83425b3cdcb7bb3c629598a4d5efad9cc80733 ] arch_bpf_timed_may_goto() computes the address of count and timestamp as rbp + offset. When the prog uses private stack the JIT maps r10 to r9 and nothing is reserved under rbp, so bpf_check_timed_may_goto() reads and writes the timestamp in the kernel stack, where arch_bpf_timed_may_goto() has just saved r0-r5 or further down. The following loop in fentry prog with r0-r5 set to zero: 1: may_goto +2 r6 += 1 goto 1b leaves r3 with ktime in it when the prog has 64 bytes of stack and ends after 65535 iterations when it has 128. Add the frame pointer to the offset in the JIT, where rbp vs r9 is known, and pass the pointer in AX. arm64 and powerpc JITs keep the address of private stack in BPF_REG_FP and are not affected. Fixes: 2fb761823ead ("bpf, x86: Add x86 JIT support for timed may_goto") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260924233130.1213812-2-alexei.starovoitov@gmail.com [ sashal: Dropped the absent kfunc-argument block from the hunk's context, so the new timed may_goto add-frame-pointer code is inserted right after the !imm32 check. ] Signed-off-by: Sasha Levin commit cb9ce921460fbc979d1741c1cabeaa9be3a46f88 Author: bui duc phuc Date: Mon Sep 7 19:03:10 2026 +0700 ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register [ Upstream commit 6cddf6e56d2539fd13c0ee9dd817c4e06a967173 ] devm_add_action_or_reset() is called after the loop that registers gate clocks. If kzalloc() fails mid-loop, the function returns -ENOMEM before that call, so cleanup is never registered and all previously registered clocks leak permanently. Move devm_add_action_or_reset() before the loop so cleanup is always scheduled. The clock from the current (failing) iteration is not yet stored in afe_priv->lookup[i], so it still needs an explicit clk_unregister_gate() call. Fixes: fd67a7a1a22c ("ASoC: mediatek: mt8188: fix use-after-free in driver remove path") Signed-off-by: bui duc phuc Reviewed-by: Cezary Rojewski Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20260907120310.135693-8-phucduc.bui@gmail.com Signed-off-by: Mark Brown [ sashal: Kept the branch's existing kzalloc(sizeof(*cl), GFP_KERNEL) in the context lines instead of upstream's kzalloc_obj(*cl), since that helper isn't available here. ] Signed-off-by: Sasha Levin commit 053454880a3d4c5ad657327948a73ba78a4b438e Author: Puranjay Mohan Date: Thu Sep 24 09:26:06 2026 -0700 bpf: Look at frame 0 when telling async callback entries apart [ Upstream commit e55220162aae99622d9e80d4700e51c13a6f2a16 ] push_async_cb() sets in_async_callback_fn and async_entry_cnt on the callback's own frame, which is frame 0 of the fresh state it starts, and setup_func_entry() copies neither, so a subprog called by the callback carries neither. Two places read them from the innermost frame instead. is_state_visited() skips the infinite loop check when two states differ in async_entry_cnt, because seeing the same state on a second entry into an async callback is not a loop. A callback which re-arms itself and calls a subprog therefore compares the two entries at a loop inside that subprog, where the innermost frame is the subprog's and has no flag set, and the state is rejected: infinite loop detected at insn 60 push_callback_call() numbers a new entry as the caller's count plus one. When the callback re-arms itself from a subprog, the caller is that subprog's frame with a count of 0, so every entry is numbered 1, the check above never sees a difference, and a loop anywhere in such a callback is rejected the same way. Read the flag and the count from frame 0 in both places. A loop within a single entry still has a matching count and is still caught, and frame 0 of a non-async state does not have the flag set, so nothing else changes. The two other readers are already correct: check_return_code() reads frame[0], and the one in do_check() is reached only after an early return for curframe != 0. Fixes: bfc6bb74e4f1 ("bpf: Implement verifier support for validation of async callbacks.") Signed-off-by: Puranjay Mohan Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20260924162609.1746610-2-puranjay@kernel.org [ sashal: Ported the is_state_visited() hunk into kernel/bpf/verifier.c because the state-pruning code hasn't been split out into states.c in this tree; the push_callback_call() hunk applied unchanged. ] Signed-off-by: Sasha Levin commit 31594d4872dfdbad767e67fcc74bcd0a31f02150 Author: Kumar Kartikeya Dwivedi Date: Thu Sep 24 09:53:49 2026 +0200 bpf: Check fastcall stack contract once for all stack accesses [ Upstream commit ec3a69e7c021cd826be8886ba6af4ee3147788fb ] When the verifier inlines a bpf_fastcall helper or kfunc, it removes the spill/fill pairs that clang emitted around the call and lowers the subprogram's stack depth so that their slots are no longer part of the frame. This is only safe if nothing else accesses those slots or any slot below them. check_fastcall_stack_contract() enforces this: an access to that region from outside a fastcall pattern disables the rewrite for the subprogram. It is called from the four stack load and store paths, and two kinds of access escape it. Stack buffers passed to helpers and kfuncs are validated by check_stack_range_initialized(), which does not call it. If such a buffer is the only other access to the region, the rewrite is still applied, the JIT reserves a frame that does not contain the buffer, and the helper reads or writes live kernel stack below the program's frame. For example, without CAP_PERFMON: *(u64 *)(r10 - 8) = r1; call bpf_get_smp_processor_id; r1 = *(u64 *)(r10 - 8); r2 = 0; r3 = r10; r3 += -64; r4 = 8; call bpf_skb_load_bytes; is accepted with a stack depth of 0 instead of 64. Some buffers got the check indirectly. For constant-sized outputs in raw mode, mark_raw_stack() marks the buffer initialized through ordinary byte stores, which call the check. Commit 5da4a9f26fca ("bpf: Preserve stack initialization for generic output buffers") limited raw mode to programs that may read uninitialized stack, so outputs of programs without CAP_PERFMON lost the check, as in the example above. Buffers that never used raw mode have lacked the check since fastcall support was added: helper inputs such as a map key whose only store is a fastcall spill, variable-sized outputs, and buffers at a variable stack offset. check_stack_read_fixed_off() applies the check to the current frame, even when the pointer targets a caller's stack. A callee can therefore read a caller's fastcall spill slot without disabling the caller's rewrite: caller: r1 = 1; *(u64 *)(r10 - 8) = r1; call bpf_get_smp_processor_id; r1 = *(u64 *)(r10 - 8); r1 = r10; r1 += -8; call callee; callee: r0 = *(u64 *)(r1 + 0); The caller's spill and fill are removed and its stack depth drops to 0, but the verifier still tracks the slot as holding the spilled constant. The callee's load then reads kernel stack outside the caller's frame, while the verifier assumes r0 is 1. Every stack access first goes through check_stack_access_within_bounds(): loads and stores from check_mem_access(), helper and kfunc buffers from check_stack_range_initialized(), and the dynptr, iterator and irq flag slots that kfuncs initialize, whose handlers use check_mem_access(). It resolves the frame that owns the slots and the lowest offset the access can touch, and it is the only place where a frame's stack depth grows. Check the contract there, once for every access, and drop the calls from the stack read and write paths. Zero-sized buffers touch no stack and leave the rewrite enabled. Fixes: 5b5f51bff1b6 ("bpf: no_caller_saved_registers attribute for helper calls") Fixes: 5da4a9f26fca ("bpf: Preserve stack initialization for generic output buffers") Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/85f9995a43edb70c76615280e103dc5325742e88330f36c97962ee35f17e3e32@mail.kernel.org Link: https://patch.msgid.link/20260924075352.2343553-2-memxor@gmail.com [ sashal: Removed the four old fastcall stack-contract calls and added the single check in check_stack_access_within_bounds(); the code matches upstream, with only hunk context adjusted for surrounding code that differs. ] Signed-off-by: Sasha Levin commit e76d6740254afede99334d965ea9b22c4b34a30b Author: Lizhi Hou Date: Wed Sep 23 13:05:01 2026 -0700 accel/amdxdna: Preallocate hardware context schedulers [ Upstream commit f7afecd54296cf7ad6fa36f692d2a7427e32f25d ] The hardware context scheduler fence is exposed through drm_syncobj_add_point(). After a hardware context is destroyed, userspace can still call drm_sched_fence_get_timeline_name() on the fence through SYNC_IOC_FILE_INFO. This results in a use-after-free when accessing fence->sched->name. Preallocate hardware context schedulers and free them during device teardown instead. A destroyed hardware context no longer frees its scheduler, ensuring that the scheduler remains valid while its fences are still accessible. Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Reported-by: Jonghyuk Kim(MalHyuk) Link: https://lore.kernel.org/dri-devel/20260902012712.880520-1-malhyuk97@gmail.com/ Reviewed-by: Max Zhen Signed-off-by: Lizhi Hou Link: https://patch.msgid.link/20260923200501.281208-1-lizhi.hou@amd.com [ sashal: Adapted to the older tree by using ndev->xdna, a single firmware-load failure path that unwinds the scheduler init, and dropping the duplicate ndev declaration and assignment in the hwctx functions. ] Signed-off-by: Sasha Levin commit 9e546376544a2af3dcdc5656877f1124db47f6cc Author: Charles Keepax Date: Fri Sep 4 14:12:43 2026 +0100 mfd: cs42l43: Move cancel_work_sync() into remove [ Upstream commit 86bcfdc6f1e1f8943fbe12256b3c89a66ebbad03 ] The cs42l43 driver kicks off a work item waiting for the device to appear on the SoundWire bus, once the device appears the MFD children are added and the clean up is then done through devres. As the work is synchronised in from the devres clean up this could lead to new devres items being added after the clean up has started, if the driver is removed before the work has fully completed. The work should be synchronised before any devres clean up is started. Fixes: 0f35dc4bd50d ("mfd: cs42l43: Use devres for remove as well") Signed-off-by: Charles Keepax Link: https://patch.msgid.link/20260904131243.755201-1-ckeepax@opensource.cirrus.com Signed-off-by: Lee Jones [ sashal: changed cs42l43_sdw_remove() to return int with return 0, since this tree's sdw_driver remove callback is not void. ] Signed-off-by: Sasha Levin commit 0743d6510161be50143e52cb91fccd4868f7f048 Author: Yuan Chen Date: Thu Sep 24 10:37:36 2026 +0800 bpf: Keep target extended until its last freplace link detaches [ Upstream commit c43c348a84460b003fa757dd43d8c89848ae220d ] The is_extended / prog_array_member_cnt protocol introduced by commit d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace") keeps a prog extended by a freplace program out of prog_array maps, and vice versa: once a tail call re-enters an extended subprogram, its tail_call_cnt resets on every execution and the loop never terminates. But is_extended is a plain boolean, while one target prog can carry several freplace links at the same time, one on its entry and one on a global subprogram. __bpf_trampoline_unlink_prog() cleared is_extended whenever *any* freplace link detached, so detaching one of two links re-armed the unbounded loop through the remaining one. Replace the is_extended boolean with a count of the freplace links attached to each target prog, so the target stays extended until its last link detaches. Also rename bpf_freplace_check_tgt_prog() to bpf_freplace_link_tgt_prog(), as the helper has never been a pure check: it reserves the target prog on success. Fixes: d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace") Signed-off-by: Yuan Chen Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20260924023737.1140521-2-chenyuan_fl@163.com Signed-off-by: Kumar Kartikeya Dwivedi [ sashal: adjusted context in include/linux/bpf.h, where neighboring struct members differ, and in the trampoline code, which still uses the older bpf_tramp_link layout. ] Signed-off-by: Sasha Levin commit 63138be74b88f92b4b84f6bd40da2b127731cdd2 Author: Tate Whiteberg Date: Mon Aug 31 16:59:08 2026 +0000 serial: 8250_mid: wait for LSR tx empty before setting termios [ Upstream commit 1c305d5f1daabd317a60b6a2e2ac6b1aff7e05df ] If mid8250_set_termios is called while data is still in transmission, the corresponding register updates will corrupt the transmission. Fix this by locking the port and and waiting for the transmitter to empty before performing updates. It is necessary to wait for both UART_LSR_THRE and UART_LSR_TEMT to ensure the final character is sent. Fixes: f549e94effa1 ("serial: 8250_pci: add Intel Penwell ports") Signed-off-by: Tate Whiteberg Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/20260831165911.2029839-3-whiteberg@arista.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit 6e15a84c4d7ccad7d4be124755271fd3557952af Author: Tate Whiteberg Date: Mon Aug 31 16:59:07 2026 +0000 serial: 8250: export and rename wait_for_xmitr() [ Upstream commit 2c5942fd0300cb966339dd0366890be626b405e8 ] Export wait_for_xmitr() and rename it to follow naming convention. Signed-off-by: Tate Whiteberg Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/20260831165911.2029839-2-whiteberg@arista.com Signed-off-by: Greg Kroah-Hartman Stable-dep-of: 1c305d5f1daa ("serial: 8250_mid: wait for LSR tx empty before setting termios") Signed-off-by: Sasha Levin commit 7eb8b19a140ac4feeb0acb2b3e7077fc8c5fbef6 Author: Ahsan Atta Date: Fri Sep 18 13:41:11 2026 +0100 crypto: qat - hold cfg->lock when accessing config sections [ Upstream commit cb3a1364fed9ea7b063e3ae026177a145abb5940 ] adf_cfg_sec_find() walks the per-device section list without holding cfg->lock, and the returned section pointer is used later under the lock. A concurrent section deletion under cfg->lock (adf_cfg_del_all_except() on device down, or adf_cfg_dev_remove() on removal) can free the section first, leading to a use-after-free. The debugfs dev_cfg reader has the same problem: qat_dev_cfg_show() walks both the section list and each section's param_head under the global qat_cfg_read_lock mutex, not the per-device cfg->lock used by the add and delete paths, so the two do not serialise. Updating an existing key frees the old key_val under cfg->lock, so even a config write concurrent with an open dev_cfg read can free an entry mid-walk, a wider window than section deletion alone. Take cfg->lock around the section lookup in adf_cfg_add_key_value_param() and around the lookup and insert in adf_cfg_section_add(), and use down_read()/up_read(&cfg->lock) in the debugfs start/stop callbacks. Remove the now-unused qat_cfg_read_lock. While here, return -ENOENT rather than -EFAULT when the section is not found; EFAULT (bad userspace address) is not meaningful for this case. Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework") Signed-off-by: Ahsan Atta Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu [ sashal: Replaced the new kzalloc_obj(*sec) allocator call with this tree's existing kzalloc(sizeof(*sec), GFP_KERNEL) in adf_cfg_section_add(). ] Signed-off-by: Sasha Levin commit f28dff948a91581008c9813f6478939889c676cf Author: Kim Wooseok <5mghybrid@khu.ac.kr> Date: Mon Sep 21 16:59:51 2026 +0900 wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors [ Upstream commit 2f77c66694108785a1f6ae6c5de06453e7f7a91f ] rtl8xxxu resubmits completed RX requests when more than eight URBs are waiting on the pending list. It starts with 32 URBs, but frees them on completion errors. After enough errors, the remaining pool can no longer reach the submission threshold. Reception then stays stopped even after the errors end. Temporary submission failures can leave a small batch waiting with no further work scheduled, too. Keep the URB when a completion reports EPROTO, EILSEQ, ETIME, EOVERFLOW, ECOMM or ENOSR. Free its receive buffer and return the request to the same pending list used by normal completions. ENOMEM/EAGAIN from startup or worker submission uses this path as well, so a submission failure cannot strand a request during recovery. Use one delayed work item to submit the pending requests. An error queues a retry after 100 ms without moving an existing reservation back. If a normal completion takes the pending count above eight, mod_delayed_work(..., 0) brings the work forward. This limits repeated retries when reception is not progressing, while allowing normal traffic to replenish the pool promptly. The 100 ms delay is therefore not a minimum wait for each failed URB. Keep the shutdown check, queue insertion and scheduling under the RX lock. Stop sets shutdown under that lock, cancels the delayed work synchronously, then drains active and pending requests. Cancellation and device removal continue to free their URBs. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Assisted-by: GPT-6 Astra Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr> Reviewed-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-3-eeb09fe8f791@khu.ac.kr Signed-off-by: Sasha Levin commit 29c3da645c759b12147f9509b6aa638edebb7750 Author: Kim Wooseok <5mghybrid@khu.ac.kr> Date: Mon Sep 21 16:59:50 2026 +0900 wifi: rtl8xxxu: unwind incomplete receive startup [ Upstream commit 4c58fb8944a2cfbe5506534de0cf58646408d31a ] rtl8xxxu_start() allocates and submits RX URBs one at a time. If a later allocation fails, the error path frees the TX pool but leaves earlier RX requests active. A partial TX or RX allocation failure can also leave ret at zero, so start reports success despite the incomplete setup. Allocate the RX pool before submitting any of it, and return ENOMEM whenever a pool allocation fails. Pass start errors through rtl8xxxu_stop(), including interrupt URB submission failures, so the existing stop path cancels work and releases both active requests and partially allocated pools. Share the submission loop with the RX worker. Both callers keep requests that fail with ENOMEM/EAGAIN. For a fatal error during startup, free the rest of the unsubmitted batch and return the error so start can unwind. In the worker, free only the failed request and continue with the rest of the batch. Keep the allocation loop in a small helper so the setup and error paths in start remain easy to follow. On an RTL8192EU, I exercised every error exit in rtl8xxxu_start() except interrupt-URB allocation and submission failures, which this adapter does not use. Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Assisted-by: GPT-6 Astra Reviewed-by: Ping-Ke Shih Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr> Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-2-eeb09fe8f791@khu.ac.kr [ sashal: Replaced kmalloc_obj(struct ...) calls with the older kmalloc(sizeof(struct ...), GFP_KERNEL) form, since the kmalloc_obj macro doesn't exist in this tree. ] Signed-off-by: Sasha Levin commit e0db3575de093f1124ae9eae52304489e1583599 Author: Adrian Hunter Date: Sun Sep 20 18:12:39 2026 +0300 i3c: mipi-i3c-hci: Process multiple IBIs per interrupt [ Upstream commit 5fbd0790af9484c251341e3ba2ebbb2887c570c8 ] INTR_IBI_READY indicates that one or more IBI Status Descriptors are present in the IBI ring. After clearing interrupt status, the interrupt handler processes only a single IBI even though additional IBIs may already be queued. The controller does not reassert INTR_IBI_READY solely because entries remain in the ring after interrupt status has been cleared. Consequently, the remaining IBIs are not processed until some later interrupt occurs, and can accumulate if IBIs arrive more often than the interrupt handler runs. Process all IBIs that are pending when the handler runs: capture the IBI enqueue pointer up front and continue until the dequeue pointer reaches that position. Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver") Signed-off-by: Adrian Hunter Reviewed-by: Frank Li Link: https://patch.msgid.link/20260920151248.46936-10-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni [ sashal: adjusted the IBI dequeue-pointer update to keep this tree's hci->lock and re-read RING_OPERATION1 under the lock, since upstream dropped that locking. ] Signed-off-by: Sasha Levin commit f97a85e71616c6c3460d913c66e44684a84df32e Author: Cristian Ciocaltea Date: Sun Nov 22 17:43:08 2026 -0500 drm/connector: hdmi: Handle reset() state allocation failure [ Upstream commit 54acd0c74eba2a2c9a726856f5fdc6f9e74ea2e1 ] In drmm_connector_hdmi_init(), if the reset callback fails to allocate memory, e.g. inside drm_atomic_helper_connector_reset(), connector->state will remain NULL. This is unconditionally passed to drm_connector_attach_max_bpc_property(), leading to a NULL pointer dereference. Bail out with -ENOMEM if the reset callback leaves connector->state unset. Fixes: aadb3e16b8f3 ("drm/connector: hdmi: Add output BPC to the connector state") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260723015306.C94241F000E9@smtp.kernel.org/ Link: https://lore.kernel.org/all/20260723015306.C94241F000E9@smtp.kernel.org/ Reviewed-by: Maxime Ripard Tested-by: Igor Paunovic # RK3588 Orange Pi 5 Plus, dual HDMI Tested-by: Robin Räber Link: https://patch.msgid.link/20260901-dw-hdmi-qp-scramb-v11-2-bc12954a0688@collabora.com Signed-off-by: Cristian Ciocaltea [ sashal: Added braces around the single-statement reset branch in drmm_connector_hdmi_init() to fit this tree's code, which lacks the earlier two-arm if/else context. ] Signed-off-by: Sasha Levin commit 28b37988e2f097a7e5d564cc28b06f9e6b74a850 Author: Ian Rogers Date: Wed Sep 16 22:04:49 2026 -0700 perf dso: Separate libbfd and cmd addr2line caches to fix confusion [ Upstream commit f651c02755af85324ad029cd948a8e570d0769fb ] When a dso executes addr2line via libbfd it instantiates an a2l_data pointer. If the DSO later executes via the command-line fallback due to an inlined bug, the a2l pointer is unconditionally populated with a child_process process wrapper. If libbfd is queried again, the offline reader attempts to cast struct a2l_data into child_process, coercing random arbitrary instruction addresses and causing silent aborts. This cleanly splits the caches. Fixes: 257046a36750a6db ("perf srcline: Fallback between addr2line implementations") Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Arnaldo Carvalho de Melo [ sashal: Adapted to a tree where dso__set_symsrc_filename() is a plain inline setter and libbfd__addr2line() is unlocked, so the symsrc cache-free and lock context were left out. ] Signed-off-by: Sasha Levin commit 8a36f2ea4d0f0dc47c7cd72aad5a0c4d1387a615 Author: Vitaliy Sochnev Date: Tue Sep 15 20:41:28 2026 +0100 thermal/drivers/airoha: Request the EN7581 IRQ after zone registration [ Upstream commit 7efceedd23678cd58e98b2c64d4b2b7be03f6cf9 ] The EN7581 IRQ is requested before the thermal zone is registered, and the handler passes priv->tz to thermal_zone_device_update(). Unbind leaves the monitor interrupt enabled, so an interrupt pending on the next bind fires while priv->tz is NULL. On a Nokia XG-040G-MD this oopses in thermal_zone_device_update(). On unbind, devres also frees the zone before the IRQ. Request the IRQ in post_probe, after zone registration. Fixes: 42de37f40e1b ("thermal/drivers: Add support for Airoha EN7581 thermal sensor") Signed-off-by: Vitaliy Sochnev Signed-off-by: Daniel Lezcano Link: https://patch.msgid.link/20260915194128.42508-1-sochnev.v.74@gmail.com [ sashal: Moved the IRQ request to after thermal zone registration in the single probe function, since this tree lacks the split post_probe and regmap code, keeping the local handler name and dev_err. ] Signed-off-by: Sasha Levin commit e46c57c6503eeee46d925b2e09f963a5faa813f4 Author: Guixin Liu Date: Mon Aug 31 14:11:20 2026 +0800 cxl/region: Unregister the pmem region when the bridge is unbound [ Upstream commit bb26797c08d408ea7e8d3625045f0fe28714a425 ] Removing cxl_acpi unbinds the nvdimm bridge before the regions it serves. A region probe can therefore register its cxl_pmem_region and only then find the bridge unbound, which leaves the new device with nothing to remove it. The orphan outlives the teardown and pins its region and its memdevs, so a later cxl_acpi bind renumbers the root port, ports, endpoints, decoders and the memdev. Unregister the cxl_pmem_region when the bridge is unbound. Found by code inspection. Racing a cxl_region bind against a cxl_acpi unbind leaked a pmem_region device on 12 of 12 attempts, and none with this patch. Fixes: f17b558d6663 ("cxl/pmem: Refactor nvdimm device registration, delete the workqueue") Signed-off-by: Guixin Liu Reviewed-by: Richard Cheng Reviewed-by: Li Ming Reviewed-by: Dave Jiang Link: https://patch.msgid.link/20260831061120.200790-1-kanie@linux.alibaba.com Signed-off-by: Dave Jiang [ sashal: Relocated the hunk from the split-out pmem region file into the region file where the function still lives; the hunk content is otherwise unchanged. ] Signed-off-by: Sasha Levin commit 3c79f3c0be9d08928461d530d24c014386075a7d Author: Guixin Liu Date: Mon Aug 31 17:22:15 2026 +0800 cxl/cdat: Fix uninitialized stack use in bandwidth gathering [ Upstream commit 97b74de26c81885a6447f5fe87641a2a136f8c7c ] cxl_endpoint_gather_bandwidth() and cxl_switch_gather_bandwidth() declare access_coordinate arrays on the stack and rely on their helpers to fill them. The helpers assign only the bandwidth members, and the combine step assigns even those only when both inputs are non-zero. The latency members are summed from stack residue on every call, and the bandwidth members keep that residue into the region access coordinate sysfs attributes when the endpoint CDAT reports no bandwidth. Zero initialize the arrays. Zero is the value this code already uses for "not reported", so an unset member now reads back as unknown rather than as a plausible number. Found by code inspection. Tested on a QEMU CXL topology with two endpoints sharing a switch upstream link and HMAT generic-port coordinates for the host bridge, which the calculation requires to run at all: with temporary printk at the combine sites, the unpatched kernel summed 0xfefefefe, the CONFIG_INIT_STACK_ALL_PATTERN stack filler, into the latency members, while the patched kernel reports the CDAT latency values there. Fixes: a5ab0de0ebaa ("cxl: Calculate region bandwidth of targets with shared upstream link") Signed-off-by: Guixin Liu Reviewed-by: Richard Cheng Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Link: https://patch.msgid.link/20260831092216.540644-2-kanie@linux.alibaba.com Signed-off-by: Dave Jiang [ sashal: Context lines differ because kzalloc_obj(*res_xa) isn't available here, so the existing kzalloc(sizeof(*res_xa), GFP_KERNEL) line was kept while applying the same coords initializer change. ] Signed-off-by: Sasha Levin commit a5aaaa84d215f7cd3eca9ee48b40209a81cebfa0 Author: Lizhi Hou Date: Sun Nov 22 17:21:09 2026 -0500 accel/amdxdna: Fix race between unmap and free BO [ Upstream commit ac18f34f5927e420ae529be72aec86201a262d04 ] A userspace process can concurrently trigger an unmap, which queues hmm_unreg_work, and free BO. If amdxdna_hmm_unreg_work() executes list_del(&mapp->node) and is preempted before calling amdxdna_umap_put(), amdxdna_hmm_unregister_all() can fail to find the mapping in the list and return without calling cancel_work_sync(). This allows object destruction to proceed while the worker still holds a pointer to the BO in the umap structure. Moving the work item from struct amdxdna_umap to struct amdxdna_gem_obj. The worker no longer holds a pointer to an individual mapping, so there is no longer a window where the umap has been unlinked from umap_list but work is still pending against it. The work item now lives in the BO itself, so use a single cancel_work_sync() in the free path to drain the work. Fixes: 445d20910429 ("accel/amdxdna: Fix unexpected wait when flushing notifier_wq") Reviewed-by: Max Zhen Signed-off-by: Lizhi Hou Link: https://patch.msgid.link/20260917154824.1872220-1-lizhi.hou@amd.com [ sashal: Adapted the hmm_unreg_work move to the older gem code: the uva field is named userptr, and amdxdna_gem_create_obj() was not relocated since it already follows the worker. ] Signed-off-by: Sasha Levin commit f9d356473844e18289f2f7c07e233a4cac1c2273 Author: Pengpeng Hou Date: Tue Jun 23 21:53:49 2026 +0800 phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures [ Upstream commit 2ef1e78ef7223eb16d9cf20814a1b2873456f671 ] The GS101 PIPE3 initialization checks the PMA PLL lock and then checks the CDR lock. The PLL helper returns an error, but the GS101 PIPE3 init path dropped that result. The CDR helper only logged a timeout. PHY initialization could therefore still return success after either the PLL or the selected receive lane had not locked. Make the in-file SoC-specific phy_init hook return an int so helpers with real failure results can propagate them through the existing PHY init paths. Keep the register-only helpers returning success and use the new return path to report the GS101 CDR wait failure. Other SoC helper paths keep their previous success behavior. Fixes: 32267c29bc7d ("phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS)") Signed-off-by: Pengpeng Hou Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260623135349.42739-1-pengpeng@iscas.ac.cn Signed-off-by: Vinod Koul [ sashal: Dropped the exynosautov920 hunks because that driver support doesn't exist in this tree; the remaining hunks apply unchanged apart from context and offsets. ] Signed-off-by: Sasha Levin commit c42c340308670960c67f129508dc3b62f153706d Author: Lizhi Hou Date: Thu Sep 10 14:13:38 2026 -0700 accel/amdxdna: Fix unsafe use of handle_mm_fault() [ Upstream commit df4d5352063ac48e1d3566f64ec94baa8b5af94f ] handle_mm_fault() must not be called from the mmap callback because the VMA has not yet been linked. The handle_mm_fault() API contract assumes that the VMA is already linked. Remove the handle_mm_fault() call from the mmap callback. For imported BOs, mark the mapping as invalid and rely on the first command submission to fault in the pages. For shmem BOs, set the VM_MIXEDMAP flag and use vm_insert_pages(). Implement amdxdna_gem_mixed_vm_ops to handle the page faults. Fixes: e486147c912f ("accel/amdxdna: Add BO import and export") Reviewed-by: Max Zhen Signed-off-by: Lizhi Hou Link: https://patch.msgid.link/20260910211338.1102315-1-lizhi.hou@amd.com [ sashal: Replaced linear_page_delta(vma, vmf->address) with its open-coded equivalent (vmf->address - vma->vm_start) >> PAGE_SHIFT, since that helper doesn't exist here, and adjusted surrounding context. ] Signed-off-by: Sasha Levin commit f042d34147a72d66be044fc19401e43ac4e04322 Author: Rafael J. Wysocki Date: Thu Sep 10 19:56:10 2026 +0200 ACPI: glue: Rearrange acpi_bind_one() to avoid breakage [ Upstream commit fcfb2b562115632e0a60a0928dca495f98eb335c ] Rearange the code in acpi_bind_one() to avoid situations in which the existing ACPI companion of the given device would be replaced with NULL due to a memory allocation error or because somebody tries to bind a physical device with an ACPI companion to a different ACPI device erroneously. Fixes: 7b1998116bbb ("ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node") Signed-off-by: Rafael J. Wysocki [ rjw: Merged two conditionals to avoid redundant check ] Link: https://patch.msgid.link/3465482.44csPzL39Z@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki [ sashal: Rewrote the one kzalloc_obj(*physical_node) call in acpi_bind_one() as kzalloc(sizeof(*physical_node), GFP_KERNEL) to match the context in this tree. ] Signed-off-by: Sasha Levin commit 186eda2a5e7cef8980137bd8d01c4cf3afc095a4 Author: Thomas Huth Date: Wed Aug 19 17:18:45 2026 +0200 crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data [ Upstream commit 5c87bcb2f98dbfe08efa016af037b0f9701ba381 ] key_tmp[] in safexcel_xcbcmac_setkey() and consts[] / _const[] in safexcel_cmac_setkey() contain crypto key material that should not get exposed to the outside once the function is done. Scrub the arrays with memzero_explicit() to avoid that the data could leak via the stack. Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20260813134953.979481-1-thuth%40redhat.com Fixes: 38f21b4bab11f ("crypto: inside-secure - Added support for the AES XCBC ahash") Fixes: 7a627db9cafdb ("crypto: inside-secure - Added support for the AES-CMAC ahash") Acked-by: Antoine Tenart Signed-off-by: Thomas Huth Signed-off-by: Herbert Xu [ sashal: Context line uses aes_expandkey() instead of upstream's aes_prepareenckey(), since the AES library rename isn't in this tree; the added memzero_explicit() calls are identical. ] Signed-off-by: Sasha Levin commit b01aaeb24d0eafcc1b43b60c17065ecabfbc8a02 Author: Eric Dumazet Date: Mon Sep 7 07:58:39 2026 +0000 sit: charge ip_tunnel_prl_entry allocations to memcg [ Upstream commit 40a2b90f5190fcc7b083809fa93f2799abefeeb1 ] ipip6_tunnel_add_prl() allocates struct ip_tunnel_prl_entry for each potential router entry added via SIOCADDPRL. An unprivileged user with CAP_NET_ADMIN in a user namespace can add an unbounded number of entries, consuming uncharged kernel memory. Commit 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation") added accounting to the temporary buffer in ipip6_tunnel_get_prl(), but missed the entry allocations in ipip6_tunnel_add_prl(). Use GFP_KERNEL_ACCOUNT when allocating struct ip_tunnel_prl_entry. Fixes: 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation") Signed-off-by: Eric Dumazet Acked-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260907075846.2913645-3-edumazet@google.com Signed-off-by: Jakub Kicinski [ sashal: Replaced kzalloc_obj(struct ip_tunnel_prl_entry, GFP_KERNEL_ACCOUNT) with kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL_ACCOUNT) because this tree's sit.c lacks the kzalloc_obj conversion. ] Signed-off-by: Sasha Levin commit 11c984a270af28947b7af5239edd3742528dc1de Author: Kang Yang Date: Fri Aug 28 14:55:34 2026 +0800 wifi: ath12k: preserve PPDU state across monitor status buffers [ Upstream commit 69b2d06dafa4a61b718704d655dd370ba660052a ] A monitor PPDU may span multiple status buffers. However, __ath12k_wifi7_dp_mon_process_ring() clears mon_ppdu_info before processing every buffer. As a result, continuation buffers lose PPDU state collected from earlier buffers, including ppdu_id and PHY metadata. This can cause monitor RX processing to fail when ath12k_wifi7_dp_rx_mon_dest_process() observes a PPDU ID mismatch between status and destination rings, preventing MSDUs from being delivered. It can also produce incomplete EHT metadata that triggers warnings from mac80211: Rate marked as an EHT rate but data is invalid: MCS:0, NSS:0 ath12k_wifi7_dp_mon_srng_process() already tracks status TLV continuations via ppdu_continuation. Apply the same logic here and only reinitialize mon_ppdu_info when starting a new PPDU. mon_ppdu_info persists across ar->monitor_started transitions. If monitor mode stops while a PPDU is mid-continuation, ppdu_continuation stays set and could leak into the next monitor session. Reset it when monitor mode starts. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 78d3d907d0f1 ("wifi: ath12k: add support to reap and process monitor status ring") Signed-off-by: Kang Yang Reviewed-by: Baochen Qiang Reviewed-by: Tamizh Chelvam Raja Link: https://patch.msgid.link/20260828065534.1537-1-kang.yang@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Adapted to the older ath12k layout: edited dp_mon.c instead of wifi7/dp_mon.c and dropped the wifi7_ prefix from helper names, with the dp_mon_parse_rx_dest call taking ar instead of &ar->dp. ] Signed-off-by: Sasha Levin commit 0ea1565b2348f92c13eef694162317151fe4cffa Author: Baochen Qiang Date: Tue Aug 18 10:03:41 2026 +0800 wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor [ Upstream commit 979ecb88ed3528e08dd7f87b90b029374226ca84 ] ath12k_wifi7_hal_tx_cmd_ext_desc_setup() programs the low 32 bits of the TX buffer physical address into HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO but hardcodes the high bits field HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI to 0x0. dma_addr_t is 64-bit on platforms with CONFIG_ARCH_DMA_ADDR_T_64BIT, so whenever a TX buffer is mapped above the 4 GB boundary the upper bits of paddr are dropped and the firmware is handed a truncated address, leading to potential TX failures. Write the upper bits of paddr into BUF_PTR_HI to fix this issue. Issue found during code review, compile tested only. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20260818-ath12k-truncated-tx-dma-addr-v1-1-ead978969371@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: Replaced the wifi7 function name and path with the older ath12k_hal_tx_cmd_ext_desc_setup() in dp_tx.c, since the wifi7 split is absent here. ] Signed-off-by: Sasha Levin commit 837d1f496b983168c4e76987019eacd389033350 Author: Golla Nagendra Date: Fri Aug 14 10:26:10 2026 +0530 dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure [ Upstream commit 4ea99b14b3bd955d768666941e2e03ba186b52f5 ] In zynqmp_dma_alloc_chan_resources(), sw_desc_pool is allocated before desc_pool_v. If dma_alloc_coherent() for desc_pool_v fails, the function currently exits through the runtime PM rollback path but leaves the already allocated sw_desc_pool behind. Add a dedicated err_free_sw_desc_pool label for the desc_pool_v failure path, free sw_desc_pool there, then fall through to err_pm for pm_runtime_put_autosuspend(). This keeps the error unwind symmetric and avoids leaking the software descriptor pool on coherent descriptor allocation failure. Fixes: b0cc417c1637 ("dmaengine: Add Xilinx zynqmp dma engine driver support") Signed-off-by: Golla Nagendra Reviewed-by: Frank Li Link: https://patch.msgid.link/20260814045616.1661199-3-nagendra.golla@amd.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 77bc546523ebe31fccc8ef4e701e83a5240a1410 Author: Golla Nagendra Date: Fri Aug 14 10:26:09 2026 +0530 dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure [ Upstream commit f2f44b952ea6e0c600e92ea21fcaa83cafeedf6e ] If sw_desc_pool allocation fails after pm_runtime_resume_and_get() succeeds in zynqmp_dma_alloc_chan_resources(), the error path returns without dropping the runtime PM reference. Route that failure path through err_pm so the runtime PM reference is balanced before returning the error. Fixes: 8982d48af36d ("dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc()") Signed-off-by: Golla Nagendra Reviewed-by: Frank Li Link: https://patch.msgid.link/20260814045616.1661199-2-nagendra.golla@amd.com Signed-off-by: Vinod Koul [ sashal: Kept the older kcalloc() allocation line in the context instead of upstream's kzalloc_objs(), since that helper doesn't exist here; the fix is otherwise identical. ] Signed-off-by: Sasha Levin commit 62daf2617915a71777b7bd2aa59a1fa549607873 Author: Matt Turner Date: Sat Sep 5 18:54:11 2026 -0400 perf thread: Fix live-session detection in thread__e_machine() [ Upstream commit 15917a3a1ce0695f824892c8f9d0dc51408ee580 ] When the per-thread e_machine cannot be determined from the DSOs in the thread's maps, thread__e_machine_endian() decides between reading /proc//exe and falling back to the recorded session environment: bool is_live = machine->machines == NULL; if (!is_live) { /* Check if the session has a data file. */ struct perf_session *session = container_of(...); is_live = !!session->data; } Neither half of that works. The back pointer added by commit a088031c4998 ("perf tools: Add machine to machines back pointer") is set by machines__add(), which only ever adds guests; the host machine never gets one. Host-machine threads, which is to say almost all of them, therefore see machine->machines == NULL and are declared live before the session is consulted at all. The session test is also inverted. A session with a perf_data attached is one being read from a perf.data file, i.e. exactly the case that is not live, while a live session such as 'perf top' passes data=NULL to __perf_session__new(). So a file-based session takes the live path and reads /proc//exe on the analysing host, which at best describes an unrelated process that has since been given the recorded pid, and normally just fails, leaving e_machine as EM_NONE. The perf_env fallback that would have supplied the recorded architecture is never reached, and thread__e_machine() returns EM_HOST. For a same-architecture recording this is invisible, since EM_HOST is the right answer anyway. Cross-architecture it is not: annotating an Alpha perf.data on an x86_64 host selects the x86 struct arch, so the Alpha disassembly is matched against the x86 instruction table. Alpha's 'ret' collides with x86's and gets ret_ops, while its calls and branches match nothing and are left unparsed, so no call target is resolved and no jump arrows are drawn. Set the back pointer for the host machine and correct the session test. The new back pointer does not disturb the other reader of the field, machine__findnew_guest_code(), which machine__resolve() only calls when !machine__is_host(machine). Fixes: 70351029b55677eb ("perf thread: Add support for reading the e_machine type for a thread") Reviewed-by: Ian Rogers Signed-off-by: Matt Turner Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo [ sashal: Context-only adaptation: machines__init() returns void here and the function is thread__e_machine() rather than thread__e_machine_endian(), so the two changed lines are placed in that older code. ] Signed-off-by: Sasha Levin commit 6347fdc6af83f80a526eb1ffaba7e98d55dfdb96 Author: Dave Jiang Date: Fri Sep 4 10:23:35 2026 -0700 ACPI: APEI: GHES: Validate memory error section length before payload access [ Upstream commit 10338c9085b4939a428a8dc78d2bbf62c161278b ] ghes_do_proc() hands the CPER_SEC_PLATFORM_MEM payload to the report chain, arch_apei_report_mem_error() and ghes_handle_memory_failure() without checking gdata->error_data_length. All three read validation_bits and physical_addr, at offsets 0 and 16, so a shorter section reads past the record. Check the length once in ghes_do_proc(), before any consumer runs. Take the 73-byte struct cper_sec_mem_err_old as the floor: older firmware legitimately emits that UEFI 2.1/2.2 layout, and it makes validation_bits safe to read. The fields from "extended" on are absent from that layout, so also require whatever length the validation bits claim. Derive it per field rather than demanding the full 80 bytes: rank needs only 76, and the BANK_GROUP and BANK_ADDRESS bits describe "bank" at offset 38, which every record carries. Testing the whole mask against one size, as cper_print_mem() does, gets it wrong both ways. Reported-by: sashiko-bot@kernel.org Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=7 Fixes: ca104edc1784 ("ACPI, APEI, GHES: Cleanup ghes memory error handling") Reviewed-by: Hanjun Guo Reviewed-by: Shuai Xue Signed-off-by: Dave Jiang Link: https://patch.msgid.link/20260904172337.1409775-12-dave.jiang@intel.com Signed-off-by: Rafael J. Wysocki [ sashal: Hunk context adjusted: the new length-check helper is placed after the CXL kfifo getter's export because the function it normally follows is absent here. ] Signed-off-by: Sasha Levin commit bd6f218c6fb399c6557d2eb799d68410e39dc810 Author: Jingbo Xu Date: Fri Jul 17 22:29:32 2026 +0800 fuse: don't bump attr_version for async direct read completion [ Upstream commit fc60668db85584da911e5d0a65c8698628f98bba ] The attr_version counter should only be incremented when cached attributes are actually modified (as documented in commit 1fb69e781729 ("fuse: fix race between getattr and write")). Async direct reads do not modify any cached inode attributes (size, mtime, ctime), so bumping attr_version in fuse_aio_complete() for reads is incorrect. This unconditional bump causes a livelock when auto_inval_data is enabled together with writeback_cache: fuse_cache_read_iter() issues a FUSE_GETATTR before every read, but by the time the response arrives, an async DIO read completion has already incremented fi->attr_version past the snapshot taken before the request. The GETATTR result is then discarded (attr_version race), fi->i_time is never refreshed, and every subsequent read triggers yet another GETATTR -- creating an infinite loop of useless round-trips. Fix this by only bumping attr_version for write completions, consistent with the synchronous DIO write path (fuse_write_update_attr) and the cached write path. Fixes: 01e9d11a3e79 ("fuse: add support of async IO") Reviewed-by: Horst Birthelmer Signed-off-by: Jingbo Xu Signed-off-by: Miklos Szeredi [ sashal: Adjusted context: this tree declares inode inside the if block and has no mapping variable, so only the io->write condition was changed. ] Signed-off-by: Sasha Levin commit 45a6a9bca876c34a420fac56f6faf06d5d886c9d Author: Lizhi Hou Date: Thu Aug 13 13:50:16 2026 -0700 accel/amdxdna: Fix unexpected wait when flushing notifier_wq [ Upstream commit 445d20910429b41e88768624b914344658991a5b ] In amdxdna_gem_obj_free(), flush_workqueue(xdna->notifier_wq) waits for all pending work items on the device-global notifier workqueue, rather than only the work items associated with the BO being freed. If another BO has a pending hmm_unreg_work, freeing an unrelated BO can be unnecessarily blocked until that work completes. mmu_interval_notifier_remove() is deferred to a workqueue because it cannot be called from the MMU notifier callback itself. The BO free path is not a notifier callback, so call mmu_interval_notifier_remove() directly there and avoid the workqueue. Fixes: e486147c912f ("accel/amdxdna: Add BO import and export") Reviewed-by: Max Zhen Signed-off-by: Lizhi Hou Link: https://patch.msgid.link/20260813205016.941743-1-lizhi.hou@amd.com [ sashal: Replaced abo->mem.uva with abo->mem.userptr in the unreg work handler, and adjusted surrounding context in the BO free path to match this tree. ] Signed-off-by: Sasha Levin commit 1c337972af95e20fd5f6e71cee3cf2af07fc67e4 Author: Davidlohr Bueso Date: Mon Aug 31 10:51:19 2026 -0700 cxl/test: Map mock device nodes to an online node [ Upstream commit 6f057dea152574dd044382fd0ba5ed19e3ecba25 ] cxl_type3_mem_init() and cxl_type2_mem_init() assign alternating NUMA nodes to the mock memdevs to model multi-node topologies. On a single-node host node 1 has no pgdat, and the first node-aware allocation in an odd device's probe faults on a NULL zonelist: Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3 KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f] Workqueue: async async_run_entry_fn RIP: __alloc_frozen_pages_noprof+0x288 new_slab ___slab_alloc __kmalloc_node_track_caller_noprof devm_kmalloc cxl_mock_mem_probe Map the requested node to an online one, as dax_hmem already does for its target node. Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute") Signed-off-by: Davidlohr Bueso Reviewed-by: Dave Jiang Reviewed-by: Alison Schofield Tested-by: Alison Schofield Tested-by: Shaikh Kamaluddin Reviewed-by: Gregory Price (Meta) Link: https://patch.msgid.link/20260831175119.3247915-1-dave@stgolabs.net Signed-off-by: Dave Jiang [ sashal: Dropped the upstream hunk in the type-2 init function, which doesn't exist here, and applied the numa_map_to_online_node() wrapper to the three set_dev_node calls in cxl_mem_init(). ] Signed-off-by: Sasha Levin commit b502c976ebfb3b132a42ff7b3dd96cb0cf6eb00c Author: Nicolas Frattaroli Date: Sun Nov 22 15:37:35 2026 -0500 drm/panthor: Revisit reqs_lock handling in flush/reset paths [ Upstream commit 4fd08b3d1da78e33cb5939f0086e61f9d660cd6c ] panthor_gpu_flush_caches() and panthor_gpu_soft_reset() acquire their reqs_lock spinlock with the IRQ-disabling variants of the spinlocking functions. This isn't necessary, as the lock is never taken from an atomic context, as Panthor uses threaded interrupt handlers. The result of this overly strict locking is that IRQs may be disabled more frequently and for longer than they should be, resulting in increased system latency. Switch the locking to use non-IRQ-disabling scoped_guard statements for locking. The wait_event_timeout read of pending_reqs outside of the spinlock is fine as wait_event_timeout is a memory barrier according to the Linux Memory Model. Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block") Reviewed-by: Boris Brezillon Signed-off-by: Nicolas Frattaroli Reviewed-by: Liviu Dudau Reviewed-by: Steven Price Signed-off-by: Liviu Dudau Link: https://patch.msgid.link/20260812-panthor-cache-flush-fix-v4-2-751e32901898@collabora.com [ sashal: Dropped the cache flush tracepoint calls, which this tree lacks. ] Signed-off-by: Sasha Levin commit b5e40f896d571e549b731a1bfe0eaddc63a9d2d3 Author: Christian Aurich Zanettini Martins Date: Fri Oct 30 14:01:51 2026 -0300 nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() [ Upstream commit b1d1f6b1ee03285690f12c2ebf23616416e6d881 ] nvme_tcp_free_ctrl() reads ctrl->ctrl.opts to know how many queue mutexes to destroy. When creating the controller fails, nvmf_create_ctrl() frees opts as soon as nvme_tcp_create_ctrl() returns, but a concurrent open of the character device can hold the last reference to the controller. With CONFIG_DEBUG_KOBJECT_RELEASE, which delays the release, every failed connect reads freed memory: BUG: KASAN: slab-use-after-free in nvme_tcp_free_ctrl+0x38b/0x430 Read of size 4 at addr ffff888005b93740 by task kworker/2:1/51 Keep the size of the queue array in the controller and use it instead. Fixes: 2eeeaa9c1ff0 ("nvme-tcp: Validate the queue state under the queue lock in the address attribute") Cc: stable@vger.kernel.org Reviewed-by: Nilay Shroff Signed-off-by: Christian Aurich Zanettini Martins Signed-off-by: Keith Busch [ sashal: Replaced upstream's nvme_tcp_exit_queue(), nvme_tcp_init_queue() and kzalloc_objs() with this tree's mutex_destroy(), mutex_init() and kcalloc(), keeping the nr_allocated_queues loop bounds. ] Signed-off-by: Sasha Levin commit f8a4276c7021d14ebc4dba7244b2514ae1d1d72c Author: Guixin Liu Date: Wed Oct 28 10:09:04 2026 +0800 nvme-tcp: Validate the queue state under the queue lock in the address attribute [ Upstream commit 2eeeaa9c1ff0c429096acc2947c296db6a56f96d ] Reading the "address" sysfs attribute calls kernel_getsockname() on the admin queue socket, which can race with the queue teardown during connection error recovery: a reader can observe NVME_TCP_Q_LIVE set, then block on the queue lock while nvme_tcp_free_queue() releases the socket and clears queue->sock without holding the lock. Once the reader acquires the lock it dereferences the NULL socket pointer. Commit 76d54bf20cdc ("nvme-tcp: don't access released socket during error recovery") had the queue liveness check inside the lock. Commit 782373ba2766 ("nvme: tcp: avoid race between queue_lock lock and destroy") moved it back out because the lock itself is destroyed in nvme_tcp_free_queue(), so a reader arriving late trips mutex_destroy(). Check the queue liveness inside the queue lock, and clear queue->sock under the same lock. The teardown clears NVME_TCP_Q_LIVE under the lock well before the socket is released, so a reader either sees the bit cleared or a socket that cannot be released while it holds the lock. To also close the lock lifetime race, the queue locks are now owned by the controller: they are initialized with the queue array and only destroyed when the controller is freed, which cannot happen while a sysfs attribute read is still in progress. The queue count is computed by the NVME_TCP_OPT_NR_QUEUES() macro from the original connect options for both initialization and destruction, as reconnects may shrink ctrl->queue_count. Fixes: 782373ba2766 ("nvme: tcp: avoid race between queue_lock lock and destroy") Cc: stable@vger.kernel.org Signed-off-by: Guixin Liu Reviewed-by: Nilay Shroff Signed-off-by: Keith Busch [ sashal: Context adapted for older teardown code (fput, memalloc_noreclaim, list_empty) and per-queue pf_cache_lock init kept, while queue_lock init/destroy moves to the controller. ] Signed-off-by: Sasha Levin commit e056a3923fa8c026744db43be9d69d3e42e1fcb0 Author: Salvatore Dipietro Date: Thu Oct 1 08:21:51 2026 +0000 mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations [ Upstream commit 0e05a469c29400eb6e35448ce7318581688a1806 ] Commit 5d8edfb900d5 ("iomap: Copy larger chunks from userspace") introduced high-order folio allocations in the iomap buffered write path. When memory is fragmented, each failed costly-order allocation enters __alloc_pages_slowpath() which runs direct reclaim, direct compaction and drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench (simple-update) with 1024 clients on a 96-vCPU arm64 system. The root issue is that direct reclaim and direct compaction are too expensive for hot allocation paths that have fallbacks to smaller allocations. __filemap_get_folio_mpol() already marks higher-order allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller can handle failure. However, the page allocator still enters the full blocking slowpath for costly orders with __GFP_NORETRY, which is unnecessarily aggressive when the caller will simply retry at a lower order. For costly-order allocations with __GFP_NORETRY, clear __GFP_DIRECT_RECLAIM at the very start of the slowpath, before can_direct_reclaim, can_compact and the nofail checks are evaluated. This makes the entire slowpath treat the request as non-blocking: no direct reclaim, no direct compaction and no drain_all_pages() IPI across every CPU. Reclaim and compaction move to the background instead: kswapd is still woken for reclaim, and it wakes kcompactd for defragmentation. The system keeps its long-term health while the latency-critical direct allocation path no longer stalls. Allocations that also request __GFP_THISNODE are exempted. That flag pairing identifies the local-node-first THP attempt issued by alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to form transparent huge pages. Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the !can_direct_reclaim bailout, which since commit 4c0ed883e051 ("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on. With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed by fragmenting another migratetype's pageblock. That is the wrong trade for a caller that has already communicated it can handle failure and has a cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation. The exclusion is not restricted to costly orders: any __GFP_NORETRY caller has said it can cope with failure, so failing is preferable to fragmenting for all of them. Test environment: Hardware: AWS EC2 m8g.24xlarge (96 vCPU, arm64) 12x 1TB IO2 32000 IOPS RAID0 XFS OS: AL2023 Kernel: v7.3-rc1 Database: PostgreSQL 18.4 Workload: pgbench simple-update, 1024 clients, 96 threads, 1200s Results (average of 3 runs, TPS): Config Avg TPS % vs baseline v7.3-rc1 baseline (vm.defrag_mode=0) 58,602 - v7.3-rc1 + this patch (vm.defrag_mode=0) 157,246 +168.3% v7.3-rc1 baseline (vm.defrag_mode=1) 109,012 - v7.3-rc1 + this patch (vm.defrag_mode=1) 157,778 +44.7% Link: https://lore.kernel.org/20261001082152.2879289-1-dipiets@amazon.it Link: https://lore.kernel.org/all/20260403193535.9970-1-dipiets@amazon.it/T/#t [v1] Link: https://lore.kernel.org/linux-mm/20260420161404.642-1-dipiets@amazon.it/T/#u [v2] Link: https://lore.kernel.org/all/20260710143437.12379-1-dipiets@amazon.it/T/#u [v3] Link: https://lore.kernel.org/all/20260904115629.3993331-1-dipiets@amazon.it/T/#u [v4] Link: https://lore.kernel.org/all/20260911142102.2294202-1-dipiets@amazon.it/T/#u [v5] Fixes: 5d8edfb900d5 ("iomap: Copy larger chunks from userspace") Signed-off-by: Salvatore Dipietro Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka (SUSE) Acked-by: Zi Yan Reviewed-by: Johannes Weiner Reviewed-by: Christoph Hellwig Cc: David Hildenbrand Cc: Michal Hocko Cc: Matthew Wilcox Cc: Dave Chinner Cc: Ritesh Harjani Cc: Dmitry Ilvokhin Cc: Hazem Mohamed Abuelfotoh Cc: Ali Saidi Cc: Geoff Blake Cc: Christian Brauner Cc: Cc: Darrick J. Wong Cc: Brendan Jackman Cc: Cc: Suren Baghdasaryan Cc: "Garg, Shivank" introduced high-order folio allocations in the iomap buffered write path. When memory is fragmented, each failed costly-order allocation enters __alloc_pages_slowpath() which runs direct reclaim, direct compaction and drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench (simple-update) with 1024 clients on a 96-vCPU arm64 system. The root issue is that direct reclaim and direct compaction are too expensive for hot allocation paths that have fallbacks to smaller allocations. __filemap_get_folio_mpol() already marks higher-order allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller can handle failure. However, the page allocator still enters the full blocking slowpath for costly orders with __GFP_NORETRY, which is unnecessarily aggressive when the caller will simply retry at a lower order. For costly-order allocations with __GFP_NORETRY, clear __GFP_DIRECT_RECLAIM at the very start of the slowpath, before can_direct_reclaim, can_compact and the nofail checks are evaluated. This makes the entire slowpath treat the request as non-blocking: no direct reclaim, no direct compaction and no drain_all_pages() IPI across every CPU. Reclaim and compaction move to the background instead: kswapd is still woken for reclaim, and it wakes kcompactd for defragmentation. The system keeps its long-term health while the latency-critical direct allocation path no longer stalls. Allocations that also request __GFP_THISNODE are exempted. That flag pairing identifies the local-node-first THP attempt issued by alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to form transparent huge pages. Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the !can_direct_reclaim bailout, which since commit 4c0ed883e051 ("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on. With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed by fragmenting another migratetype's pageblock. That is the wrong trade for a caller that has already communicated it can handle failure and has a cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation. [ sashal: Kept this tree's existing can_compact expression and dropped the defrag_mode __GFP_NORETRY hunk, since the code it modifies isn't present here. ] Signed-off-by: Sasha Levin commit ea21fc0a71b3cea50f51c5048dc2875b12754f76 Author: Josef Bacik Date: Sat Oct 31 10:39:53 2026 +0100 mm/userfaultfd: wake all waiters on unregister [ Upstream commit 3afb19d68cc5e7851fdb1069c8094af97bd80417 ] UFFDIO_UNREGISTER only wakes pending faults if VM_UFFD_MISSING is set. Threads waiting on write-protect, minor or RWP faults can therefore remain asleep after unregistering a range that does not track missing faults. Wake pending faults regardless of the registration mode so they can retry without an explicit UFFDIO_WAKE or closing the userfaultfd. This matches the existing behavior for missing faults, including removing unread fault messages for the woken waiters. Fix generated by an LLM and sent by Josef Bacik in private. Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl") Cc: stable@vger.kernel.org Signed-off-by: Josef Bacik [ david: rebase; simplify description ] Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Lorenzo Stoakes (ARM) Tested-by: Muhammad Usama Anjum Link: https://patch.msgid.link/20261031-fixes_core-v3-24-d6437171ecc3@kernel.org Signed-off-by: David Hildenbrand (Arm) [ sashal: Applied the change to the in-tree userfaultfd_unregister() in fs/userfaultfd.c, since the mm/ file move isn't present, with identical function body but a different location. ] Signed-off-by: Sasha Levin commit ebba0fe55fe32416f0c2005408a9d2e2e7f4d667 Author: Cunhao Lu <1579567540@qq.com> Date: Fri Jul 31 17:45:00 2026 +0800 can: skb: make echo skb freeing safe in any IRQ context [ Upstream commit d743071964920c92af598c87a9e6f4369263ee09 ] can_put_echo_skb() can be called with hardware interrupts disabled. Its direct drop paths use kfree_skb(), while can_create_echo_skb() uses kfree_skb() when cloning fails and consume_skb() after a successful clone. None of these helpers is safe in every IRQ context. Use dev_kfree_skb_any() for all drop paths and dev_consume_skb_any() when consuming a successfully cloned skb. This preserves the respective skb drop and consumed semantics regardless of the caller IRQ context. Signed-off-by: Cunhao Lu <1579567540@qq.com> Link: https://patch.msgid.link/tencent_E84809CF236D0137885E7E4E4D58340B3208@qq.com Cc: stable@kernel.org Fixes: ae64438be192 ("can: dev: fix skb drop check") Fixes: 0ae89beb283a ("can: add destructor for self generated skbs") Fixes: 3ccd4c6167d3 ("can: Unify droping of invalid tx skbs and netdev stats") Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface") [mkl: also convert can_dropped_invalid_skb(), can_dev_dropped_skb()] [mkl: add stable on Cc + add Fixes tags] Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin commit fd7923851298d60e1566f6a8579db099523c5124 Author: Vidya Srinivas Date: Wed Oct 28 12:34:04 2026 +0530 drm/i915/display: Disable pipe joiner on WCL [ Upstream commit b42b656db1384255044754cd2163d370d766b776 ] Pipe joining is not supported in the WCL display configuration. Report no joiner support on WCL so that modes which would require joining are rejected, matching the 4k 60Hz maximum resolution documented for the platform. v2: Rebase onto latest upstream v3: Fix up the commit message v4: Split the scaler and joiner changes into separate patches (Jani) Bspec: 74286 Fixes: f8e1c3e07db1 ("drm/i915/xe3lpd: Add support for display version 30.02") Cc: stable@vger.kernel.org Suggested-by: Charlton Lin Reviewed-by: Uma Shankar Signed-off-by: Vidya Srinivas Signed-off-by: Uma Shankar Link: https://patch.msgid.link/20261028070404.1913843-3-vidya.srinivas@intel.com (cherry picked from commit 917676a55a690319a01b45d3956eaf94ba564df8) Signed-off-by: Joonas Lahtinen [ sashal: Dropped the unrelated eDP VBT pipe_joiner_enable check from the context, since this branch lacks it, and applied only the WCL DISPLAY_VERx100 != 3002 condition. ] Signed-off-by: Sasha Levin commit 5db5cb62999f343d8625e790e36ace3a87e7b81c Author: Jérémy Jean Date: Fri Oct 23 18:51:19 2026 +0000 inet: frags: prevent acceptance of partially authenticated reassembly [ Upstream commit 6fb4e32f2ce3234ae0c416872e911706a3484430 ] A reassembled skb retains the secpath from its first fragment, which makes it possible for the final policy check to accept bytes that were not covered by the transform recorded on the skb. This can affect IPsec tunnel traffic, including AH and ESP, and allow a packet to be accepted even though only part of its payload was authenticated. Reject a fragment when its secpath differs from the fragments already in the queue, and keep overlap statistics limited to actual overlaps. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Jérémy Jean Reviewed-by: Eric Dumazet Signed-off-by: Dave Miller [ sashal: Adapted the ip6_frag_queue overlap stat to use ip6_dst_idev(skb_dst(skb)) instead of a local idev, and kept existing IPFRAG_TOOBIG/truesize context in inet_frag.h and inet_fragment.c. ] Signed-off-by: Sasha Levin commit 271dd7bb16d88c5ccaea1310f77ac0880acbfd3b Author: Kevin Wang Date: Thu Oct 15 14:02:09 2026 +0800 drm/amd/pm: preserve committed OD features for SMU 13.0.0/13.0.7 [ Upstream commit 6027db7db773714f2e05df82093276f2a52a1fba ] PMFW treats FeatureCtrlMask as the complete set of active OD features. Uploads containing only newly edited bits can drop earlier settings. Fix the OD state handling to: - preserve committed features across later commits - keep staged OD settings out of power-cap writes - update cached state only after successful uploads - clear restored features only after they return to defaults - restore PPT for the current AC/DC source after resume Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/3625 Signed-off-by: Kevin Wang Reviewed-by: Kenneth Feng Tested-by: José Miguel Sarasola Signed-off-by: Alex Deucher (cherry picked from commit adf63026e1fa706de48d986ac6c1a7cb64cbf927) Cc: stable@vger.kernel.org [ sashal: Low-limit power-cap branch tests smu->current_power_limit > msg_limit instead of upstream's firmware Ppt readback, and uses older set_power_limit naming, with the forward declaration anchored on a different function. ] Signed-off-by: Sasha Levin commit e5d84d6ebec814039f40a0366a7272fd330678d4 Author: Ming Lei Date: Sun Oct 11 01:35:50 2026 -0500 ublk: let STOP_DEV cancel the server's commands before its release [ Upstream commit c8b349f9daf6d88ff21033028167d00e819dafb6 ] STOP_DEV cancels the fetched commands after dropping ub->mutex, so START_DEV and FETCH can run in between: STOP_DEV START_DEV / FETCH lock ub->mutex ublk_stop_dev_unlocked() (not started: does nothing) unlock ub->mutex START_DEV goes live, schedules scan FETCH publishes a new command cancel_work_sync(scan) cancels the new disk's scan ublk_cancel_dev() takes the new command: NULL io->cmd on a queue which isn't canceling A START_DEV after STOP_DEV also goes live over the canceled commands. Hold a reference on the server's /dev/ublkcN while canceling: STOP_DEV lock ub->mutex ublk_stop_dev_unlocked() cancel_work_sync(scan) server attached: take a reference on its file, set STOPPING unlock ub->mutex ublk_cancel_dev() drop the reference - STOPPING makes FETCH and PREP get UBLK_IO_RES_ABORT and START_DEV -EBUSY; a START_DEV or END_USER_RECOVERY waiting for the device to get ready wakes up too; the reset in the server's release clears it - the release can't run before the reference is dropped, so no new server can attach, and the cancel only meets this server's commands - the cancel still runs after the unlock: io_uring_cmd_done() may take uring_lock, under which FETCH takes ub->mutex ublk_ch_open() saves the file in ->ch_file and ublk_ch_release() clears it, under cancel_mutex. The release runs after the last reference is gone, so take ours with file_ref_get(). Drop it with __fput_sync(): if it is the last one, fput() would defer the release to this task, which DEL_DEV then makes wait for the device to be freed. A server which opened the device but hasn't fetched is stopped too. Document what a server sees after STOP_DEV in ublk.rst. Fixes: 85248d670b71 ("ublk: move ublk_cancel_dev() out of ub->mutex") Cc: stable@vger.kernel.org Reported-by: Josef Bacik Closes: https://lore.kernel.org/linux-block/20260928-b4-ublk-cancel-stop-v1-0-4a4360232a46@toxicpanda.com/ Tested-by: Josef Bacik Signed-off-by: Ming Lei Link: https://patch.msgid.link/20261011063555.1142277-8-tom.leiming@gmail.com Signed-off-by: Jens Axboe [ sashal: Adapted the counter from nr_queue_ready to nr_io_ready, moved the STOPPING check into ublk_fetch(), and dropped the batch-I/O (PREP) path, which this tree lacks. ] Signed-off-by: Sasha Levin commit b6211aa495a38145c9222a5a148abc8c3ff04a58 Author: Jianping Li Date: Fri Oct 2 11:12:20 2026 +0100 misc: fastrpc: Allocate entire reserved memory for Audio PD in probe [ Upstream commit 9e47ad9c562e82cabfbb9afa6c2b0dcdf2702a39 ] Allocating and freeing Audio PD memory from userspace is unsafe because the kernel cannot reliably determine when the DSP has finished using the memory. Userspace may free buffers while they are still in use by the DSP, and remote free requests cannot be safely trusted. Additionally, the current implementation allows userspace to repeatedly grow the Audio PD heap, but does not support shrinking it. This can lead to unbounded memory usage over time, effectively causing a memory leak. Fix this by allocating the entire Audio PD reserved-memory region during rpmsg probe and tying its lifetime to the rpmsg channel. This removes userspace-controlled alloc/free and ensures that memory is reclaimed only when the DSP process is torn down. The reserved-memory region is now mandatory for the Audio PD domain. Rather than failing rpmsg probe when it is missing, validate it in fastrpc_init_create_static_process() and reject only the static-process creation. This keeps the fastrpc device probing for all other domains even on a misconfigured device tree. Fixes: 0871561055e66 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Signed-off-by: Jianping Li Reviewed-by: Ekansh Gupta Link: https://lore.kernel.org/all/20260814101955.234238-1-jianping.li@oss.qualcomm.com/ Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20261002101220.1084101-3-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman [ sashal: Adjusted context for the missing kzalloc_objs and poll-support table by using kcalloc() and anchoring the new probe helper at fastrpc_get_domain_id(). ] Signed-off-by: Sasha Levin commit bbeb5cd29110df4e27a360a840cec5080d91b5f8 Author: Abhishek Dubey Date: Mon Sep 28 10:43:53 2026 +0530 powerpc/bpf: fix alignment of long branch trampoline address [ Upstream commit 04001e8ddb979f463f1c3ca8ac4d6ac59fb48921 ] Ensure the dummy trampoline address field present between the OOL stub and the long branch stub is 4/8-byte aligned, for memory compatibility when content loaded to a register. Reported-by: Hari Bathini Fixes: d243b62b7bd3 ("powerpc64/bpf: Add support for bpf trampolines") Cc: stable@vger.kernel.org Signed-off-by: Abhishek Dubey Signed-off-by: Saket Kumar Bhaskar Tested-by: Yeswanth Krishna Tellakula Tested-by: R Nageswara Sastry Reviewed-by: Hari Bathini Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/a8257022057cbb71928c960be589e10b89fc0899.1789982239.git.skb99@linux.ibm.com [ sashal: Dropped the two fsession prototypes (prepare_for_fsession_fentry() and store_func_meta()) from the context of the bpf_jit.h hunk, since those functions don't exist in this tree. ] Signed-off-by: Sasha Levin commit a2fe2e2f5ffa5180144d5be9f8504023a2a304f2 Author: Sean Young Date: Wed Nov 4 21:00:56 2026 -0500 media: rc: Add missing locking for keymap [ Upstream commit ab9567336171e46ce9e03ee126902b3fd7901baa ] When the rc_map for an rc_dev gets updated, locking is required but is missing in places. A concurrent scancode lookup and a call to rc_{register,unregistered}_device() could result in a use-after-free; this could happen if IR is decoded during those function calls. Add lockdep assertions where locks are required. ir_free_table() should only be called for non-TX devices else we will use a spinlock without iniitializing it. Fixes: dccc0c3ddf8f ("media: rc: fix race between unregister and urb/irq callbacks") Signed-off-by: Sean Young Cc: stable@vger.kernel.org Acked-by: Hans Verkuil Signed-off-by: Sasha Levin commit d1645464bf598de29c707b25f30a2b3d4d6ee1c7 Author: Sean Young Date: Wed Aug 12 14:03:10 2026 +0100 media: rc: Replace open coded krealloc() for keymap [ Upstream commit e4b4aa413cc2e48a261c8c513ced964a3390c0cf ] Replace open coded krealloc() and remove superfluous member of struct rc_map - we don't need to track both the size in bytes and entries. Signed-off-by: Sean Young Acked-by: Hans Verkuil Stable-dep-of: ab9567336171 ("media: rc: Add missing locking for keymap") Signed-off-by: Sasha Levin commit 66a20853f304d7ead726eb1cf1d95bd8463bd612 Author: Chuck Lever Date: Sun Aug 2 13:04:35 2026 -0400 NFSD: Destroy a recalled delegation the client does not hold [ Upstream commit bbfa823f624d41e85ebca929ac77dc2182cadfed ] A client that answers CB_RECALL with NFS4ERR_BADHANDLE or NFS4ERR_BAD_STATEID has no record of the delegation, so the FREE_STATEID that clears it from cl_revoked never arrives. Every later SEQUENCE reply carries SEQ4_STATUS_RECALLABLE_STATE_REVOKED, and the client loops issuing TEST_STATEID. Destroy such a delegation when it is reaped rather than revoking it onto cl_revoked. RFC 8881 Section 20.2.4 completes the recall at the reply when its status is neither NFS4_OK nor NFS4ERR_DELAY, so a rejected recall leaves nothing to revoke. An administrative revoke keeps that path, since NFS4ERR_ADMIN_REVOKED reports it. A destroyed stateid returns NFS4ERR_BAD_STATEID instead of NFS4ERR_DELEG_REVOKED. A client that rejects the recall but still holds the delegation gets no notice that its state was revoked. CB_RECALL can outrun the reply that granted the delegation, so honor a rejection only once the client has seen that grant. Per RFC 8881 Section 2.10.6.3, retirement of the slot that carried the grant is that proof; retry until then, and revoke when the retries lapse. Fixes: 3bd64a5ba171 ("nfsd4: implement SEQ4_STATUS_RECALLABLE_STATE_REVOKED") Cc: stable@vger.kernel.org # 6.14.x Link: https://patch.msgid.link/20260802-nfsd-deleg-destroy-badhandle-v1-8-323aa7196055@kernel.org Signed-off-by: Chuck Lever [ sashal: adjusted context for missing directory delegation code, using the single alloc_init_deleg allocator, a void-returning cb prepare, and a plain dl_cb_fattr field in place of the union. ] Signed-off-by: Sasha Levin commit 931c01918ebb75b589db1c68e07713eac2e0aabd Author: Vernon Yang Date: Wed Sep 9 10:58:02 2026 +0800 mm: khugepaged: fix folio is used after pte_unmap_unlock() [ Upstream commit ba2f1f92ddfabd340c9248fd2380104f717ee8b1 ] After the page table lock has dropped, the folio can be freed concurrently. The trace_mm_khugepaged_scan_pmd() is left with a dangling folio pointer. So using the folio_pfn() before dropping the page table lock, closing use-after-free window. And other pre-existing bug, When the `for (i = 0; i < HPAGE_PMD_NR; i++)` iteration to terminate and the folio operation preceding is normal, but pfn will be incorrect. so we really only trace the PFN if it really was problematic. Link: https://lore.kernel.org/20260909025804.3233645-3-vernon2gm@gmail.com Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages") Signed-off-by: Vernon Yang Signed-off-by: Andrew Morton Acked-by: David Hildenbrand (Arm) Acked-by: Lorenzo Stoakes (ARM) Cc: Barry Song Cc: Dev Jain Cc: Lance Yang Cc: Ryan Roberts Cc: Zach O'Keefe Cc: [ sashal: Dropped the SCAN_PAGE_LAZYFREE hunk and applied the failed_pfn changes to hpage_collapse_scan_pmd(), the older name and body of collapse_scan_pmd(). ] Signed-off-by: Sasha Levin commit 0f2ca04812f4797d009ccd62910d4a4ecd4c0a80 Author: Harald Freudenberger Date: Tue Oct 6 17:46:02 2026 +0200 s390/zcrypt: Guard domain index uses against speculative bypass [ Upstream commit 7b88e8b6d714cd1b2b6185e2963c8ec4d98542d0 ] The previous array_index_nospec() placement only covered the admin permission check, leaving ap_test_config_usage_domain() and ap_test_config_ctrl_domain() in the CCA path exposed to speculative execution. Move the sanitization to before all permission and config checks in both the CCA and EP11 paths. Hold the sanitized domain value in another variable so that the later use can choose to use either the original value (subject to speculative execution) or the sanitized value (which may in case of AUTOSEL_DOM reflect the wrong value). Before that, check the domain value to be either AUTOSEL_DOM or in range 0...AP_DOMAINS-1 and return with -EINVAL in case this check does not pass. Fixes: e935cd525af4 ("s390/zcrypt: Close speculative mem read possibility") Signed-off-by: Harald Freudenberger Cc: stable@vger.kernel.org Reviewed-by: Holger Dengler Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin commit 636a961375add49d4f7ea9752ad18de494e32005 Author: Harald Freudenberger Date: Wed Mar 18 17:41:32 2026 +0100 s390/zcrypt: Explicitly use a card variable in _zcrypt_send_cprb [ Upstream commit 0e72b785b60e2a33f7bfe1c492f0717e7835b9a4 ] Use an explicit variable "card" for the card addressing in function _zcrypt_send_cprb instead of the confusing field "user_defined" from the ica_xcRB struct. This makes the code somewhat cleaner and easier to understand. Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Stable-dep-of: 7b88e8b6d714 ("s390/zcrypt: Guard domain index uses against speculative bypass") Signed-off-by: Sasha Levin commit 74ba8a8a61f5f800cba6997b0eaa5c923ba242ac Author: Harald Freudenberger Date: Fri Oct 2 12:52:36 2026 +0200 s390/zcrypt: Fix and improve zcrypt reply message verification checks [ Upstream commit 5e9b339f323216d71f3ede8a0a427abf7859c486 ] Add or improve checks related to buffer sizes and reply sizes to the handling of replies from the crypto cards for CCA, EP11 (AP message type 6) and ICA (AP type 50) messages. The verification code related to reply field length was not designed well and thus firmware deficiencies could lead to unexpected behavior in the zcrypt device driver. Thus improve the code to more closely inspect especially length fields at message replies. Add length validation before accessing reply message structures in zcrypt_msgtype6_receive(), zcrypt_msgtype6_receive_ep11(), and zcrypt_msgtype50_receive() to prevent out-of-bounds reads and potential kernel memory disclosure. Also rework these three functions to validate reply lengths more carefully before copying data back into the request buffer. Use size_t for length calculations, reject inconsistent reply sizes, and add defensive handling for short invalid replies. For XCRB replies, validate both reply segments and derive the effective message length from the covered range instead of trusting only the second segment. Additionally improve some of the later invoked evaluation functions which further check the payload. Add comments about length assumptions and for the type50 processing rework the payload processing completely with removing a misplaced BUG_ON(). Fixes: 5e55a488c87a ("s390/zcrypt: Separate msgtype implementation from card modules.") Signed-off-by: Harald Freudenberger Cc: stable@vger.kernel.org Reviewed-by: Holger Dengler Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin commit 3f0b385e1d714a5979eba76a13cc9a0338171855 Author: Harald Freudenberger Date: Wed Mar 18 17:41:30 2026 +0100 s390/zcrypt: Make apfs a real unsigned int field [ Upstream commit ecd2fd113e89978ca750a81dea033a2e9f3347df ] Slight rework on the apfs field: Instead of unsigned char[4] make this a real 32 bit unsigned int field. With that done, some assignments and some printouts can be simplified. With that comes a slight move of the anonymous struct covering the message type 86 header to dedupe some code lines. Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik Stable-dep-of: 5e9b339f3232 ("s390/zcrypt: Fix and improve zcrypt reply message verification checks") Signed-off-by: Sasha Levin commit fa60c9c122aafc06dff48f451ad550630587a0bb 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 c147169ff08ae54d20e1b83d8bb70aedb56e79ef 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 1b389d9cb3648f6dfe86a59d9e4cd4d51741690f 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 ab5f0b5eff11c776123e0630dfdb14f9ba598b27 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 31c378b8ef131a890dc0ffbf0ba27a168eca20bc 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 74f9a73053cc3cf6e6177d3c5ea9736adf1bdaf6 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 9f0dcb70de7558885a9c0a11f81aa77dbd45419e 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 5e67b09fcf31f1ea0a41868d621cff717ecd4c50 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 27e7ca2d0ab65a9e19e98cc721fe1a0c958b6b8a 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 953612cb0115c9ba505fed7ae1621b527f65588f 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 5d950a0eb6820c5f588bca7f262e7bb8ca241ae8 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 78850ab8dc35c7db40ad8f5a50af189901d4a3af 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 70f70f27d8148fc86b725cbc033ecc98622a8df0 Author: Jori Koolstra Date: Thu Aug 13 12:28:17 2026 -0400 net: af_unix: useful handling of LSM denials on SCM_RIGHTS [ Upstream commit fd8756fa1487577535d6294ae7cc67888b19ae2a ] Right now if some LSM such as Smack denies an AF_UNIX socket peer to receive an SCM_RIGHTS fd, the SCM_RIGHTS fd array will be cut short at that point, and MSG_CTRUNC is set on return of recvmsg(). This is highly problematic behaviour, because it leaves the receiver wondering what happened. As per man page MSG_CTRUNC is supposed to indicate that the control buffer was sized too short, but suddenly a permission error might result in the exact same flag being set. Moreover, the receiver has no chance to determine how many fds got originally sent and how many were suppressed.[1] Add a SO_RIGHTS_NOTRUNC option to UNIX sockets to enable more useful handling of LSM denials when receiving SCM_RIGHTS messages: instead of truncating the message at the first blocked fd, keep every fd slot and store the LSM errno in the blocked slot. The socket option is inherited by the child accept() socket if set on the listen() socket. [1]: https://github.com/uapi-group/kernel-features#useful-handling-of-lsm-denials-on-scm_rights Reviewed-by: Christian Brauner (Amutable) Signed-off-by: Jori Koolstra Link: https://patch.msgid.link/20260813162818.149248-4-jkoolstra@xs4all.nl Signed-off-by: Jakub Kicinski Stable-dep-of: 0359338fd8cf ("af_unix: Inherit SO_INQ in unix_stream_connect()") Signed-off-by: Sasha Levin commit 5e29fbd78c4afa1f0fc12b8557aaa4f73850e804 Author: Jori Koolstra Date: Thu Aug 13 12:28:16 2026 -0400 net: scm: move scm_detach_fds() from common path to scm_recv_unix() [ Upstream commit 48b84acc5e18655f2a02fe2a043330d03f939ffe ] scm->fp can only be set when using UNIX sockets, therefore we should move it out of the common path __scm_recv_common() into scm_recv_unix(). Reviewed-by: Kuniyuki Iwashima Signed-off-by: Jori Koolstra Link: https://patch.msgid.link/20260813162818.149248-3-jkoolstra@xs4all.nl Signed-off-by: Jakub Kicinski Stable-dep-of: 0359338fd8cf ("af_unix: Inherit SO_INQ in unix_stream_connect()") Signed-off-by: Sasha Levin commit afd469adbf80445cc5ebd8bd6b283bdf43cbc7af 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 8b321b00ac302d747bc330ef385182d0dd21b800 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 990e50b40c6751ef0921782bac2a0e22c2195a1e 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 1cb48bbdf2c8f20182411ae2ce3708490655c98c 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 08279f193686cf50c0060e318a5f54e1b752e98e 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 acd5cd4e8cf0bf2adaa13323df7211522e682b8c 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 42bb143b7ac2b45a1d014272fb72fb111c8347af Author: Matt Roper Date: Fri Feb 20 09:27:44 2026 -0800 drm/xe/wa_oob: Consolidate some OOB rules [ Upstream commit a2d0403de6492a32e5c175b22ebac053f579d350 ] Given the new policy of allowing graphics/media IP ranges to extend over unused IP versions, we can consolidate some of the OOB workaround rules and simplify the table. If new IP variants eventually show up that use these unused versions (e.g., media version 30.01, graphics versions 20.03 / 30.02, etc.), and if an existing workaround does not extend to that new intermediate version, the ranges will be split back apart as part of the enablement work for that new IP version. Reviewed-by: Shuicheng Lin Link: https://patch.msgid.link/20260220-forupstream-wa_cleanup-v2-22-b12005a05af6@intel.com Signed-off-by: Matt Roper Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit caa242254798d609bae678fda48c89b1a2e55a3f Author: Matt Roper Date: Fri Feb 20 09:27:24 2026 -0800 drm/xe/pvc: Drop pre-prod workarounds [ Upstream commit 4405938293631604f0bec290c2e30bd392608393 ] Production PVC hardware had a graphics stepping of C0. Xe1 platforms already aren't officially supported by the Xe driver, but pre-production steppings are especially out of scope (and 'has_pre_prod_wa' is not set in the device descriptor). Drop the workarounds that aren't relevant to production hardware. v2: - Drop the stream->override_gucrc which is no longer set anywhere after the removal of Wa_1509372804. (Bala) - Drop xe_guc_rc_set_mode / xe_guc_rc_unset_mode which are no longer used after the removal of Wa_1509372804. Bspec: 44484 Cc: Balasubramani Vivekanandan Reviewed-by: Balasubramani Vivekanandan Link: https://patch.msgid.link/20260220-forupstream-wa_cleanup-v2-2-b12005a05af6@intel.com Signed-off-by: Matt Roper Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit fb171709c3891a71a679b4a154d0639a8b8bea25 Author: Vinay Belgaumkar Date: Tue Feb 3 17:42:34 2026 -0800 drm/xe: Add a wrapper for SLPC set/unset params [ Upstream commit fabedb758fcb16fcd80230c28356f8aaff972446 ] Also, extract out the GuC RC related set/unset param functions into xe_guc_rc file. GuC still allows us to override GuC RC mode using an SLPC H2G interface. Continue to use that interface, but move the related code to the newly created xe_guc_rc file. Cc: Riana Tauro Cc: Michal Wajdeczko Reviewed-by: Riana Tauro Reviewed-by: Michal Wajdeczko Signed-off-by: Vinay Belgaumkar Link: https://patch.msgid.link/20260204014234.2867763-4-vinay.belgaumkar@intel.com Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit 519c986ecf6e4f6cae940e78f1d203c13482ca79 Author: Vinay Belgaumkar Date: Tue Feb 3 17:42:32 2026 -0800 drm/xe: Decouple GuC RC code from xe_guc_pc [ Upstream commit 40a684f91d267164f9adf0d35b572b4cad0b8d3c ] Move enable/disable GuC RC logic into the new file. This will allow us to independently enable/disable GuC RC and not rely on SLPC related functions. GuC already provides separate H2G interfaces to setup GuC RC and SLPC. Cc: Riana Tauro Cc: Michal Wajdeczko Reviewed-by: Michal Wajdeczko Reviewed-by: Riana Tauro Signed-off-by: Vinay Belgaumkar Link: https://patch.msgid.link/20260204014234.2867763-2-vinay.belgaumkar@intel.com Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit b075780d76155d59d91f933c7f6e3e2b70a274cd Author: Matt Roper Date: Tue Nov 18 08:43:45 2025 -0800 drm/xe/guc_pc: Use scope-based cleanup [ Upstream commit e9bc4162bf39154c1eb8d5edb11a00fc30771c39 ] Use scope-based cleanup for forcewake and runtime PM in the GuC PC code. This allows us to eliminate to goto-based cleanup and simplifies some other functions. Reviewed-by: Gustavo Sousa Link: https://patch.msgid.link/20251118164338.3572146-35-matthew.d.roper@intel.com Signed-off-by: Matt Roper Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit 0fd7551ecdf61b9fce1a4b886816df2b5fb7dc43 Author: Matt Roper Date: Tue Nov 18 08:43:40 2025 -0800 drm/xe/forcewake: Add scope-based cleanup for forcewake [ Upstream commit 074edfbdfba25493324807f749fbc86bf0af3a2d ] Since forcewake uses a reference counting get/put model, there are many places where we need to be careful to drop the forcewake reference when bailing out of a function early on an error path. Add scope-based cleanup options that can be used in place of explicit get/put to help prevent mistakes in this area. Examples: CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT); Obtain forcewake on the XE_FW_GT domain and hold it until the end of the current block. The wakeref will be dropped automatically when the current scope is exited by any means (return, break, reaching the end of the block, etc.). xe_with_force_wake(fw_ref, gt_to_fw(ss->gt), XE_FORCEWAKE_ALL) { ... } Hold all forcewake domains for the following block. As with the CLASS usage, forcewake will be dropped automatically when the block is exited by any means. Use of these cleanup helpers should allow us to remove some ugly goto-based error handling and help avoid mistakes in functions with lots of early error exits. An 'xe_force_wake_release_only' class is also added for cases where a forcewake reference is passed in from another function and the current function is responsible for releasing it in every flow and error path. v2: - Create a separate constructor that just wraps xe_force_wake_get for use in the class. This eliminates the need to update the signature of xe_force_wake_get(). (Michal) v3: - Wrap xe_with_force_wake's 'done' marker in __UNIQUE_ID. (Gustavo) - Add a note to xe_force_wake_get()'s kerneldoc explaining that scope-based cleanup is preferred when possible. (Gustavo) - Add an xe_force_wake_release_only class. (Gustavo) v4: - Add NULL check on fw in release_only variant. (Gustavo) Cc: Michal Wajdeczko Cc: Gustavo Sousa Reviewed-by: Gustavo Sousa Link: https://patch.msgid.link/20251118164338.3572146-30-matthew.d.roper@intel.com Signed-off-by: Matt Roper Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit 88bbc576208f8b7b4f5fc7180fd2373f15111a18 Author: Sk Anirban Date: Thu Nov 13 00:21:55 2025 +0530 drm/xe/guc: Eliminate RPe caching for SLPC parameter handling [ Upstream commit 2917e17b5fd25447a702e79f4ecba3e3b3e08d58 ] RPe is runtime-determined by PCODE and caching it caused stale values, leading to incorrect GuC SLPC parameter settings. Drop the cached rpe_freq field and query fresh values from hardware on each use to ensure GuC SLPC parameters reflect current RPe. v2: Remove cached RPe frequency field (Rodrigo) v3: Remove extra variable (Vinay) Modify function name (Vinay) v4: Maintain a separate function for PVC (Rodrigo) v5: Avoid RPn update while fetching RPe frequency (Rodrigo) v6: Split platform-specific RPe comments (Vinay) Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5166 Signed-off-by: Sk Anirban Reviewed-by: Vinay Belgaumkar Link: https://patch.msgid.link/20251112185153.3593145-5-sk.anirban@intel.com Signed-off-by: Rodrigo Vivi Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit 8b9f8cd6bdbef4164b3a3108270f538f30a5f66a Author: Shekhar Chauhan Date: Thu Oct 16 19:26:20 2025 -0700 drm/xe/xe3: Add support for graphics IP versions 30.04 & 30.05 [ Upstream commit 4fde66699f1ced2eeb6e58ff0eaf46e4fc92a7a0 ] Add graphics IP versions 30.04 & 30.05 and initial workarounds for these IP versions. BSpec: 74201 Signed-off-by: Shekhar Chauhan Reviewed-by: Matt Roper Link: https://lore.kernel.org/r/20251016-xe3p-v3-1-3dd173a3097a@intel.com Signed-off-by: Lucas De Marchi Stable-dep-of: 557c7b434378 ("drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule") Signed-off-by: Sasha Levin commit 087f9763557bad13d5de65e3dbf1a018ba6164c2 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 883029b03ad35fa5d1062c4f4f9103f759835683 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 39b3b79e44b7c6b46afc396d1dd369795ce14f13 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 a27c81237b0c0c42a6459b4bf4a9ea513b3fa0cd 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 f5d148ebbd4f548760dde16d85b0634449f86abf 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 01ae98c5f216d04e29d1746f92e6bc405e315135 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 3b07ffb280cf172e9185334c15d91b0c2c96f372 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 ce75b991f292acc0a7f9471f56aa65136dfe3ff1 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 04e579f6ac9d706ddad060ba1bc9581e1f9aa693 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 c13237c920285a516a982b9b6e42b39d6b30035a 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 ff35983adf21f226492b5b733e430cfa14bcdb5f 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 8d9c99d42d9e7a585325f37b76501a5d1a43e821 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 dbc786eeb4d0177e229acc47f120ed5cad632e32 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 5f348bea3aade4b87133b297c5a0ba82fffaa218 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 a7953fe27e521a1031de6b92c09229f2e92af9fb 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 7d1bb706ffa4c1ef7e06858c91fe9c35b1892be4 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 c64346392e20825d60a332c642b329d1ef495bd5 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 f45eb60880a1d715a8f68c62c1410a9425b33ad5 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 09dfaacbb50f4d11a547ea49c49e934bfe90de5c 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 f6903d784ba0ddeb85b3611bc5c65b474bdac36c 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 cabaf2c3c942880d3850f29d76414e7007f4c985 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 836710f7981b3c4acb137613973b57f97942962d 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 4b74df1ad60adf8561993968c4bee96d865b506a 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 b683a35a8fdc2a03cff2a4e78578752dc1f58ce7 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 cdab372f827b8933816aba50199bcb914ce3ff2c 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 90428ca0f2c703d0dee5b3019d360542d9b731f8 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 503b7430030ac1d73d52b44f60a168ded4becfc0 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 6028ad9dea291706b87024ff426c48e05d749d04 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 fd753ca26b5409309fd4631b658d0e23886fa236 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 c8e58f3d29cff5b0e6d71ba85a4c7db731e07eb2 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 5f5d5e048c6d125391a8d4ceb5fef2ca4fd2a80b Author: Alexander Duyck Date: Fri Nov 21 08:40:31 2025 -0800 fbnic: Add logic to track PMD state via MAC/PCS signals [ Upstream commit 9963117a2b9b29074763ccb62fe8ee4d78ca46f2 ] One complication with the design of our part is that the PMD doesn't provide a direct signal to the host. Instead we have visibility to signals that the PCS provides to the MAC that allow us to check the link state through that. We will need to account for several things in the PMD and firmware when managing the link. Specifically when the link first starts to come up the PMD will cause the link to flap. This is due to the firmware starting a training cycle when the link is first detected. This will cause link flapping if we were to immediately report link up when the PCS first detects it. To address that we are adding a pmd_state variable that is meant to be a countdown of sorts indicating the state of the PMD. If the link is down or has been reconfigured the PMD will start out in the initialize state. By default the link is assumed to be in the SEND_DATA state if it is available on initial link inspection. If link is detected while in the initialize state the PMD state will switch to training, and if after 4 seconds the link is still stable we will transition to link_ready, and finally the send_data state. With this we can avoid link flapping when a cable is first connected to the NIC. One side effect of this is that we need to pull the link state away from the PCS. For now we use a union of the PCS link state register value and the pmd_state. The plan is to add a PMD register to report the pmd_state to the phylink interface. With that we can then look at switching over to the use of the XPCS driver for fbnic instead of having an internal one. Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/176374323107.959489.14951134213387615059.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Paolo Abeni Stable-dep-of: 05ec5504ff69 ("fbnic: Fix service task races with ndo_stop and PM suspend") Signed-off-by: Sasha Levin commit 0b1782c494e19fc88a53b99b111a38e0d3ca75fc Author: Alexander Duyck Date: Fri Nov 21 08:40:23 2025 -0800 fbnic: Rename PCS IRQ to MAC IRQ as it is actually a MAC interrupt [ Upstream commit f18dd1b15f7a0bea5743fcbf3a62b7d2940e2dd5 ] Throughout several spots in the code I had called out the IRQ as being related to the PCS. However the actual IRQ is a part of the MAC and it is just exposing PCS data. To more accurately reflect the owner of the calls this change makes it so that we rename the functions and values that are taking in the interrupt value and processing it to reflect that it is a MAC call and not a PCS one. This change is mostly motivated by the fact that we will be moving the handling of this interrupt from being PCS focused to being more PMA/PMD focused as this will drive the phydev driver that I am adding instead of driving the PCS directly. Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/176374322373.959489.12018231545479053860.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Paolo Abeni Stable-dep-of: 05ec5504ff69 ("fbnic: Fix service task races with ndo_stop and PM suspend") Signed-off-by: Sasha Levin commit 37d1116c9e27c79f9f595d5299c2da4c3239f398 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 eca4ed8417e03f85a44e78b4c5af9b67198e77ed 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 f9c8a67bb8c1c69e5c75fb84ef0ccf43e6e06008 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 [ sashal: refreshed the .fs_flags context line, since adedb6a00a1e (FS_ALLOW_IDMAP) is not queued ] Signed-off-by: Sasha Levin commit e56eefcd48eafb8b65690a6bd226b5c1f55b60c1 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 0105a90de7348fd7cf08afbe63062b208b452159 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 8d37f8e49548fefc74de1b2a677036c263a24c14 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 2ce3e2f1ae9c31dbff747428f03aa78ee6876dfe 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 0b71b1991b0e2e2f48fa0e6d1226c9d66f551509 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 c3fd11f2bb0b0f32acdd633ef7bc6773c66229cb 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 cabd5c79a4aebc97aa5672008027723b683d69b3 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 64060642d78f239b6231c3d5be85059d6c1695cf 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 a5e2848d744a8bd9968578a9c309ea600559d654 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 db6efd8c6b2ed49832096aecea48825cea72796d Author: Nikola Z. Ivanov Date: Fri Nov 28 09:25:44 2025 +0200 team: Add matching error label for failed action [ Upstream commit aee0f01b4f118844cb126a5f27e91c2adf087c59 ] Follow the "action" - "err_action" pairing of labels found across the source code of team net device. Currently in team_port_add the err_set_slave_promisc label is reused for exiting on error when setting allmulti level of the new slave. Signed-off-by: Nikola Z. Ivanov Reviewed-by: Simon Horman Reviewed-by: Jiri Pirko Link: https://patch.msgid.link/20251128072544.223645-1-zlatistiv@gmail.com Signed-off-by: Jakub Kicinski Stable-dep-of: ff618cb00a64 ("team: fix promisc/allmulti leak in team_port_add error path") Signed-off-by: Sasha Levin commit d0b29ee69e1d14e62bdbe239bdb7c68f145e04dc 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 22bd2760f18c7b3a1d3ae95253a0b286f5708eda 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 330ca878e73609861c190d73854de0f81b26e938 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 f431faaff8f316d7e19eee5930cccb29d415718a 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 feaaed040262e1a74c9e3cff91fd9d27849a4661 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 3c375c11b9b1ec1d539d80632652e835aa6ec36e 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 302a1143b0b55cf0403a3b73f6efd4f6f05d4762 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 638d6c68bcfabe708c128522dfe733b776c64764 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 816bb1819892fa400a652b46940eda6d02d0a295 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 0494c2cc34bc0f4415090c937690b0278952afe8 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 0c04072d3c7d0c9c7a82aa538dbe16854b4366cb 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 0061c4ad01ace9ff4334553780ae3be4a8a8f2b5 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 edd05899dcb27c7d884c4fb5164472f6cc5ae740 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 6f0f00249de0a4b370b965c02adb51d1e097d8b1 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 53e8c5e077a113954c27b89f9663add10ed95fb8 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 80abb36be1ad8952d8ee64f1f54427f2b5da4d09 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 6b3a2e0f8843b233a98ebdd82099bb34d474cf5d 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 c28535f6a738c961d41a5f21313771305bcf306d 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 535df27e101ddce2a30dd1b27b02ff334582940d 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 4abc2bb0825d1edd3a1ca8e7a65c320ea965279e 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 7a2a680ddde0dc0de0ecd6494989d20a8d233cd1 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 6700986570d290c0e42732a026f6bbe626174832 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 4c7bd584c62108865f0640fd17b39400d409f178 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 6d4fa6707f67e91483509c6c09c3969cc7423926 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 a511687f622b00b849fb0016fdc961e37e79820f 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 6ad1f6fb958f5e846c09347721ca7d1ca9e6385f 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 7ea0eb5e60b37d0e277bfc4546cea4f647ef2e5d 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 e22558cb6e1c28c705992b4bf3df5000c9b7e8ac Author: Jeff Layton Date: Tue Mar 24 13:32:11 2026 -0400 nfs: fix utimensat() for atime with delegated timestamps [ Upstream commit 16d99dce938ecbbc703843a31fb951acca46af27 ] xfstest generic/221 is failing with delegated timestamps enabled. When the client holds a WRITE_ATTRS_DELEG delegation, and a userland process does a utimensat() for only the atime, the ctime is not properly updated. The problem is that the client tries to cache the atime update, but there is no mtime update, so the delegated attribute update never updates the ctime. Delegated timestamps don't have a mechanism to update the ctime in accordance with atime-only changes due to utimensat() and the like. Change the client to issue an RPC in this case, so that the ctime gets properly updated alongside the atime. Fixes: 40f45ab3814f ("NFS: Further fixes to attribute delegation a/mtime changes") Reported-by: Olga Kornievskaia Signed-off-by: Jeff Layton Signed-off-by: Trond Myklebust Stable-dep-of: a38d7cc8c90f ("NFS: update ctime for atime-only UTIME_NOW requests") Signed-off-by: Sasha Levin commit 6a001c1691c6810cf088bd57a79b4c5ad1fd7acb 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 5179c687c862566b2f34f2ba5c602cbc6dda9ebf 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 56874f7cc8f1157a35ba5376125a4fc8874a1eb0 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 2ef399aa8a477f0edd606774b0ceb435f0bf62c7 Author: Eric Dumazet Date: Thu Apr 30 10:00:20 2026 +0000 tcp: move tp->bytes_acked to tcp_sock_write_tx group [ Upstream commit dd033ec406b4d9eade3e0fd998ec9bfa50db42ba ] tp->bytes_acked is touched in TX path only. Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260430100021.211139-5-edumazet@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: c2213d9b61c1 ("tcp: rate limit receive queue collapsing") Signed-off-by: Sasha Levin commit 1dc6515ebdbf3489e8f49bc5eab66feaab53ba0f Author: Eric Dumazet Date: Thu Apr 30 10:00:19 2026 +0000 tcp: move tp->first_tx_mstamp and tp->delivered_mstamp to tcp_sock_write_tx [ Upstream commit 07db42c4b3eb60a21645ad88211b69933eab0a03 ] These fields are touched in when payload is sent. Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260430100021.211139-4-edumazet@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: c2213d9b61c1 ("tcp: rate limit receive queue collapsing") Signed-off-by: Sasha Levin commit 1567c1917869839254a3603c15e68e0c003fdd45 Author: Eric Dumazet Date: Thu Apr 30 10:00:18 2026 +0000 tcp: move tp->segs_in and tp->segs_out to tcp_sock_write_txrx group [ Upstream commit 2b28dd212a8ad67b100137626a3d008b1e40a740 ] segs_in is changed for each incoming packet, including ACK packets. segs_out is changed for each outgoing packet, including ACK packets. They belong to tcp_sock_write_txrx group. Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260430100021.211139-3-edumazet@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: c2213d9b61c1 ("tcp: rate limit receive queue collapsing") Signed-off-by: Sasha Levin commit 635b0322af338f973752e73c67600841649e0c6c Author: Eric Dumazet Date: Thu Apr 30 10:00:17 2026 +0000 tcp: move tp->delivered and tp->delivered_ce to tcp_sock_write_tx group [ Upstream commit 9f810527a343fd72671fe7661ebb3694396f45ed ] These counters are changed whenever sent data is acknowleged. They do not belong to tcp_sock_write_txrx group, because TCP receivers do not touch them. Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260430100021.211139-2-edumazet@google.com Signed-off-by: Jakub Kicinski Stable-dep-of: c2213d9b61c1 ("tcp: rate limit receive queue collapsing") Signed-off-by: Sasha Levin commit 764acba5db830905cc5cc7c977e127d588511055 Author: Ilpo Järvinen Date: Sat Jan 31 23:25:01 2026 +0100 tcp: try to avoid safer when ACKs are thinned [ Upstream commit 7885ce0147401d5f6908ad4da660334031d836b7 ] Add newly acked pkts EWMA. When ACK thinning occurs, select between safer and unsafe cep delta in AccECN processing based on it. If the packets ACKed per ACK tends to be large, don't conservatively assume ACE field overflow. This patch uses the existing 2-byte holes in the rx group for new u16 variables withtout creating more holes. Below are the pahole outcomes before and after this patch: [BEFORE THIS PATCH] struct tcp_sock { [...] u32 delivered_ecn_bytes[3]; /* 2744 12 */ /* XXX 4 bytes hole, try to pack */ [...] __cacheline_group_end__tcp_sock_write_rx[0]; /* 2816 0 */ [...] /* size: 3264, cachelines: 51, members: 177 */ } [AFTER THIS PATCH] struct tcp_sock { [...] u32 delivered_ecn_bytes[3]; /* 2744 12 */ u16 pkts_acked_ewma; /* 2756 2 */ /* XXX 2 bytes hole, try to pack */ [...] __cacheline_group_end__tcp_sock_write_rx[0]; /* 2816 0 */ [...] /* size: 3264, cachelines: 51, members: 178 */ } Signed-off-by: Ilpo Järvinen Co-developed-by: Chia-Yu Chang Signed-off-by: Chia-Yu Chang Acked-by: Paolo Abeni Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20260131222515.8485-2-chia-yu.chang@nokia-bell-labs.com Signed-off-by: Paolo Abeni Stable-dep-of: c2213d9b61c1 ("tcp: rate limit receive queue collapsing") Signed-off-by: Sasha Levin commit 3b4dcc1aa94e0572bb7c8c2db4dfd65b0daadc97 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 9ca93780dacf479876e6b6687aa216711c1d90bb 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 d338893ed4b90848b0bbfea3f028091bd0122199 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 b9d98dbc30312db7eeb77f4ed46af9573f17bc93 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 3c8f01af0b73fa3ae7b419a484f0cb51f6729c9f 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 c5c4e275a5f95f016cd9a0e3cfda63f44b7a9234 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 a5639ba463867ad47bfab44e36c74cff0510d024 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 1e321a6fab3efa3f9dd19c5e78d53dfdc2530320 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 22954ad665a1de71012fc5a37e3078ed44efb051 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 5338a54b565060f3c450320ac11dadc7b8167bc3 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 93e891850ce9ee92e788106341c18fc26591043e 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 6e4c39a8df5e94189e6d57ca960fa0c4054b4193 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 6f64582595ca47251d1b9a6ed4924b79cb27d560 Author: Prasad Kumpatla Date: Tue Aug 4 12:33:06 2026 +0530 ASoC: qcom: common: add DAI-node TDM slot helpers [ Upstream commit 1e844ecbc9cbd7c88543c5a84c0d1e434f46fd8b ] Add common helpers to parse standard dai-tdm-slot-* properties from the CPU and codec child nodes of a backend DAI link and apply the result to the active DAIs. QCOM machine drivers already use qcom_snd_parse_of() to build links from DT, but they lacked a shared helper to translate endpoint TDM properties into snd_soc_dai_set_tdm_slot() calls. Boards therefore had to carry ad hoc parsing or rely on non-standard DT properties. The helpers parse endpoint masks, validate the shared slot count and slot width, and program CPU and codec DAIs with the resulting slot configuration. A cfg-based apply helper is provided for callers that already parsed the DT data and want to avoid a second DT traversal. Signed-off-by: Prasad Kumpatla Link: https://patch.msgid.link/20260804070307.117119-7-prasad.kumpatla@oss.qualcomm.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 6ed4b0164758f99314b46c3fee7256426724b02d Author: Srinivas Kandagatla Date: Thu Apr 2 08:11:12 2026 +0000 ASoC: qcom: common: validate cpu dai id during parsing [ Upstream commit d49ee8faefecd4d2eb5c6c9f419f4db9488d68aa ] lpass ports numbers have been added but the afe/apm driver never got updated with new max port value that it uses to store dai specific data. There are more than one places these values are cached and always become out of sync. This will result in array out of bounds and weird driver behaviour. To catch such issues, first add a single place where we can define max port and second add a check in common parsing code which can error out before corrupting the memory with out of bounds array access. This should help both avoid and catch these type of mistakes in future. Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260402081118.348071-8-srinivas.kandagatla@oss.qualcomm.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 7871fa0761f06293f27d8f4803adff06aad017d3 Author: Srinivas Kandagatla Date: Thu Apr 2 08:11:11 2026 +0000 ASoC: dt-bindings: qcom: add LPASS LPI MI2S dai ids [ Upstream commit e46957f27c6004f3ab5ec456f4e848950364ebc1 ] Add new dai ids entries for LPASS LPI MI2S and SENARY MI2S audio lines. Co-developed-by: Mohammad Rafi Shaik Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260402081118.348071-7-srinivas.kandagatla@oss.qualcomm.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 690e64735c404f6d95cfc282ad044507c3bbd44c Author: Srinivas Kandagatla Date: Wed Oct 22 15:33:47 2025 +0100 ASoC: qcom: sdw: remove redundant code [ Upstream commit d02460317ed9c95aa2c5f6ff1c70e22e1857d95d ] remove redundant code and pointers to handle sdw_stream_runtime by making use of qcom_snd_sdw_get_stream(). This removes need of machine specific shutdown and hw_params sdw callbacks and also need to store sdw_stream_runtime pointers in machine drivers. Signed-off-by: Srinivas Kandagatla Tested-by: Steev Klimaszewski # Thinkpad X13s Link: https://patch.msgid.link/20251022143349.1081513-3-srinivas.kandagatla@oss.qualcomm.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 a03f9acb513b675626acbef92d4fe6198ebb46bb 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 263ddb0eea21b849f40261db7cd4d4403db5b9f7 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 76ce85774446549988da6d5eb695471f832f63e7 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 5e22a760a23ee3298b525b1bc6b0647272d6bf4b 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 d66c5e8956cdc6ab0e975944e09c06ce8509fb96 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 4eb2c7c6795125671018c47f674eb3483970078c 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 570da59019c13ddb780ab23ba784c079eb5373b1 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 f3035738ed4439fafd2670f56f2becc2ffa9c3b7 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 a6df867641e922da26db14a4f9b8875cec470d9a Author: Mallesh Koujalagi Date: Mon May 4 16:33:01 2026 +0530 drm/xe/xe_survivability: Simplify runtime survivability error handling [ Upstream commit 2b8c1d7fe0d521f9d264ef08c15760235e61c341 ] xe_survivability_mode_runtime_enable() returns an int, but its caller csc_hw_error_work() ignores the return value and cannot take any meaningful recovery action on failure. The function logs errors via dev_err() and proceeds to declare the device wedged regardless of sysfs creation failure, making the return value redundant. Change the return type to void and remove the unnecessary error handling in the caller. v2: - Return is not require after the sysfs creation fail. (Rodrigo/Riana) - Change int to void return type. (Rodrigo) - Remove extra message from csc_hw_error_work(). v3: - Remove ret variable. (Raag) v4: - Drop ret variable from other part of code. v5: - Reframe as refactoring instead of bug fix. (Raag) - Remove Fixes tag and update subject line. Signed-off-by: Mallesh Koujalagi Reviewed-by: Raag Jadav Link: https://patch.msgid.link/20260504110300.1467303-2-mallesh.koujalagi@intel.com Signed-off-by: Rodrigo Vivi Stable-dep-of: a890a885b982 ("drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM") Signed-off-by: Sasha Levin commit cb5c58c963434a2c9b4146ca3c7c827d75df2a23 Author: Riana Tauro Date: Mon Dec 8 14:15:41 2025 +0530 drm/xe/xe_survivability: Redesign survivability mode [ Upstream commit f4e9fc967afdb53b1203f894fb4b68451a7fe202 ] Redesign survivability mode to have only one value per file. 1) Retain the survivability_mode sysfs to indicate the type cat /sys/bus/pci/devices/0000\:03\:00.0/survivability_mode (Boot / Runtime) 2) Add survivability_info directory to expose boot breadcrumbs. Entries in survivability mode sysfs are only visible when boot breadcrumb registers are populated. /sys/bus/pci/devices/0000:03:00.0/survivability_info ├── aux_info0 ├── aux_info1 ├── aux_info2 ├── aux_info3 ├── aux_info4 ├── capability_info ├── postcode_trace └── postcode_trace_overflow Capability Info: Provides data about boot status and has bits that indicate the support for the other breadcrumbs Postcode Trace / Postcode Trace Overflow : Each postcode is represented as an 8-bit value and represents a boot failure event. When a new failure event is logged by Pcode the existing postcodes are shifted left. These entries provide a history of 8 postcodes. Auxiliary Info: Some failures have additional debug information. Signed-off-by: Riana Tauro Reviewed-by: Rodrigo Vivi Link: https://patch.msgid.link/20251208084539.3652902-5-riana.tauro@intel.com Signed-off-by: Rodrigo Vivi Stable-dep-of: a890a885b982 ("drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM") Signed-off-by: Sasha Levin commit 2e2395f9d9ae0c420c21919dd638883969af3e1c 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 46048f725d7d35d24183c0407df1763e533652a6 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 234128e5f26606a9f18b9342e483ca98dd34719d 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 42c5a5fd254bc9c2b4ac62d06d5927b57fdfadeb 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 b14d99a4a1b3e1049ee98b1f4fae18731c1a2b5d 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 cea405adb2f04f2f9607fa82f900f31bb4f9b037 Author: Pasha Tatashin Date: Sat Nov 1 10:23:23 2025 -0400 liveupdate: kho: move to kernel/liveupdate [ Upstream commit 48a1b2321d763b5edeaf20bd4576d8c4b5df772b ] Move KHO to kernel/liveupdate/ in preparation of placing all Live Update core kernel related files to the same place. [pasha.tatashin@soleen.com: disable the menu when DEFERRED_STRUCT_PAGE_INIT] Link: https://lkml.kernel.org/r/CA+CK2bAvh9Oa2SLfsbJ8zztpEjrgr_hr-uGgF1coy8yoibT39A@mail.gmail.com Link: https://lkml.kernel.org/r/20251101142325.1326536-8-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Reviewed-by: Jason Gunthorpe Reviewed-by: Mike Rapoport (Microsoft) Cc: Alexander Graf Cc: Changyuan Lyu Cc: Christian Brauner Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Masahiro Yamada Cc: Miguel Ojeda Cc: Pratyush Yadav Cc: Randy Dunlap Cc: Simon Horman Cc: Tejun Heo Cc: Zhu Yanjun Signed-off-by: Andrew Morton Stable-dep-of: 58c5852ca96c ("kho: check fdt_phys in is_kho_boot()") Signed-off-by: Sasha Levin commit 70f7db5d01498b73569e7bf2c4799557832e3b28 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 ecf6531c14dc1eb38e7a28a7c0c998a57eba2ee2 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 073c685107edbf1ea7012451ed43d334e1518621 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 865c1bef430160204287861d69d417ee6a95ed1a 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 90bcf526d9b5a1b58a1078538546e988f871ef89 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 8d28ac33edad7ce8bfa73aee7e8e94f93bfdbe40 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 883ecad5abc320c557cae0c72cbc7b9395bb0882 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 22bf86a26b704046e0a34a6c23a7afab9b1e5fdc 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 e518f21c6299a5f356721c63cff88e19795e0b72 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 cd155dea914ce071014c5e84c216f2e971cf692f 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 0c12f6b7b18ade87dc0a3b1e0738289efb80a22c 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 ddcfde0e8ac1e2aeca46686328ee6c9a267794bd 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 c9e7401182593b3bb4942774c72a9bfa391eae04 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 eb0d8fea8921748c4d080f872492bfbdd9ce3949 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 00fff2ccec94ccab5aab5471f7fea41461294751 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 af7cfd9a160cb5256b34b1dfe91b3f7e7ddcaa3e 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 544d70a5a9b6fd63237a2e290d0b417e4dd1ae22 Author: Lifeng Zheng Date: Tue Dec 2 15:27:26 2025 +0800 cpufreq: Return -EOPNOTSUPP if no policy supports boost [ Upstream commit 77cf053b041fe13d1fdd2e572e16ee7776ff687d ] In cpufreq_boost_trigger_state(), if none of the the policies support boost, policy_set_boost() will not be called and this function will return 0. But it is better to return an error to indicate that the platform doesn't support boost. Signed-off-by: Lifeng Zheng Acked-by: Viresh Kumar Reviewed-by: Jie Zhan [ rjw: Subject and changelog edits ] Link: https://patch.msgid.link/20251202072727.1368285-2-zhenglifeng1@huawei.com Signed-off-by: Rafael J. Wysocki Stable-dep-of: a0cde2b601bc ("cpufreq: Preserve global boost state on failed updates") Signed-off-by: Sasha Levin commit d5a0c953dd92b34baa14918a7975406fa9330db6 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 841f22aefea452ae7134bf3e3dbdd0d76787f837 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 027f4d90230374de8dbf9a6e48cd46a1d4e19795 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 6f2ddd70c025d0972bb22671a8b1bf9a8017ab95 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 563c95acbe8c7070fc50b84931321079f6ba3d29 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 46296baedd20ca100cdc2260415d02a65596e76d 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 b5bc2a76e2a95ba37c5ad6792aa227e8a27620bb 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 90188ac3d07e9212566ad88d112824150abf2ece 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 ac66a877292e51f46ec438f7133c0bd54210d1ac 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 31a8d6b1b0a3487a2d2ae8bec724b709bfe076b5 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 56c7ad9f9713d5a512523459d2538a872bcb18cb 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 43b1603547efab0f0e4a664b338c59c13a8833e3 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 40cd3014fc6265c4fb598369bfe08acb48752dd9 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 ce1da7472e51564067e9ed6d7bce0b0fb7f17e26 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 31bdd468afa47321520a1ad56871ba4a72e9ebff Author: Kan Liang Date: Fri Dec 5 16:16:40 2025 -0800 perf: Add APIs to create/release mediated guest vPMUs [ Upstream commit eff95e170275d9e80b968f335cd03d0ac250d2d1 ] Currently, exposing PMU capabilities to a KVM guest is done by emulating guest PMCs via host perf events, i.e. by having KVM be "just" another user of perf. As a result, the guest and host are effectively competing for resources, and emulating guest accesses to vPMU resources requires expensive actions (expensive relative to the native instruction). The overhead and resource competition results in degraded guest performance and ultimately very poor vPMU accuracy. To address the issues with the perf-emulated vPMU, introduce a "mediated vPMU", where the data plane (PMCs and enable/disable knobs) is exposed directly to the guest, but the control plane (event selectors and access to fixed counters) is managed by KVM (via MSR interceptions). To allow host perf usage of the PMU to (partially) co-exist with KVM/guest usage of the PMU, KVM and perf will coordinate to a world switch between host perf context and guest vPMU context near VM-Enter/VM-Exit. Add two exported APIs, perf_{create,release}_mediated_pmu(), to allow KVM to create and release a mediated PMU instance (per VM). Because host perf context will be deactivated while the guest is running, mediated PMU usage will be mutually exclusive with perf analysis of the guest, i.e. perf events that do NOT exclude the guest will not behave as expected. To avoid silent failure of !exclude_guest perf events, disallow creating a mediated PMU if there are active !exclude_guest events, and on the perf side, disallowing creating new !exclude_guest perf events while there is at least one active mediated PMU. Exempt PMU resources that do not support mediated PMU usage, i.e. that are outside the scope/view of KVM's vPMU and will not be swapped out while the guest is running. Guard mediated PMU with a new kconfig to help readers identify code paths that are unique to mediated PMU support, and to allow for adding arch- specific hooks without stubs. KVM x86 is expected to be the only KVM architecture to support a mediated PMU in the near future (e.g. arm64 is trending toward a partitioned PMU implementation), and KVM x86 will select PERF_GUEST_MEDIATED_PMU unconditionally, i.e. won't need stubs. Immediately select PERF_GUEST_MEDIATED_PMU when KVM x86 is enabled so that all paths are compile tested. Full KVM support is on its way... [sean: add kconfig and WARNing, rewrite changelog, swizzle patch ordering] Suggested-by: Sean Christopherson Signed-off-by: Kan Liang Signed-off-by: Mingwei Zhang Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Tested-by: Xudong Hao Link: https://patch.msgid.link/20251206001720.468579-5-seanjc@google.com Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR") Signed-off-by: Sasha Levin commit b6104f830d76225c0aa28a64ac3eac57b2b40ba9 Author: James Clark Date: Tue Nov 11 11:37:55 2025 +0000 perf: Add perf_event_attr::config4 [ Upstream commit cbbfba4847b8a5299d36e002bf864b21bb83295d ] Arm FEAT_SPE_FDS adds the ability to filter on the data source of a packet using another 64-bits of event filtering control. As the existing perf_event_attr::configN fields are all used up for SPE PMU, an additional field is needed. Add a new 'config4' field. Reviewed-by: Leo Yan Tested-by: Leo Yan Reviewed-by: Ian Rogers Acked-by: Peter Zijlstra (Intel) Signed-off-by: James Clark Signed-off-by: Will Deacon Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR") Signed-off-by: Sasha Levin commit eb58cce05d6f3d32adbd2e339084a5f2d52d7816 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 b472dcd2cbf020d5e896fef141b2a9735205b03b 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 64b67f71f18330c93c03872e802579cd2602ee4c 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 22916b61e6df80c4b85a3771ad49dde262aa5d6c 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 f7dc62f64a67de093290964b1cb50785a597c919 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 c07072f4283a3906826ad8373de81413d8dd4995 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 cae5f52705ee4e2da8b57c5a0f0fd9a3bd5d6513 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 0cc028ba43708ec2d8b63b18db9a29faba8a22f1 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 6010c1ed911e7c9a5f0a983fe745d8a0518a81bc 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 2fd2580f20bb14e7595030af37d9922855defe42 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 14f121b0dcd845b50bfc3baa98443f39c08b91af 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 dc2e6af1bb0091228da4387e2cf15512f7aa521c 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 c5fe2c3f5c433cd61a0af60e11c47b6021df70b8 Author: Linus Walleij Date: Mon May 11 21:43:43 2026 +0200 gpio: regmap: Support sparsed fixed direction [ Upstream commit 68d801eabda5219dcc25c9de98d3bbdb5b51b0a5 ] On some regmapped GPIOs apparently only a sparser selection of the lines (not all) are actually fixed direction. Support this situation by adding an optional bitmap indicating which GPIOs are actually fixed direction and which are not. Link: https://lore.kernel.org/linux-gpio/20260501155421.3329862-10-elder@riscstar.com/ Tested-by: Alex Elder Signed-off-by: Linus Walleij Reviewed-by: Michael Walle Reviewed-by: Alex Elder Link: https://patch.msgid.link/20260511-regmap-gpio-sparse-fixed-dir-v3-1-1429ec453be7@kernel.org Signed-off-by: Bartosz Golaszewski Stable-dep-of: 80415a6ff295 ("gpio: regmap: free the irqchip if adding the irq domain fails") Signed-off-by: Sasha Levin commit c4488133c577485e0f3a0f3fdf61e944ca42c178 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 27003b068c80a5c3887d0b615cecda8b454d0973 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 aebdc62c364279d6c4e4adfcdd4501997e4c4c7f 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 bf18b0ec873c80e921d7955dc9ebcfa463264cfb 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 4566c74013490dd498dc6cd66e15d2ca20146a11 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 2fbe0697b5ac389c1ecb6ae0203d740a3ae0b073 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 271bf19715a67762ff16b27d58b0a42d0e99f231 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 2aebcdfe5fe8c35baa9f32014093c848cfafffce 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 67065d8754428736f85204b6b66113400f4394e4 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 8d18da495c8ba945e774327bacbb33aef12bbd7f 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 c9d99c453cd9eaf43b9fd698e2fe561e470166bb Author: Jakub Kicinski Date: Tue Jun 2 18:28:34 2026 -0700 net: bonding: don't recurse on the slave's netdev ops lock [ Upstream commit 107b097790e903651385a96dd96f9be158702730 ] bond_update_speed_duplex() calls __ethtool_get_link_ksettings() on the slave, which will soon take the slave's ops lock. One of its callers already holds it and the other three don't, so the function would either deadlock or run unprotected depending on the path. Make the helper expect the slave's ops lock held and switch to netif_get_link_ksettings(). Wrap the three call sites that don't already hold it: * bond_enslave() (rtnl held; core drops the lower's ops lock around ->ndo_add_slave). * bond_miimon_commit() (rtnl_trylock'd from the mii workqueue). * bond_ethtool_get_link_ksettings() (rtnl held via ethtool layer, bond device itself is not ops locked). The call site which does already hold the ops lock is bond_slave_netdev_event() via NETDEV_UP / NETDEV_CHANGE notifiers, so it stays as-is. Reviewed-by: Nicolai Buchwitz Link: https://patch.msgid.link/20260603012840.2254293-6-kuba@kernel.org Signed-off-by: Jakub Kicinski Stable-dep-of: a76ab5e733b4 ("bonding: fix missing down path on speed/duplex failure after FAIL->UP") Signed-off-by: Sasha Levin commit 8107f2b366199c678268d436d8f6e6748d3613da Author: Jakub Kicinski Date: Tue Jun 2 18:28:33 2026 -0700 net: ethtool: add netif_get_link_ksettings() for correct ops-locked use [ Upstream commit f32fe1d79a18592b96342a0016cd62cf9601a054 ] __ethtool_get_link_ksettings() is exported and called from sysfs and many drivers. It invokes ethtool_ops->get_link_ksettings so by our own docs it should be holding netdev lock for ops locked devices. Looks like commit 2bcf4772e45a ("net: ethtool: try to protect all callback with netdev instance lock") missed adding the ops lock here. There's a number of callers we need to fix up so let's add the netif_get_link_ksettings() helper first, without any actual locking changes (this commit is a nop). Not treating this as a fix because I don't think any driver cares at this point, but if we want to remove the rtnl_lock protection this will become critical. Reviewed-by: Maxime Chevallier Acked-by: Stanislav Fomichev Link: https://patch.msgid.link/20260603012840.2254293-5-kuba@kernel.org Signed-off-by: Jakub Kicinski Stable-dep-of: a76ab5e733b4 ("bonding: fix missing down path on speed/duplex failure after FAIL->UP") Signed-off-by: Sasha Levin commit 0978e904f7e1470f793a6d095a5413a47b31a7df 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 4e7b1021db874617277208f0bb541929d876a7a0 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 e6fdd6e2cb7c0f42dd11b5b90947eb006742b6c2 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 7a430d36761dca13c8f4e90e1dfc5e72910f429d 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 4182fca7b3c2d8305fac30a3568efc9b67403b19 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 59cb936e42ac87ec415f9b21457037dbc1b8b906 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 bddd32ea93d1245df184b13071560abfce82139d 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 6bf14a5195b0deeec7bb8bf8109aecf3c19d8840 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 a5e23d4bf7454eaf60f8b3d4bff947e75c9e2358 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 a9c82f128befaae1db1994906a10772e3bc20b46 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 8b234b4f7ea3c096c723026383cba3acff757940 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 34a99e0be6e3ab2746dfdd00497133b6c8bfda94 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 dab5b55deec1cdbb874dac3ef6dd80f5f1ce111d 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 b6680519df5aebf53bcb05ef5ad77e52e6192f51 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 1cd47f7141bb495ca2d586862786c7ba2a62409a 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 b371ece67088a861e9ce70b21cb81140d2cdc00f 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 c3873457ed940df0bec6423f6eee33fcc4493a66 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 dbd74a69f1d0cbd7737cb928d806e6f5c3ff4e73 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 c9431b06c8fe14e6f9155b275722dd4248c113bf 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 3526fa03ae1e5a8f3107af2df4b1dbf9d035c560 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 d3b2fe088593787020faf7c9f34b0755a5a29e16 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 077641005aa08b24548a41e404c648dfad4d3422 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 318efbd83b38b999dc11a1fe1b445fe2448a43c2 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 181aee5f26ecc8d5654c2ca43862ef669b044302 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 84f23363d4c997facead4048e309406c3c20353e 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 97d2eda8bdfad2cd48eb19cd90958ceac53f1a71 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 c72a1bed4af29b1c69b086aac1f9acaad8e0aa4a 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 651e77bf340d332d13a7acf9ea9ca07dd0fb8e31 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 bf56c730311ed142bb22abb2d9dc6895305458bf Author: Sugar Zhang Date: Tue Feb 3 17:46:31 2026 +0100 ASoC: rockchip: spdif: Fill IEC958 CS info per params [ Upstream commit 07a791020be9b190d4a57b5ee823ede1e98df493 ] Add support to fill IEC958 channel status information. Signed-off-by: Sugar Zhang Signed-off-by: Sebastian Reichel Link: https://patch.msgid.link/20260203-rockchip-spdif-cleanup-and-bsp-sync-v2-9-4412016cf577@collabora.com Signed-off-by: Mark Brown Stable-dep-of: 67a7e2073909 ("ASoC: rockchip_spdif: select REGMAP_MMIO") Signed-off-by: Sasha Levin commit 2ed6337fa4134a88cb527f5444d5ca9d9e491ef6 Author: Sugar Zhang Date: Tue Feb 3 17:46:30 2026 +0100 ASoC: rockchip: spdif: Add support for format S32_LE [ Upstream commit c43ec509019842c0b836e858dc486c216b51b087 ] Treat 32 bit sample width as if it was 24 bits using only the 24 most significant bits. [I've merged the channel-swapping fix from Zohn Ni into Sugar Zhang's patch introducing the problem in the first place] Co-developed-by: Zohn Ni Signed-off-by: Zohn Ni Signed-off-by: Sugar Zhang Signed-off-by: Sebastian Reichel Link: https://patch.msgid.link/20260203-rockchip-spdif-cleanup-and-bsp-sync-v2-8-4412016cf577@collabora.com Signed-off-by: Mark Brown Stable-dep-of: 67a7e2073909 ("ASoC: rockchip_spdif: select REGMAP_MMIO") Signed-off-by: Sasha Levin commit bb4edeb4833be44550da925f60c31ed8e6ea4f58 Author: Sugar Zhang Date: Tue Feb 3 17:46:29 2026 +0100 ASoC: rockchip: spdif: Add support for set mclk rate [ Upstream commit 298082783a0d6d07109f8ce09ab410a1de12876d ] Allow setting the mclk rate from the machine driver. Signed-off-by: Sugar Zhang Signed-off-by: Sebastian Reichel Link: https://patch.msgid.link/20260203-rockchip-spdif-cleanup-and-bsp-sync-v2-7-4412016cf577@collabora.com Signed-off-by: Mark Brown Stable-dep-of: 67a7e2073909 ("ASoC: rockchip_spdif: select REGMAP_MMIO") Signed-off-by: Sasha Levin commit 168517db618e555858a4192a3e3efb2f5866bde0 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 b1fdd4bbc2f5062b4735006c79e8266a462a9c9c 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 d805df52f25a5c69eccf900a8f94be67df354a54 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 1fcafe4f013f9ae378ab6d142a67991be461addf 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 3e048e411f2c638adfac1291775be3becd90222a 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 84afc77892aa3913176e16dfca971ac9acc81252 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 936416dc7788c3772aaeaa740bdd1d575f60a696 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 01d715f6eec645265751d6174b0c6344a85b9ae8 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 374e2091897e4026e0d8e5681cfe2edd6c00885c 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 2ed9986acc34ff5c4ad1233f594e178e86d523fd 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 5aad942f1e8a963018fb4219288000623b9c4bc1 Author: Hannes Reinecke Date: Thu Apr 30 15:22:32 2026 +0200 nvmet-auth: Do not print DH-HMAC-CHAP secrets [ Upstream commit a891962ae5e48fb5476c23631df759482e62ab16 ] From a security standpoint we should not allow to print out the DH-HMAC-CHAP secrets, but at the same time having them is useful for debugging authentication failures. So add a Kconfig option NVME_TARGET_AUTH_DEBUG to only enable debugging if explictly requested at build time. Reviewed-by: Sagi Grimberg Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit 8a819172ac8c95c7315fc59f0b8a5fa9bde853e9 Author: Chris Leech Date: Wed Apr 22 12:06:36 2026 -0700 nvme-auth: Hash DH shared secret to create session key [ Upstream commit bd7b7ce96db4487bb77692a85ee4489fd2c395df ] The NVMe Base Specification 8.3.5.5.9 states that the session key Ks shall be computed from the ephemeral DH key by applying the hash function selected by the HashID parameter. The current implementation stores the raw DH shared secret as the session key without hashing it. This causes redundant hash operations: 1. Augmented challenge computation (section 8.3.5.5.4) requires Ca = HMAC(H(g^xy mod p), C). The code compensates by hashing the unhashed session key in nvme_auth_augmented_challenge() to produce the correct result. 2. PSK generation (section 8.3.5.5.9) requires PSK = HMAC(Ks, C1 || C2) where Ks should already be H(g^xy mod p). As the DH shared secret is always larger than the HMAC block size, HMAC internally hashes it before use, accidentally producing the correct result. When using secure channel concatenation with bidirectional authentication, this results in hashing the DH value three times: twice for augmented challenge calculations and once during PSK generation. Fix this by: - Modifying nvme_auth_gen_shared_secret() to hash the DH shared secret once after computation: Ks = H(g^xy mod p) - Removing the hash operation from nvme_auth_augmented_challenge() as the session key is now already hashed - Updating session key buffer size from DH key size to hash output size - Adding specification references in comments This avoid storing the raw DH shared secret and reduces the number of hash operations from three to one when using secure channel concatenation. Reviewed-by: Hannes Reinecke Reviewed-by: Eric Biggers Signed-off-by: Chris Leech Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit 5cb71602ab0289df584947e1b9baedce7bd91b3d Author: Eric Biggers Date: Sun Mar 1 23:59:47 2026 -0800 nvme-auth: common: use crypto library in nvme_auth_augmented_challenge() [ Upstream commit a67d096fe9761e3e503f40643228bca6d69c7c4e ] For the hash and HMAC computations in nvme_auth_augmented_challenge(), use the crypto library instead of crypto_shash. This is simpler, faster, and more reliable. Notably, this eliminates two crypto transformation object allocations for every call, which was very slow. Acked-by: Ard Biesheuvel Acked-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Eric Biggers Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit 6628b1e1fe0a1cadf12b1515b6abf32590e53f7e Author: Eric Biggers Date: Sun Mar 1 23:59:45 2026 -0800 nvme-auth: common: add HMAC helper functions [ Upstream commit 4263ca1cae5cebc09ba95375c4a8927bf4b39d49 ] Add some helper functions for computing HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512 values using the crypto library instead of crypto_shash. These will enable some significant simplifications and performance improvements in nvme-auth. Acked-by: Ard Biesheuvel Acked-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Eric Biggers Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit d264a21a7f08c2779c08011de0a9f825f8028c53 Author: Eric Biggers Date: Sun Mar 1 23:59:42 2026 -0800 nvme-auth: common: add KUnit tests for TLS key derivation [ Upstream commit f990ad67f0febc51274adb604d5bdeab0d06d024 ] Unit-test the sequence of function calls that derive tls_psk, so that we can be more confident that changes in the implementation don't break it. Since the NVMe specification doesn't seem to include any test vectors for this (nor does its description of the algorithm seem to match what was actually implemented, for that matter), I just set the expected values to the values that the code currently produces. In the case of SHA-512, nvme_auth_generate_digest() currently returns -EINVAL, so for now the test tests for that too. If it is later determined that some other behavior is needed, the test can be updated accordingly. Tested with: tools/testing/kunit/kunit.py run --kunitconfig drivers/nvme/common/ Acked-by: Ard Biesheuvel Acked-by: Christoph Hellwig Signed-off-by: Eric Biggers Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit bc2ba6360f4b9a40e1011db47e739335830a5497 Author: Eric Biggers Date: Sun Mar 1 23:59:41 2026 -0800 nvme-auth: use proper argument types [ Upstream commit bf0e2567a639c455110f9be5db8c92032175e222 ] For input parameters, use pointer to const. This makes it easier to understand which parameters are inputs and which are outputs. In addition, consistently use char for strings and u8 for binary. This makes it easier to understand what is a string and what is binary data. Acked-by: Ard Biesheuvel Acked-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Eric Biggers Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit b62180c86ee658d80555c0af85abd46986bd7193 Author: Eric Biggers Date: Sun Mar 1 23:59:39 2026 -0800 nvme-auth: add NVME_AUTH_MAX_DIGEST_SIZE constant [ Upstream commit 9100a28c8bb4270744942cf834efcd80f1acda7d ] Define a NVME_AUTH_MAX_DIGEST_SIZE constant and use it in the appropriate places. Acked-by: Ard Biesheuvel Acked-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Eric Biggers Signed-off-by: Keith Busch Stable-dep-of: 41ad4af45ac9 ("nvmet-auth: keep the old keys if the new ones fail") Signed-off-by: Sasha Levin commit d1dc307c7e98a0111bf26c947319e32a9e8cb146 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 632b266fed6f3075aeb3d12758aaac6e89dcafa1 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 699295c36da3d36965cae88399d1c37f92edcf00 Author: Maurizio Lombardi Date: Thu May 14 10:32:54 2026 +0200 nvmet-loop: do not alloc admin tag set during reset [ Upstream commit 233bbeb4a47cbead8c0471c0b8daec141033eae4 ] Currently, resetting a loopback controller unconditionally invokes nvme_alloc_admin_tag_set() inside nvme_loop_configure_admin_queue(). Doing so drops the old queue and allocates a new one. Consequently, this reverts the admin queue's timeout (q->rq_timeout) back to the module default (NVME_ADMIN_TIMEOUT), completely wiping out any custom timeout values the user may have configured via sysfs and potentially racing against the sysfs nvme_admin_timeout_store() function that may dereference the admin_q pointer during the RESETTING state. Decouple the admin tag set lifecycle from the admin queue configuration and destruction paths, which are executed during resets; Specifically: * Move nvme_alloc_admin_tag_set() into nvme_loop_create_ctrl() so it is only allocated once during the initial controller creation. * Defer the destruction of the admin tag set to nvme_loop_delete_ctrl_host() and the terminal error-handling paths of nvme_loop_reset_ctrl_work() and nvme_loop_create_ctrl(). Reviewed-by: Daniel Wagner Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Maurizio Lombardi Signed-off-by: Keith Busch Stable-dep-of: bc2170d36586 ("nvme-loop: delete the controller if a reset fails") Signed-off-by: Sasha Levin commit 7b6bebc2465224023289abb268b32651c49c6b2f 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 83c950bec814e330ba2504fbe8eee66cbb5d2c25 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 55f4c856cbd6b5362c41774141825558ee3ccf5e 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 3f4e42618b5c2cbeb4e36a7b7fb1047cced39bce 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 8820c76f417bb73bdc3302b7ade9f18b46acb8e4 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 a7c49f31655e41c4d8bcf7ec8600fc7a039c1822 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 e8cc21b815eb439e8a58a4683e65bd44c4acfcc4 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 802c1a8b503708aca86ba1e180d407ef530dc45e 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 4c40525c851c2236c0472bb4e9533af6b2ee35f0 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 d91f77e2babf13ca34a51965bdd0d3b6e450bc04 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 01a81e1de660c69e8ec699c5cce16984ce8bc940 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 a49d928ff0ff5f9aed7f04344af02d9fac732fb7 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 c1680f84fff9a0d4ca4ba8c459b3e14c46f1b016 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 2f85dc07d471d45a062e013cdad64a201181fc02 Author: Yu Kuai Date: Tue Feb 3 16:19:45 2026 +0800 blk-mq: add a new queue sysfs attribute async_depth [ Upstream commit f98afe4f31bb8b07fea318606c08030c2049587e ] Add a new field async_depth to request_queue and related APIs, this is currently not used, following patches will convert elevators to use this instead of internal async_depth. Signed-off-by: Yu Kuai Reviewed-by: Nilay Shroff Signed-off-by: Jens Axboe Stable-dep-of: 3a9892bca4dd ("blk-mq: reset queue state on scheduler teardown") Signed-off-by: Sasha Levin commit 5e0778be9da901c5c0951c04e5885195b9074970 Author: Yu Kuai Date: Tue Feb 3 16:19:42 2026 +0800 block: convert nr_requests to unsigned int [ Upstream commit 9fc7900b14727d39457bd3724f26e6e3faca3efd ] This value represents the number of requests for elevator tags, or drivers tags if elevator is none. The max value for elevator tags is 2048, and in drivers at most 16 bits is used for tag. Signed-off-by: Yu Kuai Reviewed-by: Nilay Shroff Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe Stable-dep-of: 3a9892bca4dd ("blk-mq: reset queue state on scheduler teardown") Signed-off-by: Sasha Levin commit 0d3890e38b7b27d29aad5b5312431e2eade33b89 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 b3d9a38320130917f6da1c58d0cc6d7be90f7f1d 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 44ad9732ef903b64caf87e79ce07bd26f49b4dc6 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 9837c458090757ea631eeeec061850ef1bce00ff 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 f5ae18734927f574277dd9ef7ace8e6cf3fd4ffb 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 c8c99326974aca49a3e943c4fe96e0e1abcb3d0e 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 144adc1fd2fd0028f163b92f50dd5ae000d6efeb 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 ae92ca09a20cde6404c231d9790c3db8a5d4b7cb 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 e5a50fb7cb012c106d314bd3d9dc43ba585b5eae 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 ca89b6165034e1e935cdf465a78b22e42cb91b74 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 54d08cd013c1777bccb43c1c27a81c51f39b3ef5 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 9c53b5f2f743bdb55a90600ee3be307b4e8ea37e 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 cd045fb120debaca32cf387ae2001ef3d0f62bd7 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 ea46f6ce8ebe08b3e346598f83064b4fe4af88b7 Author: Aaditya Kansal Date: Tue Nov 18 00:20:31 2025 +0530 ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server [ Upstream commit e4442b2e95baf0901830c924d0a197b100aca970 ] Add STATUS_INFO_LENGTH_MISMATCH mapping to EMSGSIZE. Currently, STATUS_INFO_LENGTH_MISMATCH has no mapping to any error code, making it difficult to distinguish between invalid parameters and length mismatch. Map STATUS_INFO_LENGTH_MISMATCH to EMSGSIZE while keeping the EINVAL for invalid parameters. Although the buf_len check only checks for buf_size being less than required, there was no error code for lower buf_size. Hence, EMSGSIZE is used. Signed-off-by: Aaditya Kansal Acked-by: Namjae Jeon Signed-off-by: Steve French Stable-dep-of: e49296d51ccb ("ksmbd: require NUL-terminated EA names") Signed-off-by: Sasha Levin commit f3e4b795f381979f8805321ef30a0dd389518529 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 feae083e2bb62ea4905948091607a96af3552b1c 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 05ea8fd11569d93de4224abc79bf533993bf74a5 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 5e46649ea03af491739905bc7a3102ee523a434a 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 8b9301941835e5415942ab3c666b9d09d9ccfbfc 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 7aed583791682e03db1e0f1e6eb0a1c968330d0b 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 b0b435bd0b817aab1a91adc32335d6ea43d37b67 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 ce34273031603fb755fb352c134ce9c0a621b3f1 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 7ba681875c88166cdf83020750aaed771fde39e3 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 2941c417424094d7ba6592b2be15a71e74173bdd 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 69d6648ce1ae43e817eaa3466c67cc5747d7d62a 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 eece77a5839c28fb276fb9e221cf6e2d36372bd1 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 f3d4347def6bf2196b2d01ae8ae1ff8d7e8381c5 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 d2c150bd9460f0df9359174fe89f68f36692f8c7 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 b08e6f77e1e234c50ab00d293d9a885c244113ca 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 4e315de1d6357007b95ecd6bfe8857f9fd90e85c 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 3d662b7be7d3addba4ae4a95722c32454dcad6ea 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 1a32036f4e0d490fb39ad800a0e825e9f7c131a7 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 570d81a9aea7d9607fb67c457259d0c0c803a656 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 f71ca96adc16bedb27f110291edbf2dc75bcf848 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 5897075fcd14cb506796b0d5ee7417f86f26d171 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 cdd16d913253a52977cd4329082fcaf7c2a9a1fa 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 04ecec80d34454fedbb6c0e53a2611523c6f0b76 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 982f98d4c6581e32ff05f3c9b2586231318e6cf3 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 a0cee196884cad328428d8c8731c6d60f76795aa 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 e006198f186b5e702524e4106701d47dd2ddd6e7 Author: Muna Sinada Date: Thu Oct 23 17:19:25 2025 -0700 wifi: ath12k: Add EHT MCS/NSS rates to Peer Assoc [ Upstream commit 6c95151e2e776462de6b6fd9e577865e8b32203e ] Add EHT MCS/NSS rate functionality to peer association. As part of ath12k_peer_assoc_h_eht() add the calculation of EHT MCS/NSS using intersection of link_sta and phy capability. ath12k_mac_max_eht_mcs_nss() function is utilized when comparing the max NSS of link STA and phy capability since in split phy case, phy supports max NSS of 2 for 5G band. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Vishal Kumar Signed-off-by: Vishal Kumar Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20251024001928.257356-4-muna.sinada@oss.qualcomm.com Signed-off-by: Jeff Johnson Stable-dep-of: 83d689bbe8f9 ("wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it") Signed-off-by: Sasha Levin commit 17c196bfeaabc17443d5ad1c2eeb05cc7ff4364a Author: Muna Sinada Date: Thu Oct 23 17:19:24 2025 -0700 wifi: ath12k: add EHT rate handling to existing set rate functions [ Upstream commit ec1d9b79be5df30f1998f37a49bf14d34ecd6c50 ] Add EHT rate handling to the existing rate functions that validate, prepare and set rates. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20251024001928.257356-3-muna.sinada@oss.qualcomm.com Signed-off-by: Jeff Johnson Stable-dep-of: 83d689bbe8f9 ("wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it") Signed-off-by: Sasha Levin commit 20944b58f1568c974c4e21a9b34b1b3764667690 Author: Muna Sinada Date: Thu Oct 23 17:19:23 2025 -0700 wifi: ath12k: generalize GI and LTF fixed rate functions [ Upstream commit 770bff79424beec2edb8e7cc63b0e8d1b1a927a3 ] Currently, functions in mac.c for setting GI and LTF rates are specifically for HE rates. Remove any mention of "HE" in such functions in order to allow for other modes to utilize the functions. The intention is to prepare for the addition of EHT GI and LTF fixed rate settings. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Muna Sinada Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20251024001928.257356-2-muna.sinada@oss.qualcomm.com Signed-off-by: Jeff Johnson Stable-dep-of: 83d689bbe8f9 ("wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it") Signed-off-by: Sasha Levin commit bb3f9228e2a8adbc67171c030448d51f68addd46 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 8c036eff499654a4f109b1a64fc0c1687c81842d 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 6e80e4d9439d05652b732ccd780c4504790bd51a 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 0f4c94dc92957cc60d39c806bba051b52124aa86 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 8cd9a096158f21d21e2e9cdc4f92bc93b6a5c0b8 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 373185bdfb886a01b404ac10c4d2d5a92f3c04cb 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 a3f66ad9db660ba0c66d5156948a252dae8b986f 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 c906bc29f4caf64546b042a563e9853b2d9f6b0e 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 a042fbd163243f58845e24d872d4d245bf7d1039 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 f89c137a5dc0e5eca910f045c3d1d0c40b7d6c00 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 ba97e7eab77b4ab255501da679d6cb41d3a320f4 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 b4087898db0c27d632414cd3270f27164715f19c 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 e336baab22c956dcd53c038481d1ae47e6b9262c 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 5f971a69a4005406d13ccacdacba8c02e85618b6 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 791c9635116680961cfd0d5a59c68e75018ebc8b 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 57b7e461d4dda2cb26e8fc5a0fe76dce6db0bf3d 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 73e992061fbff6529ab9d6e229b4a50b56545367 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 a2d05fc7d7029030e604c125ff99a4ad42dff3a2 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 bc4f67746c1b22165b74e4cdd7d1a5dc11ebb875 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 393114c4a1723c721c944fa59c4c1819888368b8 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 4adeb8a461b70c267aed363d97bd55f52a92aa01 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 cff8399298b529c9efc643a5d5d6ffc6e9d67bbd 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 c04d9b1cbf2ae04eeb25e4ad1ff6fe018e28cbfd 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 1beba071b1c157230adf0cec0d7569ae85a41dfc 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 387f9d83dba3404c010500beb8e9555ad7d812bb 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 8a116ce0c21449b742d5eb1e80f3f0cc64dca14f 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 92a4801fdebf726719f561e08cc20fc04e3fddba 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 ffa7563878f8a52390ea50a3994df0d2a588ae0b 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 8a38519a185099eee65cad26be89d38ed5a7d38d 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 f28cacf31e8a344b2f451a48bb1d21be94c435bd 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 22cbd7a6ea405a1a75315697dd200076d892123e 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 5ef25210863c525bbc820c8145437dd25023b6f7 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 48f12694acfcc4bf32dc077ee5c6e06770c51f6e 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 bcde09a8e2b9cd2a6b867e2c1061a62fd8448cfe 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 61239a0dc8164d6a9fa23e665aee169021f38bfd 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 035e45b333c90606ecbbe4b47c1d5d473541ea88 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 5fe7b2bdf2784d5b3614208d4f9d0c37a5137f9a 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 d762756f1381bd1c57ed2e01849039b9a486f6ef 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 bbf747c5ffc6ed64d8d3ee33e330143002963884 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 b6e295b06d6ebe0d5459661b55627fdb9c238fd4 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 d1c921433fd533dd4d512aa2b158405d860567e0 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 6f18041922b04300d751956eb9ac805aff02514b 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 5f8aed23c1b0c839d5f428844b25aafab09b667e 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 1705980459b851f5160593703770b57736976117 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 50791fe37754db0ccfcdf8391ae7d5b8c69a2734 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 7c9fcfda8679ef648e07ba27da10c8439bebc065 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 962e0ff9b7f4508f07dd63cc8237fb2b04696254 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 d29c91e8c031bc9b5a78dc199235893c040877db 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 8ff854b515dfd559e14bc9898cb84543fcc6a3da 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 08432133abe0db4b0a964114d22afaf69da19748 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 aa92a579ea27b5ff255bc4ef96b1fc7ff1421bfb 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 a475aadcedc339f00cf22d167762f05fff110358 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 98e101239ae63a24e775f3e79cbf895c6a630abc 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 8042ea79c7a98c8fe1f381e3a27f4dffc114c2ec 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 a18b920a21163cfcef67d3913c87ce53894dc19c 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 59bae352a8ae6dda266d6f8365c0f2db2722027e Author: Jiri Olsa Date: Mon Aug 3 23:01:49 2026 +0200 bpf: Avoid changing callchain in bpf_get_stackid_pe [ Upstream commit a74594607a0b310c1533e713b9097cc1cbbb85bf ] There's no need to modify the trace object bpf_get_stackid_pe, we just need to pass the needed callchain length in separate argument. This way we can have callchain pointers const and remove the trace->nr modification and restoration. Assisted-by: Codex:GPT-5.5 Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20260803210149.296496-13-jolsa@kernel.org Stable-dep-of: a08ba2ab79df ("bpf: Clamp the trace length before the skip test in stackid_init()") Signed-off-by: Sasha Levin commit 5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9 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 367428759647f4bf335137c13ff79f32d6357191 Author: Jiri Olsa Date: Mon Aug 3 23:01:48 2026 +0200 bpf: Avoid changing callchain in bpf_get_stack_pe [ Upstream commit 347c1d722e3ea4ffa2850585f5c76c6e551eac83 ] There's no need to modify the trace object bpf_get_stack_pe, we just need to pass the needed callchain length in separate argument. This way we can have callchain pointers const and remove the trace->nr modification and restoration. Assisted-by: Codex:GPT-5.5 Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20260803210149.296496-12-jolsa@kernel.org Stable-dep-of: 007fd460798b ("bpf: Clamp the trace length in __bpf_get_stack() again") Signed-off-by: Sasha Levin commit 7f9fdb562e28a9383d9f0b7d50e7059c6a4e7897 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 f5802700d0764d44be8a805e882c518c18138005 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 ca2477af20443184f685b747f38a05b27ccb0b68 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 e756faaa266cb22cbe7cf8d9b42eb8c8a77e54be 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 3119e2ba4a2ad756acef14110031c9fc89726a0c 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 e56e50ad4f0043fe10c7ee1d6a5fe84950a3ce74 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 458f9e39fc124bbef4d662f75089f805d7ef28a4 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 468f29c17ffb3c7fd83864ff8f84109886359fe8 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 cb739457f64b1c6149160ebcf835867f4a2dd5d4 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 480d2816ce5294bf71289a61129ac2e08e2a04d0 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 adf81653ab2407769c49490c58d9ebec84e4a279 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 36231d7dfb5204991d72731b49687db2b5968c79 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 3d2585420dff5975fb302d93ebbd093e7c76d0aa 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 99975f7225c0f07e9d83c5dcde0402e491378fa9 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 264d17000caa39b3a42c917e85df1861b291648a 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 4d76ef235682209c29bacac2cd511e4753008708 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 6ddc16d58b40bc3276dcd3f4027df5e9e846d26a 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 1c1b485bf2a79180e41204ac93b73f4731bb3557 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 93099408648282c4e0bc4f8b7311215a15e7e3b4 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 8674ea44a73310632e8426048cad02df7762feda 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 336f0b2b1ad6dd5ae8b59acfd8be4571a2923419 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 19e5f3b4e06af4866fc81d14104c40eb08164c02 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 d284c2a8592b4a2dcb4b6416faf00274e8b0ec50 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 22f7a60a3c019744e518b5765b8dd99973dae0be 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 60a2c4e10cad6625627a05dd4ce8901d41d541b9 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 b342b6609fece24ebaacb5032f403c4d03aa0b7c 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 79eb0c62b34a37d92ec6c0b5f6099c3ee1ed4728 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 6c3cd41675afbfbe930ff831368da64f82027cc2 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 74234c84243d3b67648193364c2f22c47082f067 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 8343444cc0a1db25ea92012eba222353b0eac9b3 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 2c7d3b5be56de394a4868c59b3eed17abf945faa Author: Remi Pommarel Date: Thu May 21 11:40:30 2026 +0200 9p: Add mount option for negative dentry cache retention [ Upstream commit 5670a84b5cda6b82016282accfd61ef36aceafbf ] Introduce a new mount option, negtimeout, for v9fs that allows users to specify how long negative dentries are retained in the cache. The retention time can be set in milliseconds (e.g. negtimeout=10000 for a 10secs retention time) or a negative value (e.g. negtimeout=-1) to keep negative entries until the buffer cache management removes them. For consistency reasons, this option should only be used in exclusive or read-only mount scenarios, aligning with the cache=loose usage. Signed-off-by: Remi Pommarel Message-ID: Signed-off-by: Dominique Martinet Stable-dep-of: d037e9c1b40c ("9p: fix kernel-doc warning for enum p9_session_flags") Signed-off-by: Sasha Levin commit 405879cfd2acadf2a261a9c0d698d23317f84844 Author: Remi Pommarel Date: Thu May 21 11:40:29 2026 +0200 9p: Cache negative dentries for lookup performance [ Upstream commit f00e6c1d282578b077b87b88f42e701bc40f2fff ] Not caching negative dentries can result in poor performance for workloads that repeatedly look up non-existent paths. Each such lookup triggers a full 9P transaction with the server, adding unnecessary overhead. A typical example is source compilation, where multiple cc1 processes are spawned and repeatedly search for the same missing header files over and over again. This change enables caching of negative dentries, so that lookups for known non-existent paths do not require a full 9P transaction. The cached negative dentries are retained for a configurable duration (expressed in milliseconds), as specified by the ndentry_timeout field in struct v9fs_session_info. If set to -1, negative dentries are cached indefinitely. This optimization reduces lookup overhead and improves performance for workloads involving frequent access to non-existent paths. Signed-off-by: Remi Pommarel Message-ID: Signed-off-by: Dominique Martinet Stable-dep-of: d037e9c1b40c ("9p: fix kernel-doc warning for enum p9_session_flags") Signed-off-by: Sasha Levin commit 8b99a8f8ab715336d1c30bb86251adfbee007dc7 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 a520dda5e5bf197354bf088910b8e371a07295bd Author: Remi Pommarel Date: Thu May 21 11:40:32 2026 +0200 9p: Enable symlink caching in page cache [ Upstream commit 712da38d134b6681946368dd5c9400b43eb772b0 ] Currently, when cache=loose is enabled, file reads are cached in the page cache, but symlink reads are not. This patch allows the results of p9_client_readlink() to be stored in the page cache, eliminating the need for repeated 9P transactions on subsequent symlink accesses. This change improves performance for workloads that involve frequent symlink resolution. Signed-off-by: Remi Pommarel Message-ID: <982462d17c0c0d2856763266a25eb04d080c1dbb.1779355927.git.repk@triplefau.lt> Signed-off-by: Dominique Martinet Stable-dep-of: a3a6212c7d67 ("9p: treat read return values of 0 as EOF") Signed-off-by: Sasha Levin commit 017acf0722e94f9b6d28b703a9229277804cd4b7 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 de6cfacc4686e9cd6f15ab9a3a9d51c485728298 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 0abc9480b9ffd758fe63913defc7dba38372b7c5 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 e359090dadf3c8cf06ce4d2cde808a34ef6e1a5a 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 1eec43b76ce4ba351b5cd0ce5b74a8f934d61193 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 bced50a9c63c85edafd48786e9e8ba15b74ebf78 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 c48abd3aaaf95223be0b2a0990a37515d0e4b35e 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 5e14088d45ca7a07d6be4912f8f7a0635d4a3fc7 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 a1c00297dcfb81b71b6f0c45e3bc9173e5733f29 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 6c7901b8667af551f5efe90d67a6f3f6add0c27b 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 54b98356b92082c59766205d600a273f434c94e4 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 c75a54f46694c16867a81ddde07a376ffe94f545 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 bb39813d3089896d1eb8d5cb285feb5f663c559e Author: David Laight Date: Sat Jun 6 21:27:42 2026 +0100 net/9p: Replace strlen() strcpy() pair with strscpy() [ Upstream commit cc8b15a2c435bd1caf19741ba85286846a115764 ] Use the result of strscpy() for the overflow check. Signed-off-by: David Laight Message-ID: <20260606202744.5113-3-david.laight.linux@gmail.com> Signed-off-by: Dominique Martinet Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports") Signed-off-by: Sasha Levin commit 54f1f99df0bd0b78425507b293683915894a8c39 Author: Eric Sandeen Date: Fri Oct 10 16:36:19 2025 -0500 9p: convert to the new mount API [ Upstream commit 1f3e4142c0eb178089ea0cbc97506a061470ad27 ] Convert 9p to the new mount API. This patch consolidates all parsing into fs/9p/v9fs.c, which stores all results into a filesystem context which can be passed to the various transports as needed. Some of the parsing helper functions such as get_cache_mode() have been eliminated in favor of using the new mount API's enum param type, for simplicity. Signed-off-by: Eric Sandeen Message-ID: <20251010214222.1347785-5-sandeen@redhat.com> [ Dominique: handled source explicitly as per follow-up discussion ] Signed-off-by: Dominique Martinet Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports") Signed-off-by: Sasha Levin commit e27c3b3977eabb8ea875d3059c6c36976099b3c1 Author: Eric Sandeen Date: Fri Oct 10 16:36:18 2025 -0500 9p: create a v9fs_context structure to hold parsed options [ Upstream commit 075e8bd4127f007910fc302ad5c3c471d0be4799 ] This patch creates a new v9fs_context structure which includes new p9_session_opts and p9_client_opts structures, as well as re-using the existing p9_fd_opts and p9_rdma_opts to store options during parsing. The new structure will be used in the next commit to pass all parsed options to the appropriate transports. Signed-off-by: Eric Sandeen Message-ID: <20251010214222.1347785-4-sandeen@redhat.com> Signed-off-by: Dominique Martinet Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports") Signed-off-by: Sasha Levin commit 1830d1e9ac2eed7358be9947f4af010ec07b0b70 Author: Eric Sandeen Date: Fri Oct 10 16:36:17 2025 -0500 net/9p: move structures and macros to header files [ Upstream commit c44393d84149d6fc91d94fa39321c9657e91b388 ] With the new mount API all option parsing will need to happen in fs/v9fs.c, so move some existing data structures and macros to header files to facilitate this. Rename some to reflect the transport they are used for (rdma, fd, etc), for clarity. Signed-off-by: Eric Sandeen Message-ID: <20251010214222.1347785-3-sandeen@redhat.com> Signed-off-by: Dominique Martinet Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports") Signed-off-by: Sasha Levin commit f7cc5b611f4a1b08b25496a95f45315c90973fc2 Author: Eric Sandeen Date: Fri Oct 10 16:36:16 2025 -0500 fs/fs_parse: add back fsparam_u32hex [ Upstream commit 695f2ca1b4247724576d57eae7b74b90dc69ba3c ] 296b67059 removed fsparam_u32hex because there were no callers (yet) and it didn't build due to using the nonexistent symbol fs_param_is_u32_hex. fs/9p will need this parser, so add it back with the appropriate fix (use fs_param_is_u32). Signed-off-by: Eric Sandeen Message-ID: <20251010214222.1347785-2-sandeen@redhat.com> Signed-off-by: Dominique Martinet Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports") Signed-off-by: Sasha Levin commit 34e00252d0444b360fb279345c7049df24211228 Author: Bitterblue Smith Date: Sun Nov 22 14:23:46 2026 +0100 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 [ Dropped the hunks for rtw8852au.c, rtw8852cu.c and rtw8922au.c, these drivers are not in 6.18. ] Signed-off-by: Josef Schlehofer Signed-off-by: Sasha Levin commit 7dd2f454795c967b5e64a630a2950831084b2465 Author: Feng Ning Date: Sun Nov 22 22:46:41 2026 +0000 staging: media: atomisp: use array3_size() for overflow-safe allocation commit d178c7ca8fefc28115d35b94c3b1f4d653e34182 upstream. Replace open-coded width * height * sizeof() multiplications with array3_size() to prevent integer overflow in buffer allocations. The atomisp driver computes DVS, morphing table, shading table and statistics buffer sizes using unchecked arithmetic. When dimensions are attacker-controlled or simply large, the product can silently wrap, causing kvmalloc() to allocate an undersized buffer. array3_size() saturates to SIZE_MAX on overflow, so kvmalloc() returns NULL instead of succeeding with too few bytes. Signed-off-by: Feng Ning Signed-off-by: Sakari Ailus Signed-off-by: Sasha Levin commit b3f2d3771b712a49fbd4cea760480f39e06404ca 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 [ sashal: omitted the ff->stop removals because that callback doesn't exist here, and ml_ff_destroy() now uses timer_shutdown_sync() instead of timer_delete_sync() to make up for it. ] Signed-off-by: Sasha Levin commit 94e40d44eeae8a55d86c5e3a0fa215c271968b6e Author: Bernard Pidoux Date: Fri Nov 13 13:10:47 2026 +0100 bpqether: keep a bpq device in step with its Ethernet device When the Ethernet device goes down, bpq_device_event() closes the bpq device on top of it. Two things are left over: - bpq_open() does not look at the Ethernet device, so the bpq device can be brought up again while the Ethernet device is still down. Every frame sent then counts in the bpq device's tx_packets while the Ethernet device drops it. - when the Ethernet device comes back up, the bpq device stays down and the AX.25 port has to be brought up again by hand. Refuse to open a bpq device whose Ethernet device is not running, with -ENETDOWN. Remember that a bpq device was closed because its Ethernet device went down, and open it again on NETDEV_UP. A bpq device that was already down, e.g. closed by the administrator, is left alone. Tested in a QEMU guest (6.12.94, KASAN) with e1000 ports: - bpq2 brought up with eth2 down: accepted before, and 5 frames counted in tx_packets of bpq2 while eth2 dropped them; -ENETDOWN after, nothing counted; - eth3 down then up: bpq3 stayed down before, is up again after; - bpq1 closed by hand, then eth1 down and up: bpq1 stays down, before and after. No kernel report in either case. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit 888935e9c7aa8d8de66dd76111ef0875f8c90663) Signed-off-by: Sasha Levin commit c1a0e671a6fbb2128843291e70476aa5cdb9dcd0 Author: Bernard Pidoux Date: Fri Nov 13 12:53:01 2026 +0100 bpqether: set both addresses or none in SIOCSBPQETHADDR SIOCSBPQETHADDR copies the destination address straight into the device, then the accepted source address. When the second copy faults, the ioctl returns -EFAULT but the destination address has already been changed, and copy_from_user() has zero-filled the part of the accepted address it could not read. With the accepted address left as 00:00:00:00:00:00, bpq_rcv() drops every frame whose source is not that address: the device silently stops receiving although the ioctl reported a failure. Copy the whole struct bpq_ethaddr to the stack first and only update the device once it has been read in full. Tested in a QEMU guest (6.12.94, KASAN) by placing the struct so that its accept field falls in an unmapped page. Before the change /proc/net/bpqether showed the new destination and an accepted address of 00:00:00:00:00:00 after the -EFAULT; after it, both addresses are unchanged, and a valid call still sets them. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit 431bb7f4a7d347ccda32319aa346346664858289) Signed-off-by: Sasha Levin commit 66d6b2782bd3b78bcee5a56a92c1da712631aba8 Author: Bernard Pidoux Date: Fri Nov 13 12:53:01 2026 +0100 bpqether: reserve the Ethernet device's own header room on transmit bpq_xmit() makes sure the frame has AX25_BPQ_HEADER_LEN (16) bytes of headroom, then pushes the two length bytes and lets dev_hard_header() of the underlying device build the link layer header. That covers a plain Ethernet header, but not a longer one. A VLAN device on top of an Ethernet device that cannot insert the tag in hardware, with reorder_hdr turned off, pushes an 18 byte header (VLAN tag, then the Ethernet header). A UI frame sent from an AX.25 datagram socket with 8 digipeaters reaches bpq_xmit() with 17 bytes of headroom once the KISS byte is dropped: skb_cow() leaves it alone, 15 bytes remain after the length bytes, and eth_header() underflows the skb: skbuff: skb_under_panic: ... len:101 put:14 ... dev:eth0.5 kernel BUG at net/core/skbuff.c:209! Call Trace: eth_header vlan_dev_hard_header dev_hard_start_xmit __dev_queue_xmit ax25_sendmsg __sys_sendto No privilege is needed to open and bind such a socket, so any local user can crash a host that runs bpqether over this kind of VLAN. Look up the Ethernet device first and ask skb_cow() for LL_RESERVED_SPACE() of that device plus the two length bytes. Tested in a QEMU guest (6.12.94, KASAN) with bpq devices on eth0, on eth0.6 (reorder_hdr on) and on eth0.5 (reorder_hdr off), eth0 being a virtio-net port without VLAN tag insertion: UI frames with 0, 7 and 8 digipeaters on each. Before the change the 8 digipeater frame on eth0.5 panicked the guest with 15 bytes of headroom left; after it, 79 bytes are left and all frames are sent, with no kernel report. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit 6b7e0767b46d918b5c8a5a2fbb8a9c8a2531d698) Signed-off-by: Sasha Levin commit 6538640af6beca6e03f5311fe7d8b511b1b9cf43 Author: Bryan Cochrane Date: Sat Nov 21 15:48:04 2026 -0800 bnxt_en: Take RTNL before netif_close() when aborting FW reset commit bf83b257423bb557b970df3d7ece32fbd85f3bd4 upstream. 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 [ bcochrane: backport to 6.18.y: 6.18 lacks bnxt_lock_sp() and bnxt_unlock_sp(), so keep the existing inline BNXT_STATE_IN_SP_TASK + netdev_lock()/netdev_unlock() on the VF branch of bnxt_fw_reset() while using the existing bnxt_rtnl_lock_sp() / bnxt_rtnl_unlock_sp() on PFs. ] Signed-off-by: Bryan Cochrane Signed-off-by: Sasha Levin commit 43bd4026712149b3b5b92985b56735d0f048de4d Author: Mikhail Malyshev Date: Sat Nov 21 21:31:37 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 10f485ba7c656453005a6cf43ce0bd9790057f7f Author: Siddharth Chintamaneni Date: Sat Nov 21 21:31:36 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 528566820d088bdda7c82272501c70fe4d6155c8 Author: Cheng Yongkang Date: Sat Nov 21 21:31:35 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 [axboe: 6.18 doesn't clamp the slot index with array_index_nospec() in this function] Signed-off-by: Sasha Levin commit d556847f2644d7b7638a133a5b789955f5c37c7d Author: Cheng Yongkang Date: Sat Nov 21 21:31:34 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 67a98f54e3d1794ad4159b31a5cd199c15e1285b Author: Yang Xiuwei Date: Sat Nov 21 21:31:33 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 ff508f96856ca580a148072e51e1a8026d7a9489 Author: Yang Xiuwei Date: Sat Nov 21 21:31:32 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 e79ebbacc9903c5cd21752d702bd3e92a09f9a9f Author: Yang Xiuwei Date: Sat Nov 21 21:31:31 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 40039ede91ffec2a82ea8dd60626397531169469 Author: Cinq Prairie Date: Sat Nov 21 21:31:30 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 3408c4a43214d9d4ac707585b90ce89f870b9d8a 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 68a2091f73d93eeacabea1b054105b28232a4a9e Author: Jan Kara Date: Fri Jun 12 13:50:04 2026 +0200 udf: validate VAT inode size for old VAT format [ Upstream commit 5163e6ee1ea744d412fe516235bfd9cab15141dc ] Validate VAT inode is large enough to contain at least the header for pre-2.00 UDF media format. Signed-off-by: Jan Kara Signed-off-by: Sasha Levin commit 4712cc65a41d0e69117fbf5b977a4f3e3e7bed05 Author: Lance Yang Date: Sat Nov 21 20:54:31 2026 +0800 mm/ksm: fix userfaultfd protection during merge and unmerge [ Upstream commit 990d6c2194a938a19a8cf94c6cfd75171345089b ] KSM loses userfaultfd protection when replace_page() builds a new PTE from vma->vm_page_prot. Dropping its uffd bit lets a subsequent write go through ordinary COW instead of userfaultfd write protection handling. For RWP, a merged page also becomes readable without faulting. Keeping the uffd bit and restoring PAGE_NONE fixes merging, but we also have to handle unmerging. An existing KSM page can be protected with RWP before MADV_UNMERGEABLE, so unmerging already needs fixing independently of preserving RWP during merging. Unsharing replaces a shared page with a private one and should leave userfaultfd protection in place, as do_wp_page() already does for write protection. Currently, an unshare fault reaches do_uffd_rwp() before it can proceed to do_wp_page(). - With synchronous RWP, handle_userfault() returns VM_FAULT_SIGBUS. break_ksm() then reports success with a KSM page still merged. - With asynchronous RWP, protection is cleared before unsharing. Preserve the uffd bit when merging, and restore PAGE_NONE for RWP. Let FAULT_FLAG_UNSHARE skip RWP fault handling and keep PAGE_NONE on each private copy as well. Unsharing can then complete with RWP still armed for a subsequent access. Link: https://lore.kernel.org/20261026130054.91461-1-lance.yang@linux.dev Link: https://lore.kernel.org/all/20261019010934.697895-1-samarth.colleges@gmail.com/ Link: https://lore.kernel.org/all/20261020055518.36087-1-lance.yang@linux.dev/ Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl") Fixes: 2d427bb01639 ("mm/userfaultfd: add RWP fault delivery and expose UFFDIO_REGISTER_MODE_RWP") Signed-off-by: Samarth Narang Signed-off-by: Lance Yang Signed-off-by: Andrew Morton Co-developed-by: Samarth Narang Acked-by: Lorenzo Stoakes (ARM) Reviewed-by: Kiryl Shutsemau (Meta) Acked-by: David Hildenbrand (Arm) Cc: Mel Gorman Cc: Xu Xin " Cc: Chengming Zhou Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Jérôme Glisse Cc: Andrea Arcangeli Cc: Peter Xu Cc: Bobby Powers Cc: Brian Geffon Cc: Denis Plotnikov Cc: Doug Gilbert Cc: Hugh Dickins Cc: Johannes Weiner Cc: Martin Cracauer Cc: Marty McFadden Cc: Maya Gokhale Cc: Pavel Emelyanov Cc: Rik van Riel Cc: Shaohua Li Cc: James Houghton Cc: Jonathan Corbet Cc: Paolo Bonzini Cc: Sean Christopherson Cc: SJ Park Cc: Zi Yan Cc: Mohammed EL Kadiri Cc: Signed-off-by: Sasha Levin commit c7e8a40c3d6bf407ae9d2fe3ba353dc9b702ccf7 Author: Bernard Pidoux Date: Mon Nov 16 18:40:52 2026 +0100 netrom: give the sysctl timer limits in milliseconds Since commit 4d8937d0b113 ("[NETROM]: Eleminate HZ from NET/ROM kernel interfaces") the NET/ROM timer sysctls hold milliseconds, converted with msecs_to_jiffies() where they are used, but their limits were left in jiffies: 5 * HZ to 600 * HZ for the transport timeout, 1 * HZ to 60 * HZ for the acknowledge delay, 1 * HZ to 1000 * HZ for the busy delay, up to 65535 * HZ for the no activity timeout. They only match with HZ=1000. With HZ=100 the largest transport timeout that can be written is 60 s while the default is 120 s, and the largest busy delay is 100 s while the default is 180 s: once changed, a default can no longer be put back. The smallest transport timeout accepted is 0.5 s instead of 5 s. With HZ=250 the acknowledge delay is limited to 15 s instead of 60 s. Seen on a Raspberry Pi node (HZ=100): writing back the current values 120000 to transport_timeout and 180000 to transport_busy_delay fails with EINVAL, and 60000 is accepted. Give the limits in milliseconds, as was done for ROSE. With HZ=1000 nothing changes. Fixes: 4d8937d0b113 ("[NETROM]: Eleminate HZ from NET/ROM kernel interfaces") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit e59d8b990552be401ace7750a4617ffa07c86637) Signed-off-by: Sasha Levin commit ae0f85ee3ce04f02e5d0856f92e09ec74b674ce0 Author: Bernard Pidoux Date: Mon Nov 16 18:29:10 2026 +0100 netrom: keep T1 running after answering a NAK When an INFO or INFOACK frame carries the NAK flag, nr_send_nak_frame() sends the frame at V(A) again and then stops T1, although that frame, and any sent after it, are still waiting for an acknowledgment. If this copy is lost too, no timer is left: nothing is sent again, and the circuit is not cleared after N2 tries either. It stays stuck until the peer sends something or the idle timer, if set, closes it. Restart T1 instead, as nr_check_iframes_acked() does when part of the window is acknowledged. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit e18a382a74b93a3c0ab52e0fedc8343d9d4facc9) Signed-off-by: Sasha Levin commit 789a1bcdd83f6366db04bba6c479f0296983ccca Author: Bernard Pidoux Date: Mon Nov 16 18:15:55 2026 +0100 ax25: end a REJ recovery count once frames are acknowledged Commit a3aa611e37d4 ("ax25: bound REJ-driven fast retransmits with the existing N2 counter") counts REJ-driven retransmits in n2count and relies on an I frame received in sequence to reset it. A station that only sends, such as a BBS forwarding mail, never receives I frames: the peer acknowledges with RR. After a single REJ, n2count then stays above zero for the rest of the connection, with two effects: - ax25_calculate_rtt() no longer updates the round trip time (it requires n2count == 0), and with the default linear backoff ax25_calculate_t1() keeps T1 at (2 + 2 * n2count) * rtt instead of 2 * rtt; - isolated REJs, even hours apart, add up, and the N2-th one sends a healthy link into the state 4 enquiry. An RR, RNR or REJ whose N(R) acknowledges new frames shows the link is getting data through, so reset n2count when it moves V(A). A REJ storm that makes no progress keeps the same N(R) and is still bounded by N2. The reset is done after the acknowledgment is processed, so the round trip of retransmitted frames is still not measured. Fixes: a3aa611e37d4 ("ax25: bound REJ-driven fast retransmits with the existing N2 counter") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit 6f10bf991bc130b56339200965d87512b443954a) Signed-off-by: Sasha Levin commit 6fd0662850d137865528530af5ca50e3c16142d7 Author: Bernard Pidoux Date: Mon Nov 16 14:15:13 2026 +0100 rose: reset a call when a DATA packet arrives out of sequence In state 3, rose_state3_machine() drops a DATA packet whose N(S) is not the expected V(R) and says nothing about it: the packet is not queued, and at most an RR with the unchanged N(R) goes out later. ROSE never sends a DATA packet again, so once a packet has been lost on the way (a relay dropped it, or a link was reset under it), every following packet is dropped as well, the window of the sender fills up and the call hangs until one side clears it. X.25 resets the call when P(S) is not the one expected. Do the same: acknowledge what arrived in sequence with rose_enquiry_response(), so that the sender frees those packets, then send RESET REQUEST and go to state 4, as the other error cases of this function already do. On the RESET, the sender sends again the packets it still holds, from N(S) 0. Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port. The calling guest runs a rose module changed for the bench only to drop the third DATA packet it sends, keeping it on its ack queue as if a relay had lost it; it writes d0 to d5 on the call. Before, the called guest received d0 and d1, and the caller still had 3840 bytes queued 25 s later; after, the called guest received d0 to d5 in order, without duplicates, and the caller's queue was empty. No kernel report. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit e15162d237ddecc2c1215f49b76f4cba06bbc2c8) Signed-off-by: Sasha Levin commit 60e0d5860941605d7e4d08f7cc5b7984bd8ff93c Author: Bernard Pidoux Date: Mon Nov 16 13:57:40 2026 +0100 ax25: drop a message being reassembled when a new one starts ax25_rx_fragment() only accepts, while a message is being reassembled (fragno != 0), the segment numbered fragno - 1. A new first segment, or a segment with another number, falls through to "return 0" and is freed, but fragno keeps its value. Since every first segment is then refused, and no segment can ever match fragno - 1 again, every later segmented message of the connection is thrown away, until the connection is closed. The I frames carrying them have already been acknowledged, so the sender has no way to know. This happens whenever the peer gives up a message half way, for instance a station on an older kernel that interleaves the segments of two messages, or one that fails to allocate a segment in the middle of a message. When a segment does not continue the message being reassembled, purge the queue and reset fragno and fraglen. A first segment then starts a new message; any other segment is dropped as before. Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port; one guest builds the segments itself on an AX.25 socket with AX25_PIDINCL and sends: a 2 segment message, the first segment of a 3 segment message and nothing more, a 2 segment message, a 3 segment message without its second segment, a 2 segment message and an unsegmented one. Before, the receiver got the first message and the unsegmented one only; after, it gets the three complete segmented messages and the unsegmented one. No kernel report. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit bb9180c5adfc874ec340caca45b5f3f4d448fcf8) Signed-off-by: Sasha Levin commit f906838e2cf68670ac02cb54c935b304726273c1 Author: Bernard Pidoux Date: Mon Nov 16 12:56:00 2026 +0100 netrom: send the unacknowledged frames again when T1 or T4 expires When T1 expires in state 3, nr_t1timer_expiry() moves the frames of the ack queue back to the write queue with nr_requeue_frames(), but does not call nr_kick(). nr_kick() only runs when a frame comes in from the peer or when the application writes, so if the peer stays silent (one way transfer, last frame or its acknowledgment lost) nothing is sent again: after N2 expiries the circuit is cleared with ETIMEDOUT without a single retransmission. The comment above nr_requeue_frames() says the frames are "picked up by nr_kick called from the timer", but no timer calls it. T4 has the same gap: when the peer's busy condition times out, the frames held back while it was choked stay queued until something else calls nr_kick(). Call nr_kick() after nr_requeue_frames() in the T1 expiry, and after clearing NR_COND_PEER_RX_BUSY in the T4 expiry. nr_kick() already does nothing outside state 3 or while the peer is busy, and sends from V(A) once the ack queue is empty, so the T1 retransmission resends the window from the first unacknowledged frame. The N2 count and the time at which the circuit is cleared are unchanged. Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a serial mkiss port: the guest under test runs netrom with T1 = 5 s, N2 = 3 and T4 = 3 s; the other guest plays a NET/ROM node from user space with an AX.25 socket and acknowledges nothing. - three frames written on a circuit: before, each was sent once and the circuit was cleared 20.7 s later; after, the three are sent again at 5.4, 10.5 and 15.6 s and the circuit is still cleared 20.7 s later; - the peer acknowledges the first frame with CHOKE, then a second frame is written: before, it was never sent; after, it goes out when T4 expires (3.1 s after the CHOKE), then again on T1. No kernel report in either run. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit d07ed33f39eca24db1f1b15e00ef7c4447408a0d) Signed-off-by: Sasha Levin commit 9698d2e7cd489bc33689d9c962ed9efe9abb59ec 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 15465d681517c6180e709d749c50fba34c4ef419. Signed-off-by: Sasha Levin commit 1e907f2cfa8716109a9f71814a435f32b6e1ed9c Author: Melbin K Mathew Date: Thu Jul 2 01:42:48 2026 +0200 fbdev: serialize mode sysfs access with lock_fb_info() [ Upstream commit 061db6b7a910b8378f3b2df64f8c0a3ddc6e85f2 ] show_mode(), show_modes(), and store_mode() access fb_info->modelist and fb_info->mode without holding lock_fb_info(). store_modes() takes lock_fb_info() while replacing the modelist and freeing the old one. A concurrent reader or writer can load a pointer to an old modelist entry before store_modes() frees it, then dereference freed memory or store a stale freed pointer in fb_info->mode. Take lock_fb_info() in show_mode(), show_modes(), and store_mode() to serialize with store_modes(). In show_mode(), copy the mode to the stack and format after dropping the lock. In store_mode(), split activate() into a _locked variant to avoid double-locking, and hold the locks for the modelist walk, mode conversion, activation, and fb_info->mode assignment together. Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Melbin K Mathew Signed-off-by: Helge Deller Signed-off-by: Sasha Levin commit 383c62676ddedb45075dfca9cf00effa953668f6 Author: Melbin K Mathew Date: Thu Jul 2 01:42:47 2026 +0200 fbdev: clear fb_info->mode before deleting a videomode [ Upstream commit 95e647d2a5304a8fd11f1ba3c8502de700650131 ] fb_set_var() can delete a mode from info->modelist when userspace passes FB_ACTIVATE_INV_MODE through FBIOPUT_VSCREENINFO. The code checks that the mode being deleted is not the current info->var and that fbcon is not using it, but it does not check fb_info->mode. fb_info->mode may still point into the modelist entry being deleted. If the entry is freed, later mode sysfs reads through show_mode() can dereference a stale pointer. Clear fb_info->mode before calling fb_delete_videomode() when it matches the mode being removed. Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Melbin K Mathew Signed-off-by: Helge Deller Signed-off-by: Sasha Levin commit 0991aaea7fe5443da8b279a49507dc86c7255ba5 Author: Melbin K Mathew Date: Thu Jul 2 01:42:46 2026 +0200 fbdev: bound mode sysfs output to the sysfs buffer [ Upstream commit d15d51fb26e830af58f3f21964f1c09c239077ea ] mode_string() uses snprintf() which can return a value larger than the remaining buffer space. show_modes() accumulates the return value into i without checking whether i has reached PAGE_SIZE, causing the offset to advance past the sysfs buffer if the modelist is long enough. Add a size parameter to mode_string() and use scnprintf() to return only the bytes actually written. Add an early return when offset already exceeds the buffer. In show_modes(), stop accumulating once the buffer is full. Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Melbin K Mathew Signed-off-by: Helge Deller Signed-off-by: Sasha Levin commit d4e0f75acf267a7dcb3c1c2d363315b21144d89d Author: Long Li Date: Tue Mar 17 09:51:52 2026 +0800 xfs: only assert new size for datafork during truncate extents [ Upstream commit e942498385bf80f4d6d075b47174035545eb6a2e ] The assertion functions properly because we currently only truncate the attr to a zero size. Any other new size of the attr is not preempted. Make this assertion is specific to the datafork, preparing for subsequent patches to truncate the attribute to a non-zero size. Reviewed-by: Darrick J. Wong Signed-off-by: Long Li Signed-off-by: Carlos Maiolino Signed-off-by: Sasha Levin commit d74739f58b2f9ac79da133de9511283b82142644 Author: Gabriele Monaco Date: Tue Jan 13 09:52:01 2026 +0100 sched/deadline: Fix server stopping with runnable tasks [ Upstream commit ca1e8eede4fc68ce85a9fdce1a6c13ad64933318 ] The deadline server can currently stop due to idle although fair tasks are runnable. This happens essentially when: * the server is set to idle, a task wakes up, the server stops * a task wakes up, the server sets itself to idle and stops right away Address both cases by clearing the server idle flag whenever a fair task wakes up and accounting also for pending tasks in the definition of idle. Fixes: f5a538c07df2 ("sched/deadline: Fix dl_server stop condition") Signed-off-by: Gabriele Monaco Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260113085159.114226-3-gmonaco@redhat.com Signed-off-by: Sasha Levin commit 784e78c7b96752a8e8eaa42ec55c7c1923282fe3 Author: Peter Zijlstra Date: Tue Jan 13 10:50:41 2026 +0100 sched: Provide idle_rq() helper [ Upstream commit 1e0a2ba7afb1b60f02599093d84b72ce62ad11c0 ] A fix for the dl_server 'requires' idle_cpu() usage, which made me note that it and available_idle_cpu() are extern function calls. And while idle_cpu() is used outside of kernel/sched/, available_idle_cpu() is not. This makes it hard to make idle_cpu() an inline helper, so provide idle_rq() and implement idle_cpu() and available_idle_cpu() using that. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sasha Levin commit 7d80f213114af58f084965b166988f6e6c4f9052 Author: Peter Zijlstra Date: Fri Oct 31 13:54:24 2025 +0100 sched/deadline: Fix dl_server stop condition [ Upstream commit f5a538c07df26f5c601e41f7b9c7ade3e1e75803 ] Gabriel reported that the dl_server doesn't stop as expected. The problem was found to be the fact that idle time and fair runtime are treated equally. Both will count towards dl_server runtime and push the activation forwards when it is in the zero-laxity wait state. Notably: dl_server_update_idle() update_curr_dl_se() if (dl_defer && dl_throttled && dl_runtime_exceeded()) hrtimer_try_to_cancel(); // stop timer replenish_dl_new_period() deadline = now + dl_deadline; // fwd period runtime = dl_runtime; start_dl_timer(); // restart timer And while we do want idle time accounted towards the *current* activation of the dl_server -- after all, a fair task could've ran if we had any -- we don't necessarily want idle time to cause or push forward an activation. Introduce dl_defer_idle to make this distinction. It will be set once idle time pushed the activation forward, once set idle time will only be allowed to consume any runtime but not push the activation. This will then cause dl_server_timer() to fire, which will stop the dl_server. Any non-idle time accounting during this phase will clear dl_defer_idle, so only a full period of idle will cause the dl_server to stop. Reported-by: Gabriele Monaco Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20251101000057.GA2184199@noisy.programming.kicks-ass.net Signed-off-by: Sasha Levin commit 3d5a66410766fe38bced7d32ca35a96d8add9612 Author: Peter Zijlstra Date: Mon Oct 20 16:15:05 2025 +0200 sched/deadline: Fix dl_server time accounting [ Upstream commit e636ffb9e31b4f7dde7fef5358669266b9ce02ec ] The dl_server time accounting code is a little odd. The normal scheduler pattern is to update curr before doing something, such that the old state is fully accounted before changing state. Notably, the dl_server_timer() needs to propagate the current time accounting since the current task could be ran by dl_server and thus this can affect dl_se->runtime. Similarly for dl_server_start(). And since the (deferred) dl_server wants idle time accounted, rework sched_idle_class time accounting to be more like all the others. Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20251020141130.GJ3245006@noisy.programming.kicks-ass.net Signed-off-by: Sasha Levin commit c4f86f9948ebf3159cc1b1f499b745f456d28961 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 fae39d56c607075624a1be08c94cdac059f79889 Author: Vladimir Petrzhikovskii Date: Fri Nov 20 15:39:53 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 [ vladimir: 6.18.y has no page_pool RX buffers. The driver syncs small and mergeable RX buffers in virtnet_rq_get_buf() with the length from the used ring, before any length check. Limit that sync to the length of the posted buffer; the existing checks then drop the packet. Tested with the reproducer described above: without this patch the marker reaches the guest page for small and mergeable buffers; with it the sync stops at the posted length and the packets are counted in rx_length_errors. ] Signed-off-by: Vladimir Petrzhikovskii Signed-off-by: Sasha Levin commit 73e34e371e6b05ffd9453c2062b2aa9e8fa770c0 Author: Rafael J. Wysocki Date: Mon Aug 10 13:38:08 2026 +0200 ACPI: platform: Use acpi_bus_get_primary_device() [ Upstream commit a9ba4dd2f18bf3f439d9ef0d8f375f90360ba1bd ] The acpi_get_first_physical_node() usage in acpi_platform_fill_resource() and acpi_create_platform_device() is generally unsafe because in theory the device returned by it may be freed at any time [1]. It is also inefficient because acpi_get_first_physical_node() is called multiple times for the same argument which can be avoided. Address these issues by using acpi_bus_get_primary_device() instead of acpi_get_first_physical_node() and adjusting the code to call it just once at the beginning of and acpi_create_platform_device() and drop the device reference acquired by it upon the return from that function. Fixes: 3b95bd160547 ("ACPI: introduce a function to find the first physical device") Fixes: a252d881c558 ("ACPI / platform: Pay attention to parent device's resources") Link: https://sashiko.dev/#/patchset/12955541.O9o76ZdvQC%40rafael.j.wysocki [1] Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/3436112.aeNJFYEL58@rafael.j.wysocki Signed-off-by: Sasha Levin commit 6f7ecc25feb0564ea891fd41ead3ba6883c4951e Author: Zizhi Wo Date: Sat Apr 18 14:06:34 2026 +0800 fs: aio: reject partial mremap to avoid Null-pointer-dereference error [ Upstream commit 3adf7ae18bf42601246031002287c103a27df307 ] [BUG] Recently, our internal syzkaller testing uncovered a null pointer dereference issue: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... [ 51.111664] filemap_read_folio+0x25/0xe0 [ 51.112410] filemap_fault+0xad7/0x1250 [ 51.113112] __do_fault+0x4b/0x460 [ 51.113699] do_pte_missing+0x5bc/0x1db0 [ 51.114250] ? __pte_offset_map+0x23/0x170 [ 51.114822] __handle_mm_fault+0x9f8/0x1680 ... Crash analysis showed the file involved was an AIO ring file. The phenomenon triggered is the same as the issue described in [1]. [CAUSE] Consider the following scenario: userspace sets up an AIO context via io_setup(), which creates a VMA covering the entire ring buffer. Then userspace calls mremap() with the AIO ring address as the source, a smaller old_len (less than the full ring size), MREMAP_MAYMOVE set, and without MREMAP_DONTUNMAP. The kernel will relocate the requested portion to a new destination address. During this move, __split_vma() splits the original AIO ring VMA. The requested portion is unmapped from the source and re-established at the destination, while the remainder stays at the original source address as an orphan VMA. The aio_ring_mremap() callback fires on the new destination VMA, updating ctx->mmap_base to the destination address. But the callback is unaware that only a partial region was moved and that an orphan VMA still exists at the source: source(AIO): +-------------------+---------------------+ | moved to dest | orphan VMA (AIO) | +-------------------+---------------------+ A A+partial_len A+ctx->mmap_size dest: +-------------------+ | moved VMA (AIO) | +-------------------+ B B+partial_len Later, io_destroy() calls vm_munmap(ctx->mmap_base, ctx->mmap_size), which unmaps the destination. This not only fails to unmap the orphan VMA at the source, but also overshoots the destination VMA and may unmap unrelated mappings adjacent to it! After put_aio_ring_file() calls truncate_setsize() to remove all pages from the pagecache, any subsequent access to the orphan VMA triggers filemap_fault(), which calls a_ops->read_folio(). Since aio does not implement read_folio, this results in a NULL pointer dereference. [FIX] Note that expanding mremap (new_len > old_len) is already rejected because AIO ring VMAs are created with VM_DONTEXPAND. The only problematic case is a partial move where "old_len == new_len" but both are smaller than the full ring size. Fix this by checking in aio_ring_mremap() that the new VMA covers the entire ring. This ensures the AIO ring is always moved as a whole, preventing orphan VMAs and the subsequent crash. [1]: https://lore.kernel.org/all/20260413010814.548568-1-wozizhi@huawei.com/ Signed-off-by: Zizhi Wo Link: https://patch.msgid.link/20260418060634.3713620-1-wozizhi@huaweicloud.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin commit b78f32ed0161cf84c5a92eedc9a73bee2907a953 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 ccf897907559563d6ef709266fd10cb7e21cdf2d 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 64c545c8349e95c477c38b71012f0b7dddd0b95b 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 824ba7071b8a96aaa2bdcbff213349cbe24c277b Author: Xiaoyao Li Date: Wed Aug 19 17:49:02 2026 +0800 KVM: TDX: Enable Bus Lock VM exit [ Upstream commit 63d196e2e20429de5ba501f1b6059d9b93140007 ] Enable Bus Lock VM exit functionality for TDX guests. Bus Lock VM exit is an existing feature supported by KVM. Userspace can enable Bus Lock VM exit through KVM_BUS_LOCK_DETECTION_EXIT when it's reported as supported. However, KVM reports the support of this CAP just based on the hardware capability but doesn't differentiate between VMX and TDX. This leads to the issue that userspace can enable this cap for TDX guests without getting an error, but the feature is not actually enabled because KVM doesn't call the TDX module API to program the relevant TD VMCS fields. Enable Bus Lock VM exit for TDX guests by programming the BUS_LOCK_DETECTION control in the TD VMCS and by adding the exit handler. Note, there is no enumeration bit for this feature by TDX module because all TDX modules support it and allow to set the TD VMCS as long as the hardware supports the feature. Fixes: 161d34609f9b ("KVM: TDX: Make TDX VM type supported") Cc: stable@vger.kernel.org Originally-by: Chenyi Qiang Signed-off-by: Xiaoyao Li Reviewed-by: Nikolay Borisov Link: https://patch.msgid.link/20260819094903.3060020-9-xiaoyao.li@intel.com Signed-off-by: Sean Christopherson Signed-off-by: Sasha Levin commit 66f91928ddf80fa9ee1097b86f39042fc6ff0536 Author: Baokun Li Date: Thu Nov 19 13:52:14 2026 -0500 writeback: use a per-sb counter to drain inode wb switches at umount commit 31c1d19ead2c26a63859a2757d8b786765ba9cdd upstream. Tracking in-flight inode wb switches with a single global counter (isw_nr_in_flight) plus a synchronize_rcu() based wait in cgroup_writeback_umount() forces every umount to take a global hit whenever any other superblock on the system has wb switches in flight, even if the superblock being unmounted has none of its own. Replace the global synchronize_rcu()/flush_workqueue() pair with a per-sb counter, s_isw_nr_in_flight, plus three small helpers: - cgroup_writeback_pin(sb) - increment counter - cgroup_writeback_unpin(sb) - decrement and wake drainer if last - cgroup_writeback_drain(sb) - wait for counter to reach zero The wiring is: - inode_prepare_wbs_switch() pins before checking SB_ACTIVE and grabbing the inode; failure paths unpin before returning. A lockless SB_ACTIVE check at the top of the function lets us skip the atomic_inc/smp_mb dance once SB_ACTIVE has been cleared (it is monotonic and never set back). - process_inode_switch_wbs() unpins after the matching iput(). - cgroup_writeback_umount() drains the per-sb counter via wait_var_event(). The smp_mb() pair between inode_prepare_wbs_switch() and cgroup_writeback_umount() keeps the SB_ACTIVE / counter ordering: either the umounter sees a non-zero counter and waits, or the switcher sees SB_ACTIVE cleared and aborts before grabbing the inode. The global isw_nr_in_flight is left in place, since it is still used to throttle in-flight switches via WB_FRN_MAX_IN_FLIGHT. The rcu_read_lock() extension in inode_switch_wbs() and cleanup_offline_cgwb() that the race fix added is no longer needed and is reverted; the synchronize_rcu() that the race fix added to cgroup_writeback_umount() is dropped as well. The following numbers were measured on a 16 vCPU QEMU guest with 4 background superblocks each churning "create memcg -> write 1 MiB -> rmdir memcg" to keep the global isw_nr_in_flight non-zero. Latencies are wall-clock around umount(8); only the target sb's umount is measured. Target sb runs its own cgwb churn: p50 p95 p99 max global synchronize_rcu() 67.6 ms 88.3 ms 88.3 ms 96.8 ms per-sb counter (this) 7.9 ms 10.0 ms 10.0 ms 10.1 ms Idle target umount latency under cross-sb cgwb-switch pressure: p50 p95 p99 max global synchronize_rcu() 62.7 ms 95.4 ms 108.1 ms 108.6 ms per-sb counter (this) 5.3 ms 6.9 ms 7.4 ms 7.4 ms no-pressure baseline 4.9 ms 5.9 ms 6.3 ms 6.7 ms 8 concurrent umounts of idle sbs under the same pressure: p50 p95 max global synchronize_rcu() 61.3 ms 99.5 ms 113.7 ms per-sb counter (this) 8.1 ms 9.1 ms 9.5 ms In-kernel cgroup_writeback_umount() time across the same run (bpftrace, ~340 calls covering all scenarios): global synchronize_rcu() 12371 ms total (~36 ms / call) per-sb counter (this) 1.37 ms total ( ~4 us / call) Suggested-by: Christian Brauner Link: https://lore.kernel.org/r/177910456953.488929.2169908940676707307.b4-review@b4 Reviewed-by: Jan Kara Signed-off-by: Baokun Li Link: https://patch.msgid.link/20260521095016.2791354-4-libaokun@linux.alibaba.com Acked-by: Tejun Heo Signed-off-by: Christian Brauner (Amutable) [ ehagberg: Backported to 6.18.y. struct super_block lives in include/linux/fs.h here, so add the field there. 6.18.y predates the inode_state_read()/inode_state_set() accessors, so adjust context accordingly. Also adjust context in cleanup_offline_cgwb() for "writeback: keep cleanup_offline_cgwb()'s scan out of syncs". No functional change from upstream. ] Signed-off-by: Eric Hagberg Signed-off-by: Sasha Levin commit 0ff55cf44774b03cd8ff82a8f7f15815681296bf Author: Ilya Dryomov Date: Thu Nov 19 09:57:26 2026 +0100 libceph: adapt ceph_x_challenge_blob hashing and msgr1 message signing commit 8356b4b1103b8c970648c94bab724aa30e42d869 upstream. The existing approach where ceph_x_challenge_blob is encrypted with the client's secret key and then the digest derived from the ciphertext is used for the test doesn't work with CEPH_CRYPTO_AES256KRB5 because the confounder randomizes the ciphertext: the client and the server get two different ciphertexts and therefore two different digests. msgr1 signatures are affected the same way: a digest derived from the ciphertext for the message's "sigblock" is what becomes a signature and the two sides disagree on the expected value. For CEPH_CRYPTO_AES256KRB5 (and potential future encryption schemes), switch to HMAC-SHA256 function keyed in the same way as the existing encryption. For CEPH_CRYPTO_AES, everything is preserved as is. Signed-off-by: Ilya Dryomov Signed-off-by: Jordan DESNOËS Signed-off-by: Sasha Levin commit 76d0148c158eaaf96f7072e41c8b520d4f8fc5bd Author: Ilya Dryomov Date: Thu Nov 19 09:57:25 2026 +0100 libceph: add support for CEPH_CRYPTO_AES256KRB5 commit b7cc142dbafeaf6c053284ca9121b9f70b6d6d06 upstream. This is based on AES256-CTS-HMAC384-192 crypto algorithm per RFC 8009 (i.e. Kerberos 5, hence the name) with custom-defined key usage numbers. The implementation allows a given key to have/be linked to between one and three usage numbers. The existing CEPH_CRYPTO_AES remains in place and unchanged. The usage_slot parameter that needed to be added to ceph_crypt() and its wrappers is simply ignored there. Signed-off-by: Ilya Dryomov [ Jordan: resolve conflict with 821365487aa5 in __ceph_x_decrypt() ] Signed-off-by: Jordan DESNOËS Signed-off-by: Sasha Levin commit aa4ea96ead9b8e4c96f4f19586fbddcf9489a398 Author: Ilya Dryomov Date: Thu Nov 19 09:57:24 2026 +0100 libceph: introduce ceph_crypto_key_prepare() commit 6cec0b61aacce4da5125b21c718189f0dc11eb51 upstream. In preparation for bringing in a new encryption scheme/key type, decouple decoding or cloning the key from allocating required crypto API objects and setting them up. The rationale is that a) in some cases a shallow clone is sufficient and b) ceph_crypto_key_prepare() may grow additional parameters that would be inconvenient to provide at the point the key is originally decoded. Signed-off-by: Ilya Dryomov Signed-off-by: Jordan DESNOËS Signed-off-by: Sasha Levin commit 57adc5ee0faa4b03ca542e89401bc69e4e967d6b Author: Ilya Dryomov Date: Thu Nov 19 09:57:23 2026 +0100 libceph: generalize ceph_x_encrypt_offset() and ceph_x_encrypt_buflen() commit 0ee8bccf7396d50726c9c8dd3135fb64a9fe8426 upstream. - introduce the notion of a data offset for ceph_x_encrypt_offset() to allow for e.g. confounder to be prepended before the encryption header in the future. For CEPH_CRYPTO_AES, the data offset is 0 (i.e. nothing is prepended). - adjust ceph_x_encrypt_buflen() accordingly and make it account for PKCS#7 padding that is used by CEPH_CRYPTO_AES precisely instead of just always adding 16. Signed-off-by: Ilya Dryomov [ Jordan: resolve conflict with 821365487aa5 in __ceph_x_decrypt() ] Signed-off-by: Jordan DESNOËS Signed-off-by: Sasha Levin commit f1d4713b8ccd98db8f063c561ca219d4507003a5 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 2af31b021914b146f4951a0b5b90150998d9db26 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 fd39789475600dafbaf219b9179e81b04b96e0e1 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 87c69cfa32b8483cb9f05adff7603c32928302b8 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 a9af75df49f1d5c4eb2c314345a161d90d8567a5 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 commit 9f3a5ef3359878a5514edffab43bab71a8f084ec Author: Eric Dumazet Date: Thu Oct 1 19:11:39 2026 +0000 net: always dissect GSO packets in __virtio_net_hdr_to_skb() [ Upstream commit 44378d02c5aaae24b60a75fbbb539b4aa4db503d ] Commit 9e8db5913264 ("net: avoid false positives in untrusted gso validation") added a '&& skb->network_header' check before flow-dissecting GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM in __virtio_net_hdr_to_skb(), because some callers (such as tun_get_user(), tun_xdp_one(), virtnet_receive_done(), and raw_verify_header()) called virtio_net_hdr_*_to_skb() before initializing skb->network_header and skb->dev. Because __alloc_skb() and __build_skb_around() zero-initialize skb->network_header to 0 (unlike mac_header and transport_header which are initialized to ~0U), those four callers always had skb->network_header == 0 and bypassed flow dissection in __virtio_net_hdr_to_skb(). More generally, skb->network_header is an offset from skb->head (where 0 is also a valid offset whenever skb_headroom(skb) is 0), not a boolean flag. Whenever the 'if (gso_type && skb->network_header)' branch was skipped, the fallback 'else if (gso_type)' only pulled nh_min_len + thlen (40 bytes for TCPv4) without dissecting the packet, without validating ip_proto or n_proto, and without setting skb->transport_header. If the packet has a malformed network header, it is not rejected and a subsequent skb_probe_transport_header() also fails, leaving skb->transport_header at ~0U (0xffff). Similarly, if an IPv4 packet carries IP options (ihl > 5) or an IPv6 packet carries extension headers, pulling only nh_min_len + thlen can leave the TCP header outside skb->head. In both cases, tcp_hdrlen(skb) in skb_gso_transport_seglen() reads out-of-bounds: BUG: KASAN: slab-out-of-bounds in skb_gso_transport_seglen Read of size 2 by task poc/133 skb_gso_transport_seglen (net/core/gso.c:155) skb_gso_validate_mac_len (net/core/gso.c:270) tbf_enqueue (net/sched/sch_tbf.c:260) dev_qdisc_enqueue (net/core/dev.c:4227) __dev_queue_xmit (net/core/dev.c:4884) In addition, checking virtio_net_hdr_match_proto() only inside 'if (!skb->protocol)' before flow dissection both skipped validation when skb->protocol was pre-set by the caller and rejected VLAN-tagged frames whose outer L2 protocol is ETH_P_8021Q or ETH_P_8021AD. Fix this by: 1. Initializing skb->dev and skb->network_header (plus skb->protocol for IFF_TUN) before virtio_net_hdr_*_to_skb() in tun_get_user(), tun_xdp_one(), virtnet_receive_done(), and raw_verify_header(). In tun_get_user(), drop the redundant skb_reset_mac_header(skb) in the IFF_TUN case since __virtio_net_hdr_to_skb() unconditionally resets mac_header. 2. Removing '&& skb->network_header' and the unvalidated 'else if (gso_type)' fallback in __virtio_net_hdr_to_skb() so all GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are flow-dissected, have their transport header pulled into linear data, and have skb->transport_header set. 3. Moving the virtio_net_hdr_match_proto() check to after skb_flow_dissect_flow_keys_basic(), validating keys.basic.n_proto against hdr_gso_type. Fixes: 9e8db5913264 ("net: avoid false positives in untrusted gso validation") Fixes: d5be7f632bad ("net: validate untrusted gso packets without csum offload") Fixes: 924a9bc362a5 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct") Reported-by: Weiming Shi Closes: https://lore.kernel.org/netdev/20260927163117.746432-2-bestswngs@gmail.com/ Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Cc: Michael S. Tsirkin Link: https://patch.msgid.link/20261001191140.2818991-3-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 7f32b80daa31646573b5f7bfe04c4975c96b2988 Author: Johannes Weiner Date: Wed Oct 28 13:15:54 2026 -0400 mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES [ Upstream commit fe21f930d1e64d121191673076fc4ebe79fc82d5 ] 1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves") stopped handing out reserve access for ALLOC_NON_BLOCK on its own: the extra 25% below the min watermark is now only granted on top of ALLOC_MIN_RESERVE. But the flag was left in ALLOC_RESERVES, which produces something odd: With the ALLOC_RESERVES match, __zone_watermark_unusable_free() doesn't subtract the free highatomic pages for them. So in the slowpath, they get to consume regular blocks below the min watermark by the number of free highatomic pages. The highatomic reserve is capped at 1% of the zone, which on any decently sized machine is a multiple of the min watermark: GFP_NOWAIT can drain regular memory to zero. The user-visible result is brutal hiccups during bursts of GFP_NOWAIT allocations under memory pressure. This was found in review and reproduced with a synthetic burst, not observed in production, but the sequence of events is a realistic one: On a 32G box with an anonymous working set, swap, and a filled 290M highatomic reserve, a GFP_NOWAIT burst drove regular free memory in the 28G Normal zone (min=60M) to 28M, 0.8M and 0.6M in three runs. Swapout failed to allocate its swap table, reclaim scanned 13M pages to reclaim 200k, page faults stalled for tens to hundreds of milliseconds. The machine survives it, but not by design: direct reclaimers eventually fail and start unreserving highatomic blocks, until the allocation succeeds or the reserve is gone and the OOM killer runs. That reserve exists for high-order atomic allocations; here it is destroyed to bail out a GFP_NOWAIT consumer that was never entitled to the memory. Remove ALLOC_NON_BLOCK from ALLOC_RESERVES. With that, the GFP_NOWAIT burst is stopped short at the min watermark. No direct reclaim, no stalls, no failed allocations, and the highatomic reserve stays intact for the requests it exists for. __zone_watermark_ok() is unaffected, since everything it keys on ALLOC_NON_BLOCK is already nested under ALLOC_MIN_RESERVE. Update the flag comments accordingly: ALLOC_NON_BLOCK just means the caller can't block; the reserve math belongs with ALLOC_MIN_RESERVE. GFP_ATOMIC order-0 requests have a milder version of the same problem. Through ALLOC_MIN_RESERVE they also count the free highatomic pages in their watermark check, but rmqueue_buddy() serves them regular pages first and only falls back to the reserve once those are gone. They can still push regular free memory to 37.5% of min minus the free highatomic pages before the reserve is touched. Unlike GFP_NOWAIT they are entitled to the reserve, so this needs the watermark check and the freelist order reworked together, and is left to a separate patch. Link: https://lore.kernel.org/20261028171719.2043421-3-hannes@cmpxchg.org Fixes: 1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves") Signed-off-by: Johannes Weiner Signed-off-by: Andrew Morton Acked-by: Balbir Singh Reviewed-by: Vlastimil Babka (SUSE) Cc: Matthew Wilcox (Oracle) Cc: Salvatore Dipietro Cc: Christoph Hellwig Cc: Dave Chinner Cc: Matt Fleming Cc: Mel Gorman Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Brendan Jackman Cc: Zi Yan Cc: [ sashal: Applied the same three edits in mm/internal.h because mm/page_alloc.h does not exist in this tree, with slightly different surrounding flag context. ] Signed-off-by: Sasha Levin commit 87d5bd7668c422f3fd68d9354cb872b554a0df5c Author: Pengpeng Hou Date: Sun Sep 20 21:06:53 2026 +0800 irqchip/sifive-plic: Avoid signed shift in interrupt enable mask [ Upstream commit 0f214e5bbee59d5952d3c061fd65ed9a1e175981 ] __plic_toggle() builds a 32-bit interrupt enable mask using a signed integer literal. A valid interrupt selecting bit 31 evaluates 1 << 31, which shifts a signed int into its sign bit. Use BIT(), matching the equivalent mask construction in plic_irq_eoi(). The resulting mask remains representable in u32 on both RV32 and RV64. The issue was found by our static-analysis tool. Fixes: 8237f8bc4f6e ("irqchip: add a SiFive PLIC driver") Signed-off-by: Pengpeng Hou Signed-off-by: Thomas Gleixner Assisted-by: gpt 5 Link: https://patch.msgid.link/caplitmus-rv.v2.plic.87a8fc444de44e109889ba28703c76f3@163.com [ sashal: Context adjusted because __plic_toggle() here takes an enable_base pointer rather than a handler; the single 1 << (hwirq % 32) to BIT(hwirq % 32) change is otherwise identical. ] Signed-off-by: Sasha Levin commit 46ece076c154d5a79f77b82d2f9c16b08f6b961b Author: KP Singh Date: Wed May 20 04:40:59 2026 +0200 bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature [ Upstream commit 49b18315be4eecfc36b75f4aecb4d40a87d68a20 ] __bpf_dynptr_data() can return NULL (FILE dynptrs, any non-contiguous backing). bpf_verify_pkcs7_signature() forwards the pointer to verify_pkcs7_signature() unchecked, causing a NULL deref in asn1_ber_decoder() reachable from a sleepable BPF LSM at lsm.s/bpf. NULL-check both pointers and reject with -EINVAL. Mirrors the guards already in kernel/bpf/crypto.c. Fixes: 865b0566d8f1 ("bpf: Add bpf_verify_pkcs7_signature() kfunc") Reported-by: Xianrui Dong Signed-off-by: KP Singh Reviewed-by: Amery Hung Acked-by: Song Liu Acked-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20260520024059.313468-1-kpsingh@kernel.org Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Sasha Levin commit 4fc4b1df31463c4388691a54565f1597ef2abe3c Author: Pablo Neira Ayuso Date: Tue Nov 17 23:23:07 2026 +0000 netfilter: nft_ct: move custom expectation support to helper [ Upstream commit 3679da4ad8be84cddaf40bc307fef1fe13e051ff ] Originally, the ct expectation support called nf_ct_helper_ext_add() for confirmed conntracks, which is invalid, triggering a splat. This was fixed by commit 1710eb913bdc ("netfilter: nft_ct: skip expectations for confirmed conntrack") which restricted it to unconfirmed conntracks. However, early insertion of expectations into the expectations list when the conntrack is unconfirmed leads to stale entries pointing to the wrong hlist_head through .pprev due to ct extension reallocation. Commit 7c9664351980 ("netfilter: move nat hlist_head to nf_conn") moved the nat hlist_head to nf_conn for this reason: 1. ... 2. When reallocation of extension area occurs we need to fixup the bysource hash head via hlist_replace_rcu. I'd rather not increase the size of the struct nf_conn for this feature has very limited scope: only one expectation can be created at a time given expect_clash() will make nf_ct_expect_related() reports EBUSY. For this reason, relax nf_ct_expect_related() not to drop packets in case expectation creation fails, therefore, expectation creation becomes best effort. To address this issue, add an internal ct helper and attach it to the conntrack entry to streamline the custom ct expectation support with existing ct helpers. Expose a new nf_conntrack_helper_release() function to release the internal helper that is allocated and attached to the conntrack entry to create the custom expectations. The nft_ct module removal always waits for rcu grace period, then the NULL helper callback is observed after this. This patch also restricts the creation of expectations to different helpers other than this custom helper that is created for this type of expectations. Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support") Reported-by: Jaeyeong Lee Link: https://patch.msgid.link/20260715144755.00ea7dfcd9f@proton.me Signed-off-by: Pablo Neira Ayuso [ - ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from datapath") is not backported because it reworks helper lifetime around a datapath ct_refcnt in 9 files, so one static nft_ct_expect helper is unhelped at nft_ct module exit. - d4beefc90a66 ("netfilter: nft_ct: support expectation creation for natted flows") is not backported because it adds expectation support for NATed flows, so the moved expectation code has no NAT follow-master part. - Context differs due to commit: 6031487d4e27 ] Signed-off-by: Mark Bundschuh Signed-off-by: Sasha Levin commit 68b310c6156636cf5d74538a27afb36131f2b687 Author: Florian Westphal Date: Tue Nov 17 23:23:06 2026 +0000 netfilter: nft_ct: expectation timeouts are passed in milliseconds [ Upstream commit 6fb421bd07f156cdf0cdede062d31f1c21def326 ] Userspace passes '5000' in case user asks for 5 seconds. Allowing for sub-second expectation lifetimes makes sense to me. so fix up the kernel side instead of munging nft to send a value rounded up to next second. Also note that this violates nft convention of passing integers in network byte order, but we can't change this anymore. Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Stable-dep-of: 3679da4ad8be ("netfilter: nft_ct: move custom expectation support to helper") Signed-off-by: Mark Bundschuh Signed-off-by: Sasha Levin