[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.3 099/116] hw/virtio/virtio-crypto: Protect from DMA re-entr
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.3 099/116] hw/virtio/virtio-crypto: Protect from DMA re-entrancy bugs |
Date: |
Thu, 18 Apr 2024 20:49:29 +0300 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Replace qemu_bh_new_guarded() by virtio_bh_new_guarded()
so the bus and device use the same guard. Otherwise the
DMA-reentrancy protection can be bypassed.
Fixes: CVE-2024-3446
Cc: qemu-stable@nongnu.org
Suggested-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20240409105537.18308-5-philmd@linaro.org>
(cherry picked from commit f4729ec39ad97a42ceaa7b5697f84f440ea6e5dc)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 0e2cc8d5a8..4aaced74be 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -1080,8 +1080,8 @@ static void virtio_crypto_device_realize(DeviceState
*dev, Error **errp)
vcrypto->vqs[i].dataq =
virtio_add_queue(vdev, 1024, virtio_crypto_handle_dataq_bh);
vcrypto->vqs[i].dataq_bh =
- qemu_bh_new_guarded(virtio_crypto_dataq_bh, &vcrypto->vqs[i],
- &dev->mem_reentrancy_guard);
+ virtio_bh_new_guarded(dev, virtio_crypto_dataq_bh,
+ &vcrypto->vqs[i]);
vcrypto->vqs[i].vcrypto = vcrypto;
}
--
2.39.2
- [Stable-8.2.3 089/116] linux-user: Fix waitid return of siginfo_t and rusage, (continued)
- [Stable-8.2.3 089/116] linux-user: Fix waitid return of siginfo_t and rusage, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 090/116] target/sh4: mac.w: memory accesses are 16-bit words, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 091/116] target/sh4: Merge mach and macl into a union, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 092/116] target/sh4: Fix mac.l with saturation enabled, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 093/116] target/sh4: Fix mac.w with saturation enabled, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 094/116] target/sh4: add missing CHECK_NOT_DELAY_SLOT, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 095/116] target/m68k: Map FPU exceptions to FPSR register, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 096/116] hw/virtio: Introduce virtio_bh_new_guarded() helper, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 097/116] hw/display/virtio-gpu: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 098/116] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 099/116] hw/virtio/virtio-crypto: Protect from DMA re-entrancy bugs,
Michael Tokarev <=
- [Stable-8.2.3 100/116] qemu-options: Fix CXL Fixed Memory Window interleave-granularity typo, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 101/116] hw/block/nand: Factor nand_load_iolen() method out, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 102/116] hw/block/nand: Have blk_load() take unsigned offset and return boolean, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 104/116] hw/misc/applesmc: Fix memory leak in reset() handler, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 103/116] hw/block/nand: Fix out-of-bound access in NAND block buffer, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 106/116] hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 105/116] backends/cryptodev: Do not abort for invalid session ID, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 107/116] hw/net/lan9118: Fix overflow in MIL TX FIFO, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 108/116] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set, Michael Tokarev, 2024/04/18
- [Stable-8.2.3 109/116] hw/net/net_tx_pkt: Fix overrun in update_sctp_checksum(), Michael Tokarev, 2024/04/18