[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/29] block/iscsi: fix memory corruption on iscsi re
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 23/29] block/iscsi: fix memory corruption on iscsi resize |
Date: |
Fri, 22 Aug 2014 16:51:47 +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: Kevin Wolf <address@hidden>
---
block/iscsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index cdd19c2..3e19202 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 13/29] block: acquire AioContext in qmp_block_resize(), (continued)
- [Qemu-devel] [PULL 13/29] block: acquire AioContext in qmp_block_resize(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 15/29] virtio-blk: fix reference a pointer which might be freed, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 17/29] blkdebug: Implement bdrv_refresh_filename(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 16/29] block: Add bdrv_refresh_filename(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 18/29] blkverify: Implement bdrv_refresh_filename(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 19/29] nbd: Implement bdrv_refresh_filename(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 21/29] iotests: Add test for image filename construction, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 22/29] block/vvfat.c: remove debugging code to reinit stderr if NULL, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 20/29] quorum: Implement bdrv_refresh_filename(), Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 24/29] raw-posix: fix O_DIRECT short reads, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 23/29] block/iscsi: fix memory corruption on iscsi resize,
Kevin Wolf <=
- [Qemu-devel] [PULL 25/29] qemu-iotests: add test case 101 for short file I/O, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 26/29] blkdebug: Delete BH in bdrv_aio_cancel, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 27/29] vmdk: Use bdrv_nb_sectors() where sectors, not bytes are wanted, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 28/29] qemu-img: Allow source cache mode specification, Kevin Wolf, 2014/08/22
- [Qemu-devel] [PULL 29/29] qemu-img: Allow cache mode specification for amend, Kevin Wolf, 2014/08/22
- Re: [Qemu-devel] [PULL 00/29] Block patches, Daniel H Barboza, 2014/08/22
- Re: [Qemu-devel] [PULL 00/29] Block patches, Peter Maydell, 2014/08/22