CVE-2026-74560: xsk: fix buffer leak in xsk_drop_skb() for AF_XDP multi-buffer Tx
In the Linux kernel, the following vulnerability has been resolved:
xsk: fix buffer leak in xskdropskb() for AFXDP multi-buffer Tx
This patch is inspired by the check[1] from sashiko. It says when overflow happens, the address of cq to be published is invalid. Actually the severer thing is the whole process of publishing the address of cq in this particular case is not right: it should truely publish the address and advance the cachedprod in cq as long as it reads descriptors from txq.
The following is the full analysis. xskdropskb() is called in three places, which all discard a partially built multi-buffer skb: 1) xskbuildskb() -EOVERFLOW error path: packet exceeds MAXSKBFRAGS 2) xskgenericxmit() post-loop cleanup: an invalid descriptor in the TX ring prevents the partial packet from completing 3) xskrelease(): socket close while xs->skb holds an incomplete packet
In all three cases, the TX descriptors for the already-processed frags have been consumed from the TX ring (xskqconsrelease), and CQ slots have been reserved. However, xskdropskb() calls xskconsumeskb() which cancels the CQ reservations via xskcqcancellocked(). Since the buffer addresses never appear in the completion queue, userspace permanently loses track of these buffers.
Fix this by letting consumeskb() trigger the existing xskdestructskb destructor, which already submits buffer addresses to the CQ via xskcqsubmitaddrlocked().
Note that cancelling the descriptors back to the TX ring (via xskqconscanceln) is not a appropriate option because an oversized packet that always exceeds MAXSKBFRAGS would be retried indefinitely, which is an obviously deadlock bug in the TX path.
Also move the desc->addr assignment in xskbuildskb() above the overflow check so that the current descriptor's address is recorded before a potential -EOVERFLOW jump to freeerr, consistent with the zerocopy path in xskbuildskbzerocopy().
[1]: https://lore.kernel.org/all/20260425041726.85FB3C2BCB2@smtp.kernel.org/
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Apply the kernel vulnerability fix titled "xsk: fix buffer leak in xsk_drop_skb() for AF_XDP multi-buffer Tx" so that, in the EOVERFLOW path of xsk_build_skb() and the post-loop cleanup in __xsk_generic_xmit(), freeing/discarding a partially built multi-buffer skb triggers the existing xsk_destruct_skb() via consume_skb(). This prevents TX descriptors for already-processed frags from leaking/loss of completion tracking when the packet is oversized (exceeds MAX_SKB_FRAGS).
Linux kernel (AF_XDP/XDP xsk) Fix buffer leak in xsk_drop_skb() for AF_XDP multi-buffer Tx = Apply the referenced kernel patch
Event History
Frequently Asked Questions
What is the severity of CVE-2026-74560?
CVE-2026-74560 has a risk rating of 37, indicating a moderate severity level.
What is the nature of the vulnerability in CVE-2026-74560?
CVE-2026-74560 involves a buffer leak in the xsk_drop_skb() function affecting multi-buffer transmission for AF_XDP in the Linux kernel.
How do I fix CVE-2026-74560?
To address CVE-2026-74560, apply the latest kernel patch provided by the Linux kernel maintainers.
Which kernel versions are affected by CVE-2026-74560?
CVE-2026-74560 affects certain versions of the Linux kernel that handle AF_XDP multi-buffer Tx.
What can be the impact of exploiting CVE-2026-74560?
Exploiting CVE-2026-74560 may lead to memory issues due to buffer leaks, potentially compromising system stability.