]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: correctly copy vnet header when flushing TX
authorJason Wang <jasowang@redhat.com>
Tue, 2 Jan 2024 03:29:01 +0000 (11:29 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 26 Jan 2024 13:20:07 +0000 (16:20 +0300)
commit415f21c723320af3f694efffb6fc47484cc03fb0
tree60578690b87b4b0218159bf13cfcf7a10e9edab4
parent06e11b7589bb6a0d8a004949e829bebcd7a00ec5
virtio-net: correctly copy vnet header when flushing TX

When HASH_REPORT is negotiated, the guest_hdr_len might be larger than
the size of the mergeable rx buffer header. Using
virtio_net_hdr_mrg_rxbuf during the header swap might lead a stack
overflow in this case. Fixing this by using virtio_net_hdr_v1_hash
instead.

Reported-by: Xiao Lei <leixiao.nop@zju.edu.cn>
Cc: Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: qemu-stable@nongnu.org
Cc: Mauro Matteo Cascella <mcascell@redhat.com>
Fixes: CVE-2023-6693
Fixes: e22f0603fb2f ("virtio-net: reference implementation of hash report")
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 2220e8189fb94068dbad333228659fbac819abb0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/virtio-net.c