From: Greg Kroah-Hartman Date: Thu, 28 May 2026 11:38:00 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v5.10.258~31 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=d37cb4aff32901c0f5b401e4fac7045eeb89709e;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: af_unix-fix-uaf-read-of-tail-len-in-unix_stream_data_wait.patch ice-fix-setting-promisc-mode-while-adding-vid-filter.patch ice-restore-ptp-rx-timestamp-config-after-ethtool-set-channels.patch ipv4-raw-reject-ip_hdrincl-packets-with-ihl-5.patch ipv6-ioam-add-null-check-for-idev-in-ipv6_hop_ioam.patch ixgbevf-fix-use-after-free-in-vepa-multicast-source-pruning.patch l2tp-use-list_del_rcu-in-l2tp_session_unhash.patch lsm-hold-cred_guard_mutex-for-lsm_set_self_attr.patch octeontx2-af-cgx-add-bounds-check-to-cgx_speed_mbps-index.patch qed-fix-double-free-in-qed_cxt_tables_alloc.patch rbd-eliminate-a-race-in-lock_dwork-draining-on-unmap.patch ring-buffer-fix-reporting-of-missed-events-in-iterator.patch vsock-virtio-reset-connection-on-receiving-queue-overflow.patch vsock-vmci-fix-uaf-when-peer-resets-connection-during-handshake.patch wifi-ath11k-clear-shared-srng-pointer-state-on-restart.patch wifi-cfg80211-advance-loop-vars-in-cfg80211_merge_profile.patch wifi-mac80211-consume-only-present-negotiated-ttlm-maps.patch --- diff --git a/queue-6.12/af_unix-fix-uaf-read-of-tail-len-in-unix_stream_data_wait.patch b/queue-6.12/af_unix-fix-uaf-read-of-tail-len-in-unix_stream_data_wait.patch new file mode 100644 index 0000000000..4afd37eae5 --- /dev/null +++ b/queue-6.12/af_unix-fix-uaf-read-of-tail-len-in-unix_stream_data_wait.patch @@ -0,0 +1,163 @@ +From be309f8eae8b474a4a617eaae01324da996fc719 Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Mon, 18 May 2026 18:51:30 +0200 +Subject: af_unix: Fix UAF read of tail->len in unix_stream_data_wait() + +From: Jann Horn + +commit be309f8eae8b474a4a617eaae01324da996fc719 upstream. + +unix_stream_data_wait() does skb_peek_tail(&sk->sk_receive_queue) without +holding any lock that prevents SKBs on that queue from being dequeued and +freed. +This has been the case since commit 79f632c71bea ("unix/stream: fix +peeking with an offset larger than data in queue"). +The first consequence of this is that the pointer comparison +`tail != last` can be false even if `last` semantically refers to an +already-freed SKB while `tail` is a new SKB allocated at the same address; +which can cause unix_stream_data_wait() to wrongly keep blocking after new +data has arrived, but only in a weird scenario where a peeking recv() and +a normal recv() on the same socket are racing, which is probably not a +real problem. + +But since commit 2b514574f7e8 ("net: af_unix: implement splice for stream +af_unix sockets"), `tail` is actually dereferenced, which can cause UAF in +the following race scenario (where test_setup() runs single-threaded, +and afterwards, test_thread1() and test_thread2() run concurrently in +two threads: +``` +static int socks[2]; +void test_setup(void) { + socketpair(AF_UNIX, SOCK_STREAM, 0, socks); + send(socks[1], "A", 1, 0); + int peekoff = 1; + setsockopt(socks[0], SOL_SOCKET, SO_PEEK_OFF, &peekoff, sizeof(peekoff)); +} +void test_thread1(void) { + char dummy; + recv(socks[0], &dummy, 1, MSG_PEEK); +} +void test_thread2(void) { + char dummy; + recv(socks[0], &dummy, 1, 0); + shutdown(socks[1], SHUT_WR); +} +``` + +when racing like this: +``` +thread1 thread2 +unix_stream_read_generic + mutex_lock(&u->iolock) + skb_peek(&sk->sk_receive_queue) + skb_peek_next(skb, &sk->sk_receive_queue) + mutex_unlock(&u->iolock) + unix_stream_read_generic + unix_state_lock(sk) + skb_peek(&sk->sk_receive_queue) + unix_state_unlock(sk) + unix_stream_data_wait + unix_state_lock(sk) + tail = skb_peek_tail(&sk->sk_receive_queue) + spin_lock(&sk->sk_receive_queue.lock) + __skb_unlink(skb, &sk->sk_receive_queue) + spin_unlock(&sk->sk_receive_queue.lock) + consume_skb(skb) [frees the SKB] + `tail != last`: false + `tail`: true + `tail->len != last_len` ***UAF*** +``` + +Fix the UAF by removing the read of tail->len; checking tail->len would +only make sense if SKBs in the receive queue of a UNIX socket could grow, +which can no longer happen. + +Kuniyuki explained: + +> When commit 869e7c62486e ("net: af_unix: implement stream sendpage +> support") added sendpage() support, data could be appended to the last +> skb in the receiver's queue. +> +> That's why we needed to check if the length of the last skb was changed +> while waiting for new data in unix_stream_data_wait(). +> +> However, commit a0dbf5f818f9 ("af_unix: Support MSG_SPLICE_PAGES") and +> commit 57d44a354a43 ("unix: Convert unix_stream_sendpage() to use +> MSG_SPLICE_PAGES") refactored sendmsg(), and now data is always added +> to a new skb. + +That means this fix is not suitable for kernels before 6.5. + +Fixes: 2b514574f7e8 ("net: af_unix: implement splice for stream af_unix sockets") +Cc: stable@vger.kernel.org # 6.5.x +Signed-off-by: Jann Horn +Reviewed-by: Kuniyuki Iwashima +Link: https://patch.msgid.link/20260518-b4-unix-recv-wait-hotfix-v2-1-83e29ce8ad31@google.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/unix/af_unix.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +--- a/net/unix/af_unix.c ++++ b/net/unix/af_unix.c +@@ -2570,8 +2570,7 @@ static int unix_read_skb(struct sock *sk + * Sleep until more data has arrived. But check for races.. + */ + static long unix_stream_data_wait(struct sock *sk, long timeo, +- struct sk_buff *last, unsigned int last_len, +- bool freezable) ++ struct sk_buff *last, bool freezable) + { + unsigned int state = TASK_INTERRUPTIBLE | freezable * TASK_FREEZABLE; + struct sk_buff *tail; +@@ -2584,7 +2583,6 @@ static long unix_stream_data_wait(struct + + tail = skb_peek_tail(&sk->sk_receive_queue); + if (tail != last || +- (tail && tail->len != last_len) || + sk->sk_err || + (sk->sk_shutdown & RCV_SHUTDOWN) || + signal_pending(current) || +@@ -2779,7 +2777,6 @@ static int unix_stream_read_generic(stru + int flags = state->flags; + bool check_creds = false; + struct scm_cookie scm; +- unsigned int last_len; + struct unix_sock *u; + int copied = 0; + int err = 0; +@@ -2825,7 +2822,6 @@ redo: + goto unlock; + } + last = skb = skb_peek(&sk->sk_receive_queue); +- last_len = last ? last->len : 0; + + again: + #if IS_ENABLED(CONFIG_AF_UNIX_OOB) +@@ -2859,8 +2855,7 @@ again: + + mutex_unlock(&u->iolock); + +- timeo = unix_stream_data_wait(sk, timeo, last, +- last_len, freezable); ++ timeo = unix_stream_data_wait(sk, timeo, last, freezable); + + if (signal_pending(current)) { + err = sock_intr_errno(timeo); +@@ -2877,7 +2872,6 @@ unlock: + while (skip >= unix_skb_len(skb)) { + skip -= unix_skb_len(skb); + last = skb; +- last_len = skb->len; + skb = skb_peek_next(skb, &sk->sk_receive_queue); + if (!skb) + goto again; +@@ -2950,7 +2944,6 @@ unlock: + + skip = 0; + last = skb; +- last_len = skb->len; + unix_state_lock(sk); + skb = skb_peek_next(skb, &sk->sk_receive_queue); + if (skb) diff --git a/queue-6.12/ice-fix-setting-promisc-mode-while-adding-vid-filter.patch b/queue-6.12/ice-fix-setting-promisc-mode-while-adding-vid-filter.patch new file mode 100644 index 0000000000..8692939a5d --- /dev/null +++ b/queue-6.12/ice-fix-setting-promisc-mode-while-adding-vid-filter.patch @@ -0,0 +1,56 @@ +From ebc8de716c9ec2be384abdc2dd866da26c6580d1 Mon Sep 17 00:00:00 2001 +From: Marcin Szycik +Date: Fri, 15 May 2026 11:24:10 -0700 +Subject: ice: fix setting promisc mode while adding VID filter + +From: Marcin Szycik + +commit ebc8de716c9ec2be384abdc2dd866da26c6580d1 upstream. + +There are at least two paths through which VSI promiscuous mode can be +independently configured via ice_fltr_set_vsi_promisc(): +- ice_vlan_rx_add_vid() (netdev op) +- ice_service_task() -> ... -> ice_set_promisc() + +Both paths may try to program promiscuous mode concurrently. One such +scenario is: + +1. Add ice netdev to bond +2. Add the bond netdev to bridge +3. ice netdev enters allmulticast mode (IFF_ALLMULTI) +4. Service task programs promisc mode filter +5. Bridge -> bond calls ice_vlan_rx_add_vid() + +Crucially, ice_vlan_rx_add_vid() fails if ice_fltr_set_vsi_promisc() +returns any error, including -EEXIST. This causes VLAN filtering setup +to fail on the bond interface. ice_set_promisc() already handles -EEXIST +correctly. + +Fix by adding the same -EEXIST check to ice_vlan_rx_add_vid(): if the +promisc filter is already programmed, continue without returning error. + +Fixes: 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling") +Cc: stable@vger.kernel.org +Signed-off-by: Marcin Szycik +Signed-off-by: Aleksandr Loktionov +Reviewed-by: Simon Horman +Tested-by: Rinitha S (A Contingent worker at Intel) +Signed-off-by: Tony Nguyen +Link: https://patch.msgid.link/20260515182419.1597859-4-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ice/ice_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/ice/ice_main.c ++++ b/drivers/net/ethernet/intel/ice/ice_main.c +@@ -3808,7 +3808,7 @@ int ice_vlan_rx_add_vid(struct net_devic + ret = ice_fltr_set_vsi_promisc(&vsi->back->hw, vsi->idx, + ICE_MCAST_VLAN_PROMISC_BITS, + vid); +- if (ret) ++ if (ret && ret != -EEXIST) + goto finish; + } + diff --git a/queue-6.12/ice-restore-ptp-rx-timestamp-config-after-ethtool-set-channels.patch b/queue-6.12/ice-restore-ptp-rx-timestamp-config-after-ethtool-set-channels.patch new file mode 100644 index 0000000000..9281ad5722 --- /dev/null +++ b/queue-6.12/ice-restore-ptp-rx-timestamp-config-after-ethtool-set-channels.patch @@ -0,0 +1,56 @@ +From 975b564d195b13ca6ee1ef5e6a9561734898eb17 Mon Sep 17 00:00:00 2001 +From: Grzegorz Nitka +Date: Fri, 15 May 2026 11:24:13 -0700 +Subject: ice: restore PTP Rx timestamp config after ethtool set-channels + +From: Grzegorz Nitka + +commit 975b564d195b13ca6ee1ef5e6a9561734898eb17 upstream. + +When ethtool -L changes queue counts, ice_vsi_recfg_qs() closes and +rebuilds the VSI, reallocating Rx rings. The newly allocated rings have +ptp_rx cleared, so RX hardware timestamps are no longer attached to skb +until hwtstamp configuration is applied again. + +Restore timestamp mode after ice_vsi_open() in the queue reconfiguration +path, matching reset/rebuild behavior and ensuring newly rebuilt Rx rings +have PTP RX timestamping re-enabled. + +Testing hints: +- run ptp4l application in client synchronization mode: + ptp4l -i ethX -m -s +- run PTP traffic +- change queue number on ethX netdev interface: + ethtool -L ethX combined new_queue_size +- observe ptp4l output +- expected result: no "received DELAY_REQ without timestamp" messages + +Fixes: 77a781155a65 ("ice: enable receive hardware timestamping") +Cc: stable@vger.kernel.org +Reviewed-by: Aleksandr Loktionov +Signed-off-by: Grzegorz Nitka +Reviewed-by: Simon Horman +Tested-by: Alexander Nowlin +Signed-off-by: Tony Nguyen +Link: https://patch.msgid.link/20260515182419.1597859-7-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/ethernet/intel/ice/ice_main.c ++++ b/drivers/net/ethernet/intel/ice/ice_main.c +@@ -4197,6 +4197,12 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi + } + ice_pf_dcb_recfg(pf, locked); + ice_vsi_open(vsi); ++ /* Rx rings are reallocated during VSI rebuild and lose their ptp_rx ++ * flag. Restore timestamp mode so newly allocated rings are set up ++ * for hardware Rx timestamping. ++ */ ++ if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags)) ++ ice_ptp_restore_timestamp_mode(pf); + goto done; + + rebuild_err: diff --git a/queue-6.12/ipv4-raw-reject-ip_hdrincl-packets-with-ihl-5.patch b/queue-6.12/ipv4-raw-reject-ip_hdrincl-packets-with-ihl-5.patch new file mode 100644 index 0000000000..964adc8ac1 --- /dev/null +++ b/queue-6.12/ipv4-raw-reject-ip_hdrincl-packets-with-ihl-5.patch @@ -0,0 +1,86 @@ +From 915fab69823a14c170dbaa3b41978768e0fe62fc Mon Sep 17 00:00:00 2001 +From: Michael Bommarito +Date: Tue, 12 May 2026 16:51:14 -0400 +Subject: ipv4: raw: reject IP_HDRINCL packets with ihl < 5 + +From: Michael Bommarito + +commit 915fab69823a14c170dbaa3b41978768e0fe62fc upstream. + +raw_send_hdrinc() validates that the caller-supplied IPv4 header +fits within the message length: + + iphlen = iph->ihl * 4; + err = -EINVAL; + if (iphlen > length) + goto error_free; + + if (iphlen >= sizeof(*iph)) { + /* fix up saddr, tot_len, id, csum, transport_header */ + } + +It does not, however, reject ihl < 5. For such a packet the +"if (iphlen >= sizeof(*iph))" branch is skipped, leaving the +crafted iphdr untouched, but the packet is still handed to +__ip_local_out() and onward. Downstream consumers that read +iph->ihl assume a sane value: net/ipv4/ah4.c:ah_output() in +particular subtracts sizeof(struct iphdr) from top_iph->ihl * 4 +and passes the (signed-int-negative, then cast to size_t) +result to memcpy(), producing an OOB access of length close to +SIZE_MAX and a host kernel panic. + +An IPv4 header with ihl < 5 is malformed by definition (RFC 791: +"Internet Header Length is the length of the internet header in +32 bit words ... Note that the minimum value for a correct header +is 5."). The kernel should not be willing to inject such a +packet into its own output path. + +Reject "iphlen < sizeof(*iph)" alongside the existing +"iphlen > length" check. This matches the principle that locally +constructed packets that re-enter the IP stack must pass the same +basic sanity tests that a foreign packet would be subjected to. + +Once this lands, the "if (iphlen >= sizeof(*iph))" wrapper around +the fixup branch becomes redundant; left in place to keep the +patch minimal and backport-friendly. A follow-up can unwrap it. + +Note that commit 86f4c90a1c5c ("ipv4, ipv6: ensure raw socket +message is big enough to hold an IP header") ensures the message +buffer is large enough to hold an iphdr, but does not constrain +the self-reported iph->ihl. + +Reachability: the malformed packet source is any caller with +CAP_NET_RAW, including an unprivileged process in a user+net +namespace on a kernel with CONFIG_USER_NS=y. The reproduced AH +crash also requires a matching xfrm AH policy on the outgoing +route; a container granted CAP_NET_ADMIN can install that state +and policy in its netns. Loopback bypasses xfrm_output, so the +trigger uses a real netdev. + +Reproduced on UML + KASAN: kernel-mode fault at addr 0x0 with +memcpy_orig at the crash site. Same shape reproduces inside a +rootless Docker container with --cap-add NET_ADMIN on a stock +distro kernel. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Cc: stable@vger.kernel.org +Suggested-by: Herbert Xu +Signed-off-by: Michael Bommarito +Link: https://patch.msgid.link/77ec2b5e8111961c2c39883c92e8aa2709039c17.1778614451.git.michael.bommarito@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/raw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv4/raw.c ++++ b/net/ipv4/raw.c +@@ -390,7 +390,7 @@ static int raw_send_hdrinc(struct sock * + * in, reject the frame as invalid + */ + err = -EINVAL; +- if (iphlen > length) ++ if (iphlen > length || iphlen < sizeof(*iph)) + goto error_free; + + if (iphlen >= sizeof(*iph)) { diff --git a/queue-6.12/ipv6-ioam-add-null-check-for-idev-in-ipv6_hop_ioam.patch b/queue-6.12/ipv6-ioam-add-null-check-for-idev-in-ipv6_hop_ioam.patch new file mode 100644 index 0000000000..3392879724 --- /dev/null +++ b/queue-6.12/ipv6-ioam-add-null-check-for-idev-in-ipv6_hop_ioam.patch @@ -0,0 +1,71 @@ +From d4ea0dfd75011b78cebf3808f98ac4c4f51a6fb9 Mon Sep 17 00:00:00 2001 +From: Justin Iurman +Date: Sun, 17 May 2026 20:30:59 +0200 +Subject: ipv6: ioam: add NULL check for idev in ipv6_hop_ioam() + +From: Justin Iurman + +commit d4ea0dfd75011b78cebf3808f98ac4c4f51a6fb9 upstream. + +Reported by Sashiko: + +The function ipv6_hop_ioam() accesses +__in6_dev_get(skb->dev)->cnf.ioam6_enabled without validating the returned +idev pointer. Because addrconf_ifdown() can concurrently clear dev->ip6_ptr +via RCU, __in6_dev_get() can return NULL during interface teardown, which +could cause a NULL pointer dereference when processing an IOAM Hop-by-Hop +option. + +Let's add a check and use SKB_DROP_REASON_IPV6DISABLED accordingly. + +Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace") +Cc: stable@vger.kernel.org +Signed-off-by: Justin Iurman +Reviewed-by: Ido Schimmel +Link: https://patch.msgid.link/20260517183059.29140-1-justin.iurman@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/exthdrs.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/net/ipv6/exthdrs.c ++++ b/net/ipv6/exthdrs.c +@@ -912,16 +912,27 @@ static bool ipv6_hop_ra(struct sk_buff * + + static bool ipv6_hop_ioam(struct sk_buff *skb, int optoff) + { ++ enum skb_drop_reason drop_reason; + struct ioam6_trace_hdr *trace; + struct ioam6_namespace *ns; ++ struct inet6_dev *idev; + struct ioam6_hdr *hdr; + ++ drop_reason = SKB_DROP_REASON_IP_INHDR; ++ + /* Bad alignment (must be 4n-aligned) */ + if (optoff & 3) + goto drop; + ++ /* Does the device still have IPv6 configuration? */ ++ idev = __in6_dev_get(skb->dev); ++ if (!idev) { ++ drop_reason = SKB_DROP_REASON_IPV6DISABLED; ++ goto drop; ++ } ++ + /* Ignore if IOAM is not enabled on ingress */ +- if (!READ_ONCE(__in6_dev_get(skb->dev)->cnf.ioam6_enabled)) ++ if (!READ_ONCE(idev->cnf.ioam6_enabled)) + goto ignore; + + /* Truncated Option header */ +@@ -974,7 +985,7 @@ ignore: + return true; + + drop: +- kfree_skb_reason(skb, SKB_DROP_REASON_IP_INHDR); ++ kfree_skb_reason(skb, drop_reason); + return false; + } + diff --git a/queue-6.12/ixgbevf-fix-use-after-free-in-vepa-multicast-source-pruning.patch b/queue-6.12/ixgbevf-fix-use-after-free-in-vepa-multicast-source-pruning.patch new file mode 100644 index 0000000000..9ec4a2fcb2 --- /dev/null +++ b/queue-6.12/ixgbevf-fix-use-after-free-in-vepa-multicast-source-pruning.patch @@ -0,0 +1,62 @@ +From 5d49b568c188dc77199d8d2b959c91da8cc27cf1 Mon Sep 17 00:00:00 2001 +From: Michael Bommarito +Date: Fri, 15 May 2026 11:24:14 -0700 +Subject: ixgbevf: fix use-after-free in VEPA multicast source pruning + +From: Michael Bommarito + +commit 5d49b568c188dc77199d8d2b959c91da8cc27cf1 upstream. + +ixgbevf_clean_rx_irq() prunes frames whose source MAC matches the VF's +own address (VEPA multicast workaround) by freeing the skb and +continuing to the next descriptor: + + dev_kfree_skb_irq(skb); + continue; + +The skb pointer is declared outside the while loop and persists across +iterations. Because the continue skips the "skb = NULL" reset at the +bottom of the loop, the next iteration enters the "else if (skb)" path +and calls ixgbevf_add_rx_frag() on the freed skb, dereferencing +skb_shinfo(skb)->nr_frags - a use-after-free in NAPI softirq context. + +The sibling driver iavf already handles this correctly by nulling the +pointer before continuing. Apply the same pattern here. + +I do not have ixgbevf hardware; the bug was found by static analysis +(scan_drop_continue_loops.py + semgrep drop_continue_in_loop, multi-tool +corroboration with the highest score in the scan). The UAF was confirmed +under KASAN by loading a test module that reproduces the exact code +pattern (alloc skb, kfree_skb, then read skb_shinfo(skb)->nr_frags): + + BUG: KASAN: slab-use-after-free in ixgbevf_uaf_test_init+0x100/0x1000 + Read of size 8 at addr 000000006163ae78 by task insmod/30 + freed 208-byte region [000000006163adc0, 000000006163ae90) + +QEMU emulates igb (82576) but not ixgbe (82599), and the igbvf VF +driver does not include the VEPA source pruning path, so a full +end-to-end reproduction with emulated hardware was not possible. + +Fixes: bad17234ba70 ("ixgbevf: Change receive model to use double buffered page based receives") +Cc: stable@vger.kernel.org +Signed-off-by: Michael Bommarito +Reviewed-by: Simon Horman +Tested-by: Rafal Romanowski +Signed-off-by: Tony Nguyen +Link: https://patch.msgid.link/20260515182419.1597859-8-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c ++++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +@@ -1224,6 +1224,7 @@ static int ixgbevf_clean_rx_irq(struct i + ether_addr_equal(rx_ring->netdev->dev_addr, + eth_hdr(skb)->h_source)) { + dev_kfree_skb_irq(skb); ++ skb = NULL; + continue; + } + diff --git a/queue-6.12/l2tp-use-list_del_rcu-in-l2tp_session_unhash.patch b/queue-6.12/l2tp-use-list_del_rcu-in-l2tp_session_unhash.patch new file mode 100644 index 0000000000..5d29c4d687 --- /dev/null +++ b/queue-6.12/l2tp-use-list_del_rcu-in-l2tp_session_unhash.patch @@ -0,0 +1,61 @@ +From 979c017803c40829b03acd9e5236e354b7622360 Mon Sep 17 00:00:00 2001 +From: Michael Bommarito +Date: Mon, 18 May 2026 14:34:47 -0400 +Subject: l2tp: use list_del_rcu in l2tp_session_unhash + +From: Michael Bommarito + +commit 979c017803c40829b03acd9e5236e354b7622360 upstream. + +An unprivileged local user can pin a host CPU indefinitely in +l2tp_session_get_by_ifname() by issuing L2TP_CMD_SESSION_GET on +L2TP_ATTR_IFNAME concurrently with L2TP_CMD_SESSION_CREATE and +L2TP_CMD_SESSION_DELETE on the same tunnel. All three commands take +GENL_UNS_ADMIN_PERM, so CAP_NET_ADMIN in the netns user namespace +suffices; on any host that has l2tp_core loaded the trigger is +reachable from a standard `unshare -Urn` sandbox. + +l2tp_session_unhash() removes a session from tunnel->session_list +with list_del_init(), but that list is walked by +l2tp_session_get_by_ifname() with list_for_each_entry_rcu() under +rcu_read_lock_bh(). list_del_init() leaves the deleted entry's +next/prev self-pointing; a reader that has loaded the entry and +then advances pos->list.next reads &session->list, container_of()s +back to the same session, and list_for_each_entry_rcu() never +reaches the list head. The CPU stays in strcmp() inside the +walker, with BH and preemption disabled, so RCU grace periods on +the host stall behind it and the wedged thread cannot be killed +(SIGKILL is delivered on syscall return). + +Use list_del_rcu() to match the existing list_add_rcu() in +l2tp_session_register(); the deleted session remains visible to +in-flight walkers with consistent next/prev pointers until +kfree_rcu() in l2tp_session_free() releases it. tunnel->session_list +has exactly one list_del_init() call site; the list_del_init +(&session->clist) at l2tp_core.c:533 operates on the per-collision +list, which is not walked under RCU. list_empty(&session->list) is +not used anywhere in net/l2tp/ after the unhash point, so dropping +the post-delete self-init is safe; the fix has no userspace-visible +behavior change. + +Fixes: 89b768ec2dfef ("l2tp: use rcu list add/del when updating lists") +Cc: stable@vger.kernel.org # 6.11+ +Signed-off-by: Michael Bommarito +Link: https://patch.msgid.link/20260518183447.64078-1-michael.bommarito@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/l2tp/l2tp_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/l2tp/l2tp_core.c ++++ b/net/l2tp/l2tp_core.c +@@ -1360,7 +1360,7 @@ static void l2tp_session_unhash(struct l + spin_lock_bh(&pn->l2tp_session_idr_lock); + + /* Remove from the per-tunnel list */ +- list_del_init(&session->list); ++ list_del_rcu(&session->list); + + /* Remove from per-net IDR */ + if (tunnel->version == L2TP_HDR_VER_3) { diff --git a/queue-6.12/lsm-hold-cred_guard_mutex-for-lsm_set_self_attr.patch b/queue-6.12/lsm-hold-cred_guard_mutex-for-lsm_set_self_attr.patch new file mode 100644 index 0000000000..54f0292123 --- /dev/null +++ b/queue-6.12/lsm-hold-cred_guard_mutex-for-lsm_set_self_attr.patch @@ -0,0 +1,41 @@ +From 4a9b16541ad3faf8bccb398532bf3f8b6bbf1188 Mon Sep 17 00:00:00 2001 +From: Stephen Smalley +Date: Wed, 13 May 2026 14:05:06 -0400 +Subject: lsm: hold cred_guard_mutex for lsm_set_self_attr() + +From: Stephen Smalley + +commit 4a9b16541ad3faf8bccb398532bf3f8b6bbf1188 upstream. + +Just as proc_pid_attr_write() already does before calling the LSM +hook. This only matters for SELinux and AppArmor which check +whether the process is being ptraced and if so, whether to +allow the transition. + +Cc: stable@vger.kernel.org +Signed-off-by: Stephen Smalley +Acked-by: Casey Schaufler +Signed-off-by: Paul Moore +Signed-off-by: Greg Kroah-Hartman +--- + security/lsm_syscalls.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/security/lsm_syscalls.c ++++ b/security/lsm_syscalls.c +@@ -55,7 +55,14 @@ u64 lsm_name_to_attr(const char *name) + SYSCALL_DEFINE4(lsm_set_self_attr, unsigned int, attr, struct lsm_ctx __user *, + ctx, u32, size, u32, flags) + { +- return security_setselfattr(attr, ctx, size, flags); ++ int rc; ++ ++ rc = mutex_lock_interruptible(¤t->signal->cred_guard_mutex); ++ if (rc < 0) ++ return rc; ++ rc = security_setselfattr(attr, ctx, size, flags); ++ mutex_unlock(¤t->signal->cred_guard_mutex); ++ return rc; + } + + /** diff --git a/queue-6.12/octeontx2-af-cgx-add-bounds-check-to-cgx_speed_mbps-index.patch b/queue-6.12/octeontx2-af-cgx-add-bounds-check-to-cgx_speed_mbps-index.patch new file mode 100644 index 0000000000..32a3be5991 --- /dev/null +++ b/queue-6.12/octeontx2-af-cgx-add-bounds-check-to-cgx_speed_mbps-index.patch @@ -0,0 +1,56 @@ +From c0bf0a4f3f1f5f57aa83e1400ba4f56f0abfd542 Mon Sep 17 00:00:00 2001 +From: Sam Daly +Date: Wed, 13 May 2026 18:42:53 +0200 +Subject: octeontx2-af: CGX: add bounds check to cgx_speed_mbps index +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sam Daly + +commit c0bf0a4f3f1f5f57aa83e1400ba4f56f0abfd542 upstream. + +cgx_speed_mbps has 13 elements but RESP_LINKSTAT_SPEED can yield values +0-15. If it returns a value >= 13, this causes an out-of-bounds array +access. Add a bounds check and default to speed 0 if the index is out of +range. + +Fixes: 61071a871ea6 ("octeontx2-af: Forward CGX link notifications to PFs") +Cc: Sunil Goutham +Cc: Linu Cherian +Cc: Geetha sowjanya +Cc: hariprasad +Cc: Subbaraya Sundeep +Cc: Andrew Lunn +Cc: stable +Signed-off-by: Sam Daly +Signed-off-by: Greg Kroah-Hartman +Link: https://patch.msgid.link/2026051352-refined-demise-e88d@gregkh +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c ++++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +@@ -1286,13 +1286,18 @@ static inline void link_status_user_form + struct cgx_link_user_info *linfo, + struct cgx *cgx, u8 lmac_id) + { ++ unsigned int speed; ++ + linfo->link_up = FIELD_GET(RESP_LINKSTAT_UP, lstat); + linfo->full_duplex = FIELD_GET(RESP_LINKSTAT_FDUPLEX, lstat); +- linfo->speed = cgx_speed_mbps[FIELD_GET(RESP_LINKSTAT_SPEED, lstat)]; + linfo->an = FIELD_GET(RESP_LINKSTAT_AN, lstat); + linfo->fec = FIELD_GET(RESP_LINKSTAT_FEC, lstat); + linfo->lmac_type_id = FIELD_GET(RESP_LINKSTAT_LMAC_TYPE, lstat); + ++ speed = FIELD_GET(RESP_LINKSTAT_SPEED, lstat); ++ linfo->speed = speed < ARRAY_SIZE(cgx_speed_mbps) ? ++ cgx_speed_mbps[speed] : 0; ++ + if (linfo->lmac_type_id >= LMAC_MODE_MAX) { + dev_err(&cgx->pdev->dev, "Unknown lmac_type_id %d reported by firmware on cgx port%d:%d", + linfo->lmac_type_id, cgx->cgx_id, lmac_id); diff --git a/queue-6.12/qed-fix-double-free-in-qed_cxt_tables_alloc.patch b/queue-6.12/qed-fix-double-free-in-qed_cxt_tables_alloc.patch new file mode 100644 index 0000000000..681cadbe75 --- /dev/null +++ b/queue-6.12/qed-fix-double-free-in-qed_cxt_tables_alloc.patch @@ -0,0 +1,54 @@ +From 2bccfb8476ca5f3548afbd623dc7a6980d4e77de Mon Sep 17 00:00:00 2001 +From: Dawei Feng +Date: Wed, 20 May 2026 15:03:23 +0800 +Subject: qed: fix double free in qed_cxt_tables_alloc() + +From: Dawei Feng + +commit 2bccfb8476ca5f3548afbd623dc7a6980d4e77de upstream. + +If one of the later PF or VF CID bitmap allocations fails, +qed_cid_map_alloc() jumps to cid_map_fail and frees the previously +allocated CID bitmaps before returning an error. qed_cxt_tables_alloc() +then calls qed_cxt_mngr_free(), which invokes qed_cid_map_free() +again. + +Fix this by setting each CID bitmap pointer to NULL after bitmap_free() +to avoid double free. + +The bug was first flagged by an experimental analysis tool we are +developing for kernel memory-management bugs while analyzing +v6.13-rc1. The tool is still under development and is not yet publicly +available. Manual inspection confirms that the bug is still +present in v7.1-rc3. + +Runtime reproduction was not attempted because exercising the failing +allocation path requires device-specific setup. + +Fixes: fe56b9e6a8d9 ("qed: Add module with basic common support") +Cc: stable@vger.kernel.org +Signed-off-by: Zilin Guan +Signed-off-by: Dawei Feng +Link: https://patch.msgid.link/20260520070323.2762379-1-dawei.feng@seu.edu.cn +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qed/qed_cxt.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c ++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c +@@ -1038,11 +1038,13 @@ static void qed_cid_map_free(struct qed_ + + for (type = 0; type < MAX_CONN_TYPES; type++) { + bitmap_free(p_mngr->acquired[type].cid_map); ++ p_mngr->acquired[type].cid_map = NULL; + p_mngr->acquired[type].max_count = 0; + p_mngr->acquired[type].start_cid = 0; + + for (vf = 0; vf < MAX_NUM_VFS; vf++) { + bitmap_free(p_mngr->acquired_vf[type][vf].cid_map); ++ p_mngr->acquired_vf[type][vf].cid_map = NULL; + p_mngr->acquired_vf[type][vf].max_count = 0; + p_mngr->acquired_vf[type][vf].start_cid = 0; + } diff --git a/queue-6.12/rbd-eliminate-a-race-in-lock_dwork-draining-on-unmap.patch b/queue-6.12/rbd-eliminate-a-race-in-lock_dwork-draining-on-unmap.patch new file mode 100644 index 0000000000..55c26cad4e --- /dev/null +++ b/queue-6.12/rbd-eliminate-a-race-in-lock_dwork-draining-on-unmap.patch @@ -0,0 +1,101 @@ +From 9fc75b71fdd38465c76c6f6a884cdd4ae3c72d90 Mon Sep 17 00:00:00 2001 +From: Ilya Dryomov +Date: Tue, 19 May 2026 23:07:26 +0200 +Subject: rbd: eliminate a race in lock_dwork draining on unmap + +From: Ilya Dryomov + +commit 9fc75b71fdd38465c76c6f6a884cdd4ae3c72d90 upstream. + +Given how rbd_lock_add_request() and rbd_img_exclusive_lock() are +written, lock_dwork may be (re)queued more than it's actually needed: +for example in case a new I/O request comes in while we are in the +middle of rbd_acquire_lock() on behalf of another I/O request. This is +expected and with rbd_release_lock() preemptively canceling lock_dwork +is benign under normal operation. + +A more problematic example is maybe_kick_acquire(): + + if (have_requests || delayed_work_pending(&rbd_dev->lock_dwork)) { + dout("%s rbd_dev %p kicking lock_dwork\n", __func__, rbd_dev); + mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork, 0); + } + +It's not unrealistic for lock_dwork to get canceled right after +delayed_work_pending() returns true and for mod_delayed_work() to +requeue it right there anyway. This is a classic TOCTOU race. + +When it comes to unmapping the image, there is an implicit assumption +of no self-initiated exclusive lock activity past the point of return +from rbd_dev_image_unlock() which unlocks the lock if it happens to be +held. This unlock is assumed to be final and lock_dwork (as well as +all other exclusive lock tasks, really) isn't expected to get queued +again. However, lock_dwork is canceled only in cancel_tasks_sync() +(i.e. later in the unmap sequence) and on top of that the cancellation +can get in effect nullified by maybe_kick_acquire(). This may result +in rbd_acquire_lock() executing after rbd_dev_device_release() and +rbd_dev_image_release() run and free and/or reset a bunch of things. +One of the possible failure modes then is a violated + + rbd_assert(rbd_image_format_valid(rbd_dev->image_format)); + +in rbd_dev_header_info() which is called via rbd_dev_refresh() from +rbd_post_acquire_action(). + +Redo exclusive lock task draining to provide saner semantics and try +to meet the assumptions around rbd_dev_image_unlock(). + +Cc: stable@vger.kernel.org +Signed-off-by: Ilya Dryomov +Reviewed-by: Viacheslav Dubeyko +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/rbd.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -4565,24 +4565,12 @@ out: + return ret; + } + +-static void cancel_tasks_sync(struct rbd_device *rbd_dev) +-{ +- dout("%s rbd_dev %p\n", __func__, rbd_dev); +- +- cancel_work_sync(&rbd_dev->acquired_lock_work); +- cancel_work_sync(&rbd_dev->released_lock_work); +- cancel_delayed_work_sync(&rbd_dev->lock_dwork); +- cancel_work_sync(&rbd_dev->unlock_work); +-} +- + /* + * header_rwsem must not be held to avoid a deadlock with + * rbd_dev_refresh() when flushing notifies. + */ + static void rbd_unregister_watch(struct rbd_device *rbd_dev) + { +- cancel_tasks_sync(rbd_dev); +- + mutex_lock(&rbd_dev->watch_mutex); + if (rbd_dev->watch_state == RBD_WATCH_STATE_REGISTERED) + __rbd_unregister_watch(rbd_dev); +@@ -6549,10 +6537,18 @@ out_err: + + static void rbd_dev_image_unlock(struct rbd_device *rbd_dev) + { ++ dout("%s rbd_dev %p\n", __func__, rbd_dev); ++ ++ disable_delayed_work_sync(&rbd_dev->lock_dwork); ++ disable_work_sync(&rbd_dev->unlock_work); ++ + down_write(&rbd_dev->lock_rwsem); + if (__rbd_is_lock_owner(rbd_dev)) + __rbd_release_lock(rbd_dev); + up_write(&rbd_dev->lock_rwsem); ++ ++ flush_work(&rbd_dev->acquired_lock_work); ++ flush_work(&rbd_dev->released_lock_work); + } + + /* diff --git a/queue-6.12/ring-buffer-fix-reporting-of-missed-events-in-iterator.patch b/queue-6.12/ring-buffer-fix-reporting-of-missed-events-in-iterator.patch new file mode 100644 index 0000000000..a3640c819f --- /dev/null +++ b/queue-6.12/ring-buffer-fix-reporting-of-missed-events-in-iterator.patch @@ -0,0 +1,72 @@ +From a254b6d13b0edd6272926674d2afc46d46e496b7 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Wed, 20 May 2026 22:08:01 -0400 +Subject: ring-buffer: Fix reporting of missed events in iterator + +From: Steven Rostedt + +commit a254b6d13b0edd6272926674d2afc46d46e496b7 upstream. + +When tracing is active while reading the trace file, if the iterator +reading the buffer detects that the writer has passed the iterator head, +it will reset and set a "missed events" flag. This flag is passed to the +output processing to show the user that events were missed: + + CPU:4 [LOST EVENTS] + +The problem is that the flag is reset after it is checked in +ring_buffer_iter_dropped(). But the "trace" file iterates over all the CPU +ring buffers and it will check if they are dropped when figuring out which +buffer to print next. This prematurely clears the missed_events flag if +the CPU buffer with the missed events is not the one that is printed next. + +On the iteration where the CPU buffer with the missed events is printed, +the check if it had missed events would return false and the output does +not show that events were missed. + +Do not reset the missed_events flag when checking if there were missed +events, but instead clear it when moving the iterator head to the next +event. + +Cc: stable@vger.kernel.org +Cc: Mathieu Desnoyers +Link: https://patch.msgid.link/20260520220801.4fd09d13@fedora +Fixes: c9b7a4a72ff64 ("ring-buffer/tracing: Have iterator acknowledge dropped events") +Acked-by: Masami Hiramatsu (Google) +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/ring_buffer.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -5120,6 +5120,7 @@ static void rb_iter_reset(struct ring_bu + iter->head_page = cpu_buffer->reader_page; + iter->head = cpu_buffer->reader_page->read; + iter->next_event = iter->head; ++ iter->missed_events = 0; + + iter->cache_reader_page = iter->head_page; + iter->cache_read = cpu_buffer->read; +@@ -5735,10 +5736,7 @@ ring_buffer_peek(struct trace_buffer *bu + */ + bool ring_buffer_iter_dropped(struct ring_buffer_iter *iter) + { +- bool ret = iter->missed_events != 0; +- +- iter->missed_events = 0; +- return ret; ++ return iter->missed_events != 0; + } + EXPORT_SYMBOL_GPL(ring_buffer_iter_dropped); + +@@ -5900,7 +5898,7 @@ void ring_buffer_iter_advance(struct rin + unsigned long flags; + + raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); +- ++ iter->missed_events = 0; + rb_advance_iter(iter); + + raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); diff --git a/queue-6.12/series b/queue-6.12/series index 5b70e717d1..d94ba2fcee 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -78,3 +78,20 @@ sched_ext-fix-missing-warning-in-scx_set_task_state-default-case.patch sched_ext-avoid-uaf-in-scx_root_enable_workfn-init-failure-path.patch cgroup-cpuset-reset-dl-migration-state-on-can_attach-failure.patch fs-ntfs3-handle-attr_set_size-errors-when-truncating-files.patch +l2tp-use-list_del_rcu-in-l2tp_session_unhash.patch +qed-fix-double-free-in-qed_cxt_tables_alloc.patch +ring-buffer-fix-reporting-of-missed-events-in-iterator.patch +ipv6-ioam-add-null-check-for-idev-in-ipv6_hop_ioam.patch +vsock-vmci-fix-uaf-when-peer-resets-connection-during-handshake.patch +vsock-virtio-reset-connection-on-receiving-queue-overflow.patch +wifi-ath11k-clear-shared-srng-pointer-state-on-restart.patch +ipv4-raw-reject-ip_hdrincl-packets-with-ihl-5.patch +ixgbevf-fix-use-after-free-in-vepa-multicast-source-pruning.patch +rbd-eliminate-a-race-in-lock_dwork-draining-on-unmap.patch +lsm-hold-cred_guard_mutex-for-lsm_set_self_attr.patch +octeontx2-af-cgx-add-bounds-check-to-cgx_speed_mbps-index.patch +ice-fix-setting-promisc-mode-while-adding-vid-filter.patch +ice-restore-ptp-rx-timestamp-config-after-ethtool-set-channels.patch +wifi-cfg80211-advance-loop-vars-in-cfg80211_merge_profile.patch +af_unix-fix-uaf-read-of-tail-len-in-unix_stream_data_wait.patch +wifi-mac80211-consume-only-present-negotiated-ttlm-maps.patch diff --git a/queue-6.12/vsock-virtio-reset-connection-on-receiving-queue-overflow.patch b/queue-6.12/vsock-virtio-reset-connection-on-receiving-queue-overflow.patch new file mode 100644 index 0000000000..2c50cc0909 --- /dev/null +++ b/queue-6.12/vsock-virtio-reset-connection-on-receiving-queue-overflow.patch @@ -0,0 +1,85 @@ +From a4f0b001782b21663d10df983b4b208195bec66c Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Mon, 18 May 2026 11:06:55 +0200 +Subject: vsock/virtio: reset connection on receiving queue overflow + +From: Stefano Garzarella + +commit a4f0b001782b21663d10df983b4b208195bec66c upstream. + +When there is no more space to queue an incoming packet, the packet is +silently dropped. This causes data loss without any notification to +either peer, since there is no retransmission. + +Under normal circumstances, this should never happen. However, it could +happen if the other peer doesn't respect the credit, or if the skb +overhead, which we recently began to take into account with commit +059b7dbd20a6 ("vsock/virtio: fix potential unbounded skb queue"), +is too high. + +Fix this by resetting the connection and setting the local socket error +to ENOBUFS when virtio_transport_recv_enqueue() can no longer queue a +packet, so both peers are explicitly notified of the failure rather than +silently losing data. + +Fixes: ae6fcfbf5f03 ("vsock/virtio: discard packets if credit is not respected") +Cc: stable@vger.kernel.org +Signed-off-by: Stefano Garzarella +Link: https://patch.msgid.link/20260518090656.134588-2-sgarzare@redhat.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + net/vmw_vsock/virtio_transport_common.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +--- a/net/vmw_vsock/virtio_transport_common.c ++++ b/net/vmw_vsock/virtio_transport_common.c +@@ -1348,7 +1348,7 @@ destroy: + return err; + } + +-static void ++static bool + virtio_transport_recv_enqueue(struct vsock_sock *vsk, + struct sk_buff *skb) + { +@@ -1363,10 +1363,8 @@ virtio_transport_recv_enqueue(struct vso + spin_lock_bh(&vvs->rx_lock); + + can_enqueue = virtio_transport_inc_rx_pkt(vvs, len); +- if (!can_enqueue) { +- free_pkt = true; ++ if (!can_enqueue) + goto out; +- } + + if (le32_to_cpu(hdr->flags) & VIRTIO_VSOCK_SEQ_EOM) + vvs->msg_count++; +@@ -1406,6 +1404,8 @@ out: + spin_unlock_bh(&vvs->rx_lock); + if (free_pkt) + kfree_skb(skb); ++ ++ return can_enqueue; + } + + static int +@@ -1418,7 +1418,17 @@ virtio_transport_recv_connected(struct s + + switch (le16_to_cpu(hdr->op)) { + case VIRTIO_VSOCK_OP_RW: +- virtio_transport_recv_enqueue(vsk, skb); ++ if (!virtio_transport_recv_enqueue(vsk, skb)) { ++ /* There is no more space to queue the packet, so let's ++ * close the connection; otherwise, we'll lose data. ++ */ ++ (void)virtio_transport_reset(vsk, skb); ++ virtio_transport_do_close(vsk, true); ++ sk->sk_err = ENOBUFS; ++ sk_error_report(sk); ++ vsock_remove_sock(vsk); ++ break; ++ } + vsock_data_ready(sk); + return err; + case VIRTIO_VSOCK_OP_CREDIT_REQUEST: diff --git a/queue-6.12/vsock-vmci-fix-uaf-when-peer-resets-connection-during-handshake.patch b/queue-6.12/vsock-vmci-fix-uaf-when-peer-resets-connection-during-handshake.patch new file mode 100644 index 0000000000..ea1c32a8e6 --- /dev/null +++ b/queue-6.12/vsock-vmci-fix-uaf-when-peer-resets-connection-during-handshake.patch @@ -0,0 +1,64 @@ +From 99e22ddf4edb63dc8382bc028af928056d3450cf Mon Sep 17 00:00:00 2001 +From: Minh Nguyen +Date: Tue, 19 May 2026 17:23:10 +0700 +Subject: vsock/vmci: fix UAF when peer resets connection during handshake + +From: Minh Nguyen + +commit 99e22ddf4edb63dc8382bc028af928056d3450cf upstream. + +vmci_transport_recv_connecting_server() returned err = 0 for a peer +RST in its default switch arm: + + err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL; + +That made vmci_transport_recv_listen() skip vsock_remove_pending(), +leaving the pending socket on the listener's pending_links with +sk_state = TCP_CLOSE while destroy: still dropped the explicit +reference taken before schedule_delayed_work(). + +One second later vsock_pending_work() observed is_pending=true and +performed full cleanup: vsock_remove_pending() then the two trailing +sock_put(sk) calls -- the first reached refcount 0 and __sk_freed +the socket, and the second wrote into the freed object: + + BUG: KASAN: slab-use-after-free in refcount_warn_saturate + Write of size 4 at addr ffff88800b1cac80 by task kworker + Workqueue: events vsock_pending_work + +Treat peer RST like any other unexpected packet type (err = -EINVAL). +All destroy: arms now return err < 0, so vmci_transport_recv_listen() +removes pending from pending_links synchronously and +vsock_pending_work() takes the is_pending=false / !rejected branch, +dropping only its own work reference. This also closes the +multi-packet race Sashiko reported on v2: pending is removed from +the list before any subsequent packet can find it. + +The pre-existing sk_acceptq_removed() gap on the err < 0 path of +vmci_transport_recv_listen() that Sashiko also noted is not +introduced or changed by this patch. + +Tested on lts-6.12.79 with KASAN: 52/100 unpatched -> 0/100 patched. + +Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") +Cc: stable@vger.kernel.org +Signed-off-by: Minh Nguyen +Acked-by: Bryan Tan +Link: https://patch.msgid.link/20260519102310.237181-1-minhnguyen.080505@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/vmw_vsock/vmci_transport.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/vmw_vsock/vmci_transport.c ++++ b/net/vmw_vsock/vmci_transport.c +@@ -1156,7 +1156,7 @@ vmci_transport_recv_connecting_server(st + /* Close and cleanup the connection. */ + vmci_transport_send_reset(pending, pkt); + skerr = EPROTO; +- err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL; ++ err = -EINVAL; + goto destroy; + } + diff --git a/queue-6.12/wifi-ath11k-clear-shared-srng-pointer-state-on-restart.patch b/queue-6.12/wifi-ath11k-clear-shared-srng-pointer-state-on-restart.patch new file mode 100644 index 0000000000..40bd98209c --- /dev/null +++ b/queue-6.12/wifi-ath11k-clear-shared-srng-pointer-state-on-restart.patch @@ -0,0 +1,60 @@ +From f51e4b3b5574ad8cb5b16b11f8a1452147ece87a Mon Sep 17 00:00:00 2001 +From: Kyle Farnung +Date: Wed, 13 May 2026 21:52:12 -0700 +Subject: wifi: ath11k: clear shared SRNG pointer state on restart + +From: Kyle Farnung + +commit f51e4b3b5574ad8cb5b16b11f8a1452147ece87a upstream. + +LMAC rings reuse the shared rdp/wrp pointer buffers without going +through the normal SRNG hw-init path that zeros non-LMAC ring +pointers. After restart, ath11k_hal_srng_clear() can therefore hand +stale hp/tp state from the previous firmware instance back to the new +one. + +Clear the shared pointer buffers while keeping the allocations in +place so restart still avoids reallocating SRNG DMA memory, but starts +with fresh ring-pointer state. + +Fixes: 32be3ca4cf78b ("wifi: ath11k: HAL SRNG: don't deinitialize and re-initialize again") +Cc: stable@vger.kernel.org +Closes: https://lore.kernel.org/all/CAOPSVF04q6uvVdq8GTRLHBrVMdpt9=o9wVcFMc6f-yhmSBcZqQ@mail.gmail.com/ +Signed-off-by: Kyle Farnung +Reviewed-by: Rameshkumar Sundaram +Reviewed-by: Baochen Qiang +Link: https://patch.msgid.link/20260513-kfarnung-ath11k-srng-clear-pointer-state-v1-1-bc700dd8b333@gmail.com +Signed-off-by: Jeff Johnson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/ath/ath11k/hal.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -1385,14 +1385,22 @@ EXPORT_SYMBOL(ath11k_hal_srng_deinit); + + void ath11k_hal_srng_clear(struct ath11k_base *ab) + { +- /* No need to memset rdp and wrp memory since each individual +- * segment would get cleared in ath11k_hal_srng_src_hw_init() +- * and ath11k_hal_srng_dst_hw_init(). ++ /* ++ * Preserve the shared pointer buffers, but clear the previous ++ * firmware instance's hp/tp state before handing them back to FW. ++ * LMAC rings reuse this shared memory without going through the ++ * normal SRNG hw-init path that zeros non-LMAC ring pointers. + */ + memset(ab->hal.srng_list, 0, + sizeof(ab->hal.srng_list)); + memset(ab->hal.shadow_reg_addr, 0, + sizeof(ab->hal.shadow_reg_addr)); ++ if (ab->hal.rdp.vaddr) ++ memset(ab->hal.rdp.vaddr, 0, ++ sizeof(*ab->hal.rdp.vaddr) * HAL_SRNG_RING_ID_MAX); ++ if (ab->hal.wrp.vaddr) ++ memset(ab->hal.wrp.vaddr, 0, ++ sizeof(*ab->hal.wrp.vaddr) * HAL_SRNG_NUM_LMAC_RINGS); + ab->hal.avail_blk_resource = 0; + ab->hal.current_blk_index = 0; + ab->hal.num_shadow_reg_configured = 0; diff --git a/queue-6.12/wifi-cfg80211-advance-loop-vars-in-cfg80211_merge_profile.patch b/queue-6.12/wifi-cfg80211-advance-loop-vars-in-cfg80211_merge_profile.patch new file mode 100644 index 0000000000..f19ee650c3 --- /dev/null +++ b/queue-6.12/wifi-cfg80211-advance-loop-vars-in-cfg80211_merge_profile.patch @@ -0,0 +1,52 @@ +From 7666dbb1bacc4ba522b96740cba7283d243d16e1 Mon Sep 17 00:00:00 2001 +From: John Walker +Date: Thu, 7 May 2026 17:07:20 -0600 +Subject: wifi: cfg80211: advance loop vars in cfg80211_merge_profile() + +From: John Walker + +commit 7666dbb1bacc4ba522b96740cba7283d243d16e1 upstream. + +cfg80211_merge_profile() reassembles a Multi-BSSID non-transmitted BSS +profile that has been split across multiple consecutive MBSSID elements. +Its while-loop calls + + cfg80211_get_profile_continuation(ie, ielen, mbssid_elem, sub_elem) + +but never advances mbssid_elem or sub_elem inside the body. Each +iteration therefore searches for a continuation that follows the same +fixed pair; the helper returns the same next_mbssid; and the same +next_sub bytes are memcpy()'d into merged_ie at a growing offset until +the buffer fills. + +Advance both mbssid_elem and sub_elem to the just-consumed continuation +so the next call to cfg80211_get_profile_continuation() searches for a +further continuation beyond it (or returns NULL when none exists). + +A specially-crafted malicious beacon can take advantage of this bug +to cause the kernel to spend an excessive amount of time in +cfg80211_merge_profile (up to as much as 2ms per beacon received), +which could theoretically be abused in some way. + +Cc: stable@vger.kernel.org +Fixes: fe806e4992c9 ("cfg80211: support profile split between elements") +Signed-off-by: John Walker +Link: https://patch.msgid.link/20260507230720.64783-1-johnwalker0@gmail.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/wireless/scan.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/wireless/scan.c ++++ b/net/wireless/scan.c +@@ -2421,6 +2421,9 @@ size_t cfg80211_merge_profile(const u8 * + memcpy(merged_ie + copied_len, next_sub->data, + next_sub->datalen); + copied_len += next_sub->datalen; ++ ++ mbssid_elem = next_mbssid; ++ sub_elem = next_sub; + } + + return copied_len; diff --git a/queue-6.12/wifi-mac80211-consume-only-present-negotiated-ttlm-maps.patch b/queue-6.12/wifi-mac80211-consume-only-present-negotiated-ttlm-maps.patch new file mode 100644 index 0000000000..48d0d4b4b2 --- /dev/null +++ b/queue-6.12/wifi-mac80211-consume-only-present-negotiated-ttlm-maps.patch @@ -0,0 +1,56 @@ +From a6e6ccd5bd07155c2add6c74ce1a5e68ad3b95ea Mon Sep 17 00:00:00 2001 +From: Michael Bommarito +Date: Fri, 15 May 2026 11:17:18 -0400 +Subject: wifi: mac80211: consume only present negotiated TTLM maps + +From: Michael Bommarito + +commit a6e6ccd5bd07155c2add6c74ce1a5e68ad3b95ea upstream. + +ieee80211_tid_to_link_map_size_ok() validates negotiated TTLM elements +against the number of link-map entries indicated by link_map_presence. +ieee80211_parse_neg_ttlm() must consume the same layout. + +The parser advanced its cursor for every TID, including TIDs whose +presence bit is clear and therefore have no map bytes in the element. +A sparse map can then make a later present TID read past the validated +element. + +The bad bytes land in neg_ttlm->{up,down}link[tid] but are gated by +valid_links before being applied to driver state, so a peer cannot +turn the read into a policy change. Under KUnit + KASAN with an +exact-sized element allocation the OOB read is reported as a +slab-out-of-bounds; whether the same trigger fires under the +production RX path depends on surrounding allocator state. + +Advance the cursor only when the current TID has a map present. + +Fixes: 8f500fbc6c65 ("wifi: mac80211: process and save negotiated TID to Link mapping request") +Cc: stable@vger.kernel.org +Assisted-by: Claude:claude-opus-4-7 +Signed-off-by: Michael Bommarito +Link: https://patch.msgid.link/20260515151719.1317659-2-michael.bommarito@gmail.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/mlme.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -7290,6 +7290,7 @@ ieee80211_parse_neg_ttlm(struct ieee8021 + "No active links for TID %d", tid); + return -EINVAL; + } ++ pos += map_size; + } else { + map = 0; + } +@@ -7308,7 +7309,6 @@ ieee80211_parse_neg_ttlm(struct ieee8021 + default: + return -EINVAL; + } +- pos += map_size; + } + return 0; + }