]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:04 +0000 (16:03 +0200)
commit80b971be4c37a4d23a7f1abc5ff33dc7733d649b
treee592ac117b3db4e0b17962939622a27eba63a849
parent39617dc3fafefc0fed154a2d84cda54a6d328419
virtio-net: ensure the received length does not exceed allocated size

commit 315dbdd7cdf6aa533829774caaf4d25f1fd20e73 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/virtio_net.c