]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/net/vmxnet3: Fix guest-triggerable assert()
authorThomas Huth <thuth@redhat.com>
Thu, 17 Aug 2023 12:56:00 +0000 (14:56 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 10 Sep 2023 16:40:11 +0000 (19:40 +0300)
commitc68b844d3376764240afdb3c55d451e4dac11004
tree7b2f4a4d74219c6a159abc9df3ad7a5cbe7be744
parent42edb4723afe4a94a7c8011fa7fe02c3846cdc7e
hw/net/vmxnet3: Fix guest-triggerable assert()

The assert() that checks for valid MTU sizes can be triggered by
the guest (e.g. with the reproducer code from the bug ticket
https://gitlab.com/qemu-project/qemu/-/issues/517 ). Let's avoid
this problem by simply logging the error and refusing to activate
the device instead.

Fixes: d05dcd94ae ("net: vmxnet3: validate configuration values during activate")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
[Mjt: change format specifier from %d to %u for uint32_t argument]
(cherry picked from commit 90a0778421acdf4ca903be64c8ed19378183c944)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/vmxnet3.c