CVE-2026-143400: virtio_net: check RX buffer length before DMA sync
In the Linux kernel, the following vulnerability has been resolved:
virtionet: check RX buffer length before DMA sync
An RX queue that uses the DMA API (rq->usepagepooldma, for example with VIRTIOFACCESSPLATFORM) syncs each received buffer with pagepooldmasyncforcpu() using the length the device wrote to the used ring, and checks that length against the posted buffer only after the sync.
With SWIOTLB bouncing (swiotlb=force, or a confidential-computing guest), the sync copies from the shared bounce buffer into the guest's private page, so an oversized length also copies the bytes the device wrote past the posted buffer over the neighbouring page pool fragments. The later check drops the packet, but the copy has already happened. A malicious device, such as a host the confidential guest does not trust, can overwrite guest kernel memory next to an RX buffer with bytes it chooses, which is enough to take an unprivileged guest process to root.
Check the length before the sync in the per-fragment loops. receivebuf() has to sync the header before the length check, because the mergeable error path reads numbuffers from it, so limit that sync to the posted length. A device that reports correct lengths sees no change.
The driver has synced with the device's length since commit 295525e29a5b ("virtionet: merge dma operations when filling mergeable buffers"), at first in virtnetrqunmap(). Commit 24fbd3967f3f ("virtionet: add pagepool support for buffer allocation") moved the sync to the pagepool call sites that this patch changes, so the patch applies to v7.1 and later. Older kernels need a separate backport that limits the sync in virtnetrqunmap().
Found by an LLM code review agent auditing users of the DMA API; the fix and this changelog were also written with an LLM coding assistant and reviewed by us. Reproduced in QEMU with swiotlb=force and iommuplatform=on, a test-only device change that reports a used length 64 bytes past the posted buffer and writes a marker there, and a guest kprobe module that reads the buffer after the sync: without this patch the marker reaches the guest page for small and mergeable buffers; with it the packets are dropped and counted in rxlengtherrors. The virtionet selftest basicfeatures.sh passes with and without mergeable buffers.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 24fbd3967f3f
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Affected systems are Linux guests using virtio-net receive queues with DMA API support, such as configurations using VIRTIO_F_ACCESS_PLATFORM. Exposure is particularly relevant when SWIOTLB bouncing is in use, including with swiotlb=force or in confidential-computing guests.
What does an attacker need to exploit it?
An attacker needs control of a malicious virtio network device, such as an untrusted host providing the device to a confidential guest. The device can report an oversized received-buffer length and cause chosen data to be copied into adjacent guest kernel memory.
Is an oversized packet simply dropped safely?
No. The original length validation occurs after DMA synchronization, so the packet is later dropped but the out-of-bounds copy may already have overwritten neighboring page-pool fragments.
What is the potential impact inside an affected guest?
A malicious device can overwrite guest kernel memory adjacent to an RX buffer with attacker-chosen bytes. The provided information states this can be sufficient to escalate an unprivileged guest process to root.