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/
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
Modify xsk_drop_skb() so consume_skb() triggers the existing xsk_destruct_skb destructor, allowing already-processed TX buffer addresses to be submitted to the completion queue via xsk_cq_submit_addr_locked(); publish the CQ address and advance cached_prod for descriptors consumed from the TX ring instead of cancelling the CQ reservations.
- Compensating control
Move the desc->addr assignment in xsk_build_skb() above the MAX_SKB_FRAGS overflow check so the current descriptor address is recorded before a potential -EOVERFLOW jump to free_err.
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.