From: sashiko-bot@kernel.org
To: "Vladimir Petrzhikovskii" <vladimir@dfb.sh>
Cc: virtualization@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH 6.6.y] virtio_net: check RX buffer length before DMA sync
Date: Fri, 20 Nov 2026 14:54:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-225412@kernel.org> (raw)
In-Reply-To: <20261120144828.1573321-1-vladimir@dfb.sh>
> [ Upstream commit 29dfa436bc488056a84ee423ba82336db453e2a6 ]
>
> An RX queue that uses the DMA API (rq->use_page_pool_dma, for example
> with VIRTIO_F_ACCESS_PLATFORM) syncs each received buffer with
> page_pool_dma_sync_for_cpu() 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
> [ ... ]
> existing checks then drop the packet. Tested with the reproducer
> described above: without this patch the marker reaches the guest page
> for small and mergeable buffers; with it the sync stops at the posted
> length and the packets are counted in rx_length_errors. ]
> Signed-off-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120144828.1573321-1-vladimir@dfb.sh?part=1
prev parent reply other threads:[~2026-11-20 14:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 14:48 [PATCH 6.6.y] virtio_net: check RX buffer length before DMA sync Vladimir Petrzhikovskii
2026-11-20 14:54 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-225412@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eperezma@redhat.com \
--cc=mst@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=virtualization@lists.linux.dev \
--cc=vladimir@dfb.sh \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox