[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/8] block/iscsi: fix memory corruption on iscsi resi
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 3/8] block/iscsi: fix memory corruption on iscsi resize |
Date: |
Thu, 28 Aug 2014 16:13:20 +0200 |
From: Peter Lieven <address@hidden>
bs->total_sectors is not yet updated at this point. resulting
in memory corruption if the volume has grown and data is written
to the newly availble areas.
CC: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 2c9cfc1..0bde13d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1512,7 +1512,8 @@ static int iscsi_truncate(BlockDriverState *bs, int64_t
offset)
if (iscsilun->allocationmap != NULL) {
g_free(iscsilun->allocationmap);
iscsilun->allocationmap =
- bitmap_new(DIV_ROUND_UP(bs->total_sectors,
+ bitmap_new(DIV_ROUND_UP(sector_lun2qemu(iscsilun->num_blocks,
+ iscsilun),
iscsilun->cluster_sectors));
}
--
1.8.3.1
- [Qemu-devel] [PULL 0/8] SCSI and memory changes for 2014-08-28, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 3/8] block/iscsi: fix memory corruption on iscsi resize,
Paolo Bonzini <=
- [Qemu-devel] [PULL 1/8] block: Pass errp in blkconf_geometry, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 4/8] scsi-generic: remove superfluous DPRINTF avoid to break compiling, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 6/8] xen-hvm: Constify string, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 2/8] scsi-bus: Convert DeviceClass init to realize, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 7/8] xen: hvm: Abstract away memory region name ref, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 5/8] virtio-scsi: Report error if num_queues is 0 or too large, Paolo Bonzini, 2014/08/28
- [Qemu-devel] [PULL 8/8] memory: Lazy init name from QOM name as needed, Paolo Bonzini, 2014/08/28
- Re: [Qemu-devel] [PULL 0/8] SCSI and memory changes for 2014-08-28, Peter Maydell, 2014/08/28