{"id":"CVE-2025-21954","state":"PUBLISHED","title":"netmem: prevent TX of unreadable skbs","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetmem: prevent TX of unreadable skbs\n\nCurrently on stable trees we have support for netmem/devmem RX but not\nTX. It is not safe to forward/redirect an RX unreadable netmem packet\ninto the device's TX path, as the device may call dma-mapping APIs on\ndma addrs that should not be passed to it.\n\nFix this by preventing the xmit of unreadable skbs.\n\nTested by configuring tc redirect:\n\nsudo tc qdisc add dev eth1 ingress\nsudo tc filter add dev eth1 ingress protocol ip prio 1 flower ip_proto \\\n\ttcp src_ip 192.168.1.12 action mirred egress redirect dev eth1\n\nBefore, I see unreadable skbs in the driver's TX path passed to dma\nmapping APIs.\n\nAfter, I don't see unreadable skbs in the driver's TX path passed to dma\nmapping APIs.","publishedAt":"2025-04-01T15:46:55.226Z","updatedAt":"2026-08-05T11:55:34.681Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/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":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"454825019d2f0c59e5174ece9e713f45ad80beff","versionType":"git"},{"version":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"1c17c8ced25c5fbe424c7ad7ea11d33014a986b1","versionType":"git"},{"version":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"f3600c867c99a2cc8038680ecf211089c50e7971","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/dev.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/dev.c"]}],"references":["https://git.kernel.org/stable/c/454825019d2f0c59e5174ece9e713f45ad80beff","https://git.kernel.org/stable/c/1c17c8ced25c5fbe424c7ad7ea11d33014a986b1","https://git.kernel.org/stable/c/f3600c867c99a2cc8038680ecf211089c50e7971"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21954.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21954","state":"PUBLISHED","datePublished":"2025-04-01T15:46:55.226Z","dateUpdated":"2026-08-05T11:55:34.681Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.790Z"},"containers":{"cna":{"title":"netmem: prevent TX of unreadable skbs","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetmem: prevent TX of unreadable skbs\n\nCurrently on stable trees we have support for netmem/devmem RX but not\nTX. It is not safe to forward/redirect an RX unreadable netmem packet\ninto the device's TX path, as the device may call dma-mapping APIs on\ndma addrs that should not be passed to it.\n\nFix this by preventing the xmit of unreadable skbs.\n\nTested by configuring tc redirect:\n\nsudo tc qdisc add dev eth1 ingress\nsudo tc filter add dev eth1 ingress protocol ip prio 1 flower ip_proto \\\n\ttcp src_ip 192.168.1.12 action mirred egress redirect dev eth1\n\nBefore, I see unreadable skbs in the driver's TX path passed to dma\nmapping APIs.\n\nAfter, I don't see unreadable skbs in the driver's TX path passed to dma\nmapping APIs."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"454825019d2f0c59e5174ece9e713f45ad80beff","versionType":"git"},{"version":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"1c17c8ced25c5fbe424c7ad7ea11d33014a986b1","versionType":"git"},{"version":"65249feb6b3df9e17bab5911ee56fa7b0971e231","status":"affected","lessThan":"f3600c867c99a2cc8038680ecf211089c50e7971","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/dev.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/core/dev.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/454825019d2f0c59e5174ece9e713f45ad80beff"},{"url":"https://git.kernel.org/stable/c/1c17c8ced25c5fbe424c7ad7ea11d33014a986b1"},{"url":"https://git.kernel.org/stable/c/f3600c867c99a2cc8038680ecf211089c50e7971"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The unreadable skb is created by the RX path from a packet sent by a remote peer into a dmabuf-bound RX queue, and the bug fires when that received packet is forwarded/bridged/redirected to egress (`ip_forward`/`br_forward`/`act_mirred` → `dev_queue_xmit` → `validate_xmit_skb`). The attacker's only action is transmitting network traffic to the host.\nAC:L - On a host in the affected configuration the trigger is fully deterministic — every forwarded devmem skb reaches `skb_frag_dma_map()` with a NULL page; there is no race window, timing dependency, or memory-layout requirement the attacker must win. `CONFIG_NET_DEVMEM` is `def_bool y`, and per CVSS the vulnerable runtime configuration is assumed rather than charged to complexity.\nPR:N - The remote sender needs no account, credential, or privilege on the target; ordinary unauthenticated packets landing on the devmem-bound queue and being forwarded are sufficient. The CAP_NET_ADMIN-gated `NETDEV_CMD_BIND_RX` is pre-existing admin setup, not something the attacker must perform.\nUI:N - No victim action is required — packet reception and kernel forwarding happen autonomously in softirq context. The devmem binding and forwarding/redirect rules are pre-existing system state, not an interaction solicited from a user.\nS:U - The bogus DMA mapping is programmed by the kernel itself and all consequences (crash, DMA fault, unintended memory access) land within the same host kernel's security authority. No guest/host, IOMMU-enforcement, or sandbox boundary is escaped by the vulnerability itself.\nC:H - The NIC is handed a DMA address derived from a NULL `struct page` that bears no relation to the intended buffer, so on the TX (device-read) path host memory outside any granted buffer can be fetched by the device and transmitted on the wire to the remote peer; the swiotlb path additionally `memcpy`s from `phys_to_virt()` of that garbage address into a bounce buffer that is then sent out.\nI:H - This is a DMA memory-safety violation: the kernel installs a mapping (and on IOMMU systems an active IOVA translation) for a physical range it never owned, and the subsequent `dma_sync`/`dma_unmap` and cache-maintenance operations act on that arbitrary physical range, so memory outside the intended buffer can be modified. Such device-DMA corruption is leveragable well beyond a simple crash.\nA:H - Outcomes include a kernel NULL dereference (`is_pci_p2pdma_page(NULL)`/`swiotlb_bounce()` on confidential-VM and bounce-buffer configurations), DMAR/AER fault storms and TX-ring wedging when the device aborts on the invalid address, and device reset or panic on platforms that escalate the PCIe error — all repeatable at will by continuing to send traffic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:55:34.681Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.12.20"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.13.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}