diff options
author | Thomas Huth <thuth@redhat.com> | 2021-07-15 12:37:55 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2021-07-19 09:33:39 +0200 |
commit | 6a932c4ed8748b08c58cdba3fc9485d5549aacca (patch) | |
tree | 897423dd5a773b893183dec0bf696ccb4f3fbadf /hw | |
parent | 659eb157a55666bf379f5362238a86d855e262e2 (diff) | |
download | qemu-6a932c4ed8748b08c58cdba3fc9485d5549aacca.zip qemu-6a932c4ed8748b08c58cdba3fc9485d5549aacca.tar.gz qemu-6a932c4ed8748b08c58cdba3fc9485d5549aacca.tar.bz2 |
hw/net/vmxnet3: Do not abort if the guest is trying to use an invalid TX queue
QEMU should never abort just because the guest is doing something odd.
Let's simply log the error and ignore the bad transmit queue instead.
Buglink: https://bugs.launchpad.net/qemu/+bug/1926111
Message-Id: <20210715103755.1035566-1-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/vmxnet3.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index eff299f..f6bd8c5 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -23,6 +23,7 @@ #include "net/checksum.h" #include "sysemu/sysemu.h" #include "qemu/bswap.h" +#include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msix.h" #include "hw/pci/msi.h" @@ -1093,8 +1094,12 @@ vmxnet3_io_bar0_write(void *opaque, hwaddr addr, int tx_queue_idx = VMW_MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_TXPROD, VMXNET3_REG_ALIGN); - assert(tx_queue_idx <= s->txq_num); - vmxnet3_process_tx_queue(s, tx_queue_idx); + if (tx_queue_idx <= s->txq_num) { + vmxnet3_process_tx_queue(s, tx_queue_idx); + } else { + qemu_log_mask(LOG_GUEST_ERROR, "vmxnet3: Illegal TX queue %d/%d\n", + tx_queue_idx, s->txq_num); + } return; } |