{"id":"CVE-2025-40159","state":"PUBLISHED","title":"xsk: Harden userspace-supplied xdp_desc validation","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nxsk: Harden userspace-supplied xdp_desc validation\n\nTurned out certain clearly invalid values passed in xdp_desc from\nuserspace can pass xp_{,un}aligned_validate_desc() and then lead\nto UBs or just invalid frames to be queued for xmit.\n\ndesc->len close to ``U32_MAX`` with a non-zero pool->tx_metadata_len\ncan cause positive integer overflow and wraparound, the same way low\nenough desc->addr with a non-zero pool->tx_metadata_len can cause\nnegative integer overflow. Both scenarios can then pass the\nvalidation successfully.\nThis doesn't happen with valid XSk applications, but can be used\nto perform attacks.\n\nAlways promote desc->len to ``u64`` first to exclude positive\noverflows of it. Use explicit check_{add,sub}_overflow() when\nvalidating desc->addr (which is ``u64`` already).\n\nbloat-o-meter reports a little growth of the code size:\n\nadd/remove: 0/0 grow/shrink: 2/1 up/down: 60/-16 (44)\nFunction                                     old     new   delta\nxskq_cons_peek_desc                          299     330     +31\nxsk_tx_peek_release_desc_batch               973    1002     +29\nxsk_generic_xmit                            3148    3132     -16\n\nbut hopefully this doesn't hurt the performance much.","publishedAt":"2025-11-12T10:24:36.104Z","updatedAt":"2026-10-15T22:02:39.041Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"1463cd066f32efd56ddfd3ac4e3524200f362980","versionType":"git"},{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"5b5fffa7c81e55d8c8edf05ad40d811ec7047e21","versionType":"git"},{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"07ca98f906a403637fc5e513a872a50ef1247f3b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xdp/xsk_queue.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.54","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.4","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xdp/xsk_queue.h"]}],"references":["https://git.kernel.org/stable/c/1463cd066f32efd56ddfd3ac4e3524200f362980","https://git.kernel.org/stable/c/5b5fffa7c81e55d8c8edf05ad40d811ec7047e21","https://git.kernel.org/stable/c/07ca98f906a403637fc5e513a872a50ef1247f3b"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40159.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40159","state":"PUBLISHED","datePublished":"2025-11-12T10:24:36.104Z","dateUpdated":"2026-10-15T22:02:39.041Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.176Z"},"containers":{"cna":{"title":"xsk: Harden userspace-supplied xdp_desc validation","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxsk: Harden userspace-supplied xdp_desc validation\n\nTurned out certain clearly invalid values passed in xdp_desc from\nuserspace can pass xp_{,un}aligned_validate_desc() and then lead\nto UBs or just invalid frames to be queued for xmit.\n\ndesc->len close to ``U32_MAX`` with a non-zero pool->tx_metadata_len\ncan cause positive integer overflow and wraparound, the same way low\nenough desc->addr with a non-zero pool->tx_metadata_len can cause\nnegative integer overflow. Both scenarios can then pass the\nvalidation successfully.\nThis doesn't happen with valid XSk applications, but can be used\nto perform attacks.\n\nAlways promote desc->len to ``u64`` first to exclude positive\noverflows of it. Use explicit check_{add,sub}_overflow() when\nvalidating desc->addr (which is ``u64`` already).\n\nbloat-o-meter reports a little growth of the code size:\n\nadd/remove: 0/0 grow/shrink: 2/1 up/down: 60/-16 (44)\nFunction                                     old     new   delta\nxskq_cons_peek_desc                          299     330     +31\nxsk_tx_peek_release_desc_batch               973    1002     +29\nxsk_generic_xmit                            3148    3132     -16\n\nbut hopefully this doesn't hurt the performance much."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"1463cd066f32efd56ddfd3ac4e3524200f362980","versionType":"git"},{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"5b5fffa7c81e55d8c8edf05ad40d811ec7047e21","versionType":"git"},{"version":"341ac980eab90ac1f6c22ee9f9da83ed9604d899","status":"affected","lessThan":"07ca98f906a403637fc5e513a872a50ef1247f3b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xdp/xsk_queue.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.54","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.4","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/xdp/xsk_queue.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/1463cd066f32efd56ddfd3ac4e3524200f362980"},{"url":"https://git.kernel.org/stable/c/5b5fffa7c81e55d8c8edf05ad40d811ec7047e21"},{"url":"https://git.kernel.org/stable/c/07ca98f906a403637fc5e513a872a50ef1247f3b"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The malicious xdp_desc values are written by a local process into its own mmap'd AF_XDP TX ring and triggered via sendto()/sendmsg(); this is a local syscall interface, not remote network data processing.\nAC:L - The attacker fully controls desc->addr, desc->len, desc->options, and pool->tx_metadata_len, so the overflow is triggered deterministically with no race or external condition.\nPR:L - AF_XDP socket creation only requires CAP_NET_RAW in the socket's user namespace, which an unprivileged user obtains via `unshare -Urn`; no real root is needed.\nUI:N - The attacking process performs socket setup, descriptor crafting, and transmission entirely on its own; no other user's interaction is required.\nS:U - The overflow corrupts kernel memory within the same kernel security authority; there is no crossing of a VM/IOMMU/sandbox boundary.\nC:H - The bypassed length validation causes an out-of-bounds read of up to ~4GB from kernel memory adjacent to the umem buffer, which is copied into transmitted skb data — an arbitrary kernel memory disclosure primitive.\nI:H - The invalid len/addr drive get_page() on arbitrary \"struct page\" pointers past the pages array and queue corrupted frames, providing a heap/memory-corruption primitive exploitable beyond a mere crash.\nA:H - Out-of-bounds access to the pages array and refcounting of garbage pointers reliably oops/panics the kernel."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:08:09.151Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.54"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.17.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-40159","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-15T21:57:23.652232Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T22:02:39.041Z"}}]}}}