* [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
@ 2017-09-22 14:43 Vladimir Sementsov-Ogievskiy
2017-09-22 20:42 ` Eric Blake
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2017-09-22 14:43 UTC (permalink / raw)
To: kwolf, mreitz; +Cc: qemu-block, qemu-devel, den, vsementsov
Without initialization to zero dirty_bitmap field may be not zero
for a bitmap which should not be stored and
qcow2_store_persistent_dirty_bitmaps will erroneously call
store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/qcow2-bitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index e8d3bdbd6e..14f41d0427 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -602,7 +602,7 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
goto fail;
}
- bm = g_new(Qcow2Bitmap, 1);
+ bm = g_new0(Qcow2Bitmap, 1);
bm->table.offset = e->bitmap_table_offset;
bm->table.size = e->bitmap_table_size;
bm->flags = e->flags;
--
2.11.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
@ 2017-09-22 20:42 ` Eric Blake
2017-09-23 11:04 ` Vladimir Sementsov-Ogievskiy
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2017-09-22 20:42 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy, kwolf, mreitz
Cc: den, qemu-devel, qemu-block, qemu-stable
[-- Attachment #1: Type: text/plain, Size: 769 bytes --]
On 09/22/2017 09:43 AM, Vladimir Sementsov-Ogievskiy wrote:
> Without initialization to zero dirty_bitmap field may be not zero
> for a bitmap which should not be stored and
> qcow2_store_persistent_dirty_bitmaps will erroneously call
> store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
s/SYG/SIG/
Introduced in commit 5f72826e, therefore it impacts 2.10, so:
CC: qemu-stable@nongnu.org
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
2017-09-22 20:42 ` Eric Blake
@ 2017-09-23 11:04 ` Vladimir Sementsov-Ogievskiy
2017-09-25 9:36 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2017-09-23 11:04 UTC (permalink / raw)
To: kwolf, mreitz; +Cc: qemu-block, qemu-devel, den
22.09.2017 17:43, Vladimir Sementsov-Ogievskiy wrote:
> Without initialization to zero dirty_bitmap field may be not zero
> for a bitmap which should not be stored and
> qcow2_store_persistent_dirty_bitmaps will erroneously call
> store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
please fix it to SIGSEGV...
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index e8d3bdbd6e..14f41d0427 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -602,7 +602,7 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
> goto fail;
> }
>
> - bm = g_new(Qcow2Bitmap, 1);
> + bm = g_new0(Qcow2Bitmap, 1);
> bm->table.offset = e->bitmap_table_offset;
> bm->table.size = e->bitmap_table_size;
> bm->flags = e->flags;
--
Best regards,
Vladimir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
2017-09-22 20:42 ` Eric Blake
2017-09-23 11:04 ` Vladimir Sementsov-Ogievskiy
@ 2017-09-25 9:36 ` Stefan Hajnoczi
2017-09-25 20:50 ` [Qemu-devel] " Max Reitz
2017-09-25 20:53 ` Michael Roth
4 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2017-09-25 9:36 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy; +Cc: kwolf, mreitz, den, qemu-devel, qemu-block
On Fri, Sep 22, 2017 at 05:43:53PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Without initialization to zero dirty_bitmap field may be not zero
> for a bitmap which should not be stored and
> qcow2_store_persistent_dirty_bitmaps will erroneously call
> store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
` (2 preceding siblings ...)
2017-09-25 9:36 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
@ 2017-09-25 20:50 ` Max Reitz
2017-09-25 20:53 ` Michael Roth
4 siblings, 0 replies; 6+ messages in thread
From: Max Reitz @ 2017-09-25 20:50 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy, kwolf; +Cc: qemu-block, qemu-devel, den
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
On 2017-09-22 16:43, Vladimir Sementsov-Ogievskiy wrote:
> Without initialization to zero dirty_bitmap field may be not zero
> for a bitmap which should not be stored and
> qcow2_store_persistent_dirty_bitmaps will erroneously call
> store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, fixed the commit message and applied it to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
` (3 preceding siblings ...)
2017-09-25 20:50 ` [Qemu-devel] " Max Reitz
@ 2017-09-25 20:53 ` Michael Roth
4 siblings, 0 replies; 6+ messages in thread
From: Michael Roth @ 2017-09-25 20:53 UTC (permalink / raw)
To: Vladimir Sementsov-Ogievskiy, kwolf, mreitz; +Cc: den, qemu-devel, qemu-block
Quoting Vladimir Sementsov-Ogievskiy (2017-09-22 09:43:53)
> Without initialization to zero dirty_bitmap field may be not zero
> for a bitmap which should not be stored and
> qcow2_store_persistent_dirty_bitmaps will erroneously call
> store_bitmap for it which leads to SYGSEGV on bdrv_dirty_bitmap_name.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
FYI: this patch has been tagged for stable 2.10.1, but is not yet
upstream. Patch freeze for 2.10.1 is September 27th.
> ---
> block/qcow2-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index e8d3bdbd6e..14f41d0427 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -602,7 +602,7 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
> goto fail;
> }
>
> - bm = g_new(Qcow2Bitmap, 1);
> + bm = g_new0(Qcow2Bitmap, 1);
> bm->table.offset = e->bitmap_table_offset;
> bm->table.size = e->bitmap_table_size;
> bm->flags = e->flags;
> --
> 2.11.1
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-09-25 20:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 14:43 [Qemu-devel] [PATCH] block/qcow2-bitmap: fix use of uninitialized pointer Vladimir Sementsov-Ogievskiy
2017-09-22 20:42 ` Eric Blake
2017-09-23 11:04 ` Vladimir Sementsov-Ogievskiy
2017-09-25 9:36 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-09-25 20:50 ` [Qemu-devel] " Max Reitz
2017-09-25 20:53 ` Michael Roth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.