[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/57] hw/virtio: Acquire RCU read lock in virtqueue_packed_drop_a
From: |
Michael S. Tsirkin |
Subject: |
[PULL 01/57] hw/virtio: Acquire RCU read lock in virtqueue_packed_drop_all() |
Date: |
Tue, 5 Oct 2021 12:00:45 -0400 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
vring_get_region_caches() must be called with the RCU read lock
acquired. virtqueue_packed_drop_all() does not, and uses the
'caches' pointer. Fix that by using the RCU_READ_LOCK_GUARD()
macro.
Reported-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210906104318.1569967-3-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
---
hw/virtio/virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 240759ff0b..dd0ab433b8 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1703,6 +1703,8 @@ static unsigned int virtqueue_packed_drop_all(VirtQueue
*vq)
VirtIODevice *vdev = vq->vdev;
VRingPackedDesc desc;
+ RCU_READ_LOCK_GUARD();
+
caches = vring_get_region_caches(vq);
if (!caches) {
return 0;
--
MST
- [PULL 29/57] acpi: build_tpm_tcpa: use acpi_table_begin()/acpi_table_end() instead of build_header(), (continued)
- [PULL 29/57] acpi: build_tpm_tcpa: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 32/57] acpi: build_dmar_q35: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 34/57] acpi: build_amd_iommu: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 36/57] acpi: x86: remove dead code, Michael S. Tsirkin, 2021/10/05
- [PULL 37/57] acpi: x86: set enabled when composing _MAT entries, Michael S. Tsirkin, 2021/10/05
- [PULL 35/57] acpi: madt: arm/x86: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 38/57] acpi: x86: madt: use build_append_int_noprefix() API to compose MADT table, Michael S. Tsirkin, 2021/10/05
- [PULL 39/57] acpi: arm/virt: madt: use build_append_int_noprefix() API to compose MADT table, Michael S. Tsirkin, 2021/10/05
- [PULL 40/57] acpi: build_dsdt_microvm: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 42/57] acpi: arm: virt: build_iort: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 01/57] hw/virtio: Acquire RCU read lock in virtqueue_packed_drop_all(),
Michael S. Tsirkin <=
- [PULL 44/57] acpi: arm/virt: build_spcr: fix invalid cast, Michael S. Tsirkin, 2021/10/05
- [PULL 41/57] acpi: arm: virt: build_dsdt: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 43/57] acpi: arm/virt: convert build_iort() to endian agnostic build_append_FOO() API, Michael S. Tsirkin, 2021/10/05
- [PULL 46/57] acpi: arm/virt: build_gtdt: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 47/57] acpi: build_facs: use build_append_int_noprefix() API to compose table, Michael S. Tsirkin, 2021/10/05
- [PULL 50/57] bios-tables-test: allow changes in DSDT ACPI tables for q35, Michael S. Tsirkin, 2021/10/05
- [PULL 06/57] vhost-vdpa: let net_vhost_vdpa_init() returns NetClientState *, Michael S. Tsirkin, 2021/10/05
- [PULL 48/57] acpi: remove no longer used build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 45/57] acpi: arm/virt: build_spcr: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 49/57] acpi: AcpiGenericAddress no longer used to map/access fields of MMIO, drop packed attribute, Michael S. Tsirkin, 2021/10/05