[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.11 46/59] hw/char/virtio-serial-bus: Protect from DMA re-ent
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.11 46/59] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs |
Date: |
Thu, 18 Apr 2024 23:02:06 +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-4-philmd@linaro.org>
(cherry picked from commit b4295bff25f7b50de1d9cc94a9c6effd40056bca)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index dd619f0731..1221fb7f15 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -985,8 +985,7 @@ static void virtser_port_device_realize(DeviceState *dev,
Error **errp)
return;
}
- port->bh = qemu_bh_new_guarded(flush_queued_data_bh, port,
- &dev->mem_reentrancy_guard);
+ port->bh = virtio_bh_new_guarded(dev, flush_queued_data_bh, port);
port->elem = NULL;
}
--
2.39.2
- [Stable-7.2.11 v2 00/59] Patch Round-up for stable 7.2.11, freeze on 2024-04-20, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 42/59] tcg/optimize: Do not attempt to constant fold neg_vec, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 46/59] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs,
Michael Tokarev <=
- [Stable-7.2.11 43/59] linux-user: Fix waitid return of siginfo_t and rusage, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 44/59] hw/virtio: Introduce virtio_bh_new_guarded() helper, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 50/59] hw/block/nand: Have blk_load() take unsigned offset and return boolean, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 53/59] backends/cryptodev: Do not abort for invalid session ID, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 48/59] qemu-options: Fix CXL Fixed Memory Window interleave-granularity typo, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 45/59] hw/display/virtio-gpu: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 47/59] hw/virtio/virtio-crypto: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 51/59] hw/block/nand: Fix out-of-bound access in NAND block buffer, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 52/59] hw/misc/applesmc: Fix memory leak in reset() handler, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 49/59] hw/block/nand: Factor nand_load_iolen() method out, Michael Tokarev, 2024/04/18