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: 4941d472 ("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> [ adapted virtqueue_get_buf() to virtqueue_get_buf_ctx() ] Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
Please register or sign in to comment