]> www.infradead.org Git - users/jedix/linux-maple.git/commit
virtio-net: ensure the received length does not exceed allocated size
authorBui Quang Minh <minhquangbui99@gmail.com>
Mon, 30 Jun 2025 14:42:10 +0000 (21:42 +0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 3 Jul 2025 08:56:55 +0000 (10:56 +0200)
commit315dbdd7cdf6aa533829774caaf4d25f1fd20e73
tree8a9bfc7c21657e2562812e73cc367fad131b6f6a
parentbd475eeaaf3cad1b183418fff7b19c9b1e3d1c4f
virtio-net: ensure the received length does not exceed allocated size

In xdp_linearize_page, when reading the following buffers from the ring,
we forget to check the received length with the true allocate size. This
can lead to an out-of-bound read. This commit adds that missing check.

Cc: <stable@vger.kernel.org>
Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set")
Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://patch.msgid.link/20250630144212.48471-2-minhquangbui99@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/virtio_net.c