[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 32/97] vhost: fix invalid downcast
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 32/97] vhost: fix invalid downcast |
Date: |
Mon, 1 Apr 2019 15:59:06 -0500 |
From: Yury Kotov <address@hidden>
virtio_queue_get_desc_addr returns 64-bit hwaddr while int is usually 32-bit.
If returned hwaddr is not equal to 0 but least-significant 32 bits are
equal to 0 then this code will not actually stop running queue.
Signed-off-by: Yury Kotov <address@hidden>
Acked-by: Jia He <address@hidden>
Cc: address@hidden
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit fa4ae4be15fb08b37bec35139688ef563311d0b9)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/vhost.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index d4cb5894a8..569c4053ea 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1073,10 +1073,8 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
.index = vhost_vq_index,
};
int r;
- int a;
- a = virtio_queue_get_desc_addr(vdev, idx);
- if (a == 0) {
+ if (virtio_queue_get_desc_addr(vdev, idx) == 0) {
/* Don't stop the virtqueue which might have not been started */
return;
}
--
2.17.1
- [Qemu-stable] [PATCH 79/97] linux-user: write(fd, NULL, 0) parity with linux's treatment of same, (continued)
- [Qemu-stable] [PATCH 79/97] linux-user: write(fd, NULL, 0) parity with linux's treatment of same, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 80/97] linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 82/97] exec.c: Don't reallocate IOMMUNotifiers that are in use, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 86/97] tpm: Make sure the locality received from backend is valid, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 07/97] target/arm: Fix offset for LD1R instructions, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 85/97] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 77/97] pc:piix4: Update smbus I/O space after a migration, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 96/97] usb-mtp: outlaw slashes in filenames, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 95/97] 9p: fix QEMU crash when renaming files, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 94/97] nvme: fix out-of-bounds access to the CMB, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 32/97] vhost: fix invalid downcast,
Michael Roth <=
- [Qemu-stable] [PATCH 57/97] migration: Stop postcopy fault thread before notifying, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 46/97] rtl8139: fix possible out of bound access, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 05/97] target/arm: Fix typo in helper_sve_ld1hss_r, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 41/97] block/rbd: Attempt to parse legacy filenames, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 55/97] intel_iommu: better handling of dmar state switch, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 93/97] qga: update docs with systemd suspend support info, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 97/97] usb-mtp: use O_NOFOLLOW and O_CLOEXEC., Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 39/97] clean up callback when del virtqueue, Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 51/97] block-backend: Set werror/rerror defaults in blk_new(), Michael Roth, 2019/04/01
- [Qemu-stable] [PATCH 40/97] block/rbd: pull out qemu_rbd_convert_options, Michael Roth, 2019/04/01