]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: Fix size check in dhclient workaround
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Fri, 22 Nov 2024 05:03:08 +0000 (14:03 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 25 Nov 2024 18:17:21 +0000 (21:17 +0300)
commitacb39d8e6e4a9b76d991d0be9d9d9a9e43644902
tree1e2966084dac503516a42e69194fe7f634d99675
parentf33f326fbd41209fabaab2900fa23b95d2451184
virtio-net: Fix size check in dhclient workaround

work_around_broken_dhclient() accesses IP and UDP headers to detect
relevant packets and to calculate checksums, but it didn't check if
the packet has size sufficient to accommodate them, causing out-of-bound
access hazards. Fix this by correcting the size requirement.

Fixes: 1d41b0c1ec66 ("Work around dhclient brokenness")
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit a8575f7fb2f213e6690b23160b04271d47fdfaa8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/virtio-net.c