[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/78] virtio-blk: fix out-of-bounds access to bitmap in notify_g
From: |
Michael Roth |
Subject: |
[PATCH 07/78] virtio-blk: fix out-of-bounds access to bitmap in notify_guest_bh |
Date: |
Tue, 16 Jun 2020 09:14:36 -0500 |
From: Li Hangjing <lihangjing@baidu.com>
When the number of a virtio-blk device's virtqueues is larger than
BITS_PER_LONG, the out-of-bounds access to bitmap[ ] will occur.
Fixes: e21737ab15 ("virtio-blk: multiqueue batch notify")
Cc: qemu-stable@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Li Hangjing <lihangjing@baidu.com>
Reviewed-by: Xie Yongji <xieyongji@baidu.com>
Reviewed-by: Chai Wen <chaiwen@baidu.com>
Message-id: 20191216023050.48620-1-lihangjing@baidu.com
Message-Id: <20191216023050.48620-1-lihangjing@baidu.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 725fe5d10dbd4259b1853b7d253cef83a3c0d22a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/block/dataplane/virtio-blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 119906a5fe..1b52e8159c 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -67,7 +67,7 @@ static void notify_guest_bh(void *opaque)
memset(s->batch_notify_vqs, 0, sizeof(bitmap));
for (j = 0; j < nvqs; j += BITS_PER_LONG) {
- unsigned long bits = bitmap[j];
+ unsigned long bits = bitmap[j / BITS_PER_LONG];
while (bits != 0) {
unsigned i = j + ctzl(bits);
--
2.17.1
- Re: [PATCH 72/78] 9p: Lock directory streams with a CoMutex, (continued)
[PATCH 73/78] net: Do not include a newline in the id of -nic devices, Michael Roth, 2020/06/16
[PATCH 75/78] virtio-balloon: fix free page hinting without an iothread, Michael Roth, 2020/06/16
[PATCH 76/78] virtio-balloon: fix free page hinting check on unrealize, Michael Roth, 2020/06/16
[PATCH 74/78] nbd/server: Avoid long error message assertions CVE-2020-10761, Michael Roth, 2020/06/16
[PATCH 77/78] virtio-balloon: unref the iothread when unrealizing, Michael Roth, 2020/06/16
[PATCH 78/78] block: Call attention to truncation of long NBD exports, Michael Roth, 2020/06/16
[PATCH 07/78] virtio-blk: fix out-of-bounds access to bitmap in notify_guest_bh,
Michael Roth <=
[PATCH 08/78] numa: remove not needed check, Michael Roth, 2020/06/16
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Cole Robinson, 2020/06/17
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Liam Merwick, 2020/06/17
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Karl Heubaum, 2020/06/17
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Finn Thain, 2020/06/19
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Bruce Rogers, 2020/06/20
Re: [PATCH 00/78] Patch Round-up for stable 4.2.1, freeze on 2020-06-22, Michael Roth, 2020/06/22