]> 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, 7 Jul 2025 08:14:54 +0000 (04:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 13:59:51 +0000 (15:59 +0200)
commit6aca3dad2145e864dfe4d1060f45eb1bac75dd58
tree921e8c12e412c35bbbae7162c5bff85ce22338bf
parent100040bff22c0c324073a73850670caf91bfe65b
virtio-net: ensure the received length does not exceed allocated size

[ Upstream commit 315dbdd7cdf6aa533829774caaf4d25f1fd20e73 ]

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: Sasha Levin <sashal@kernel.org>
drivers/net/virtio_net.c