All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free
@ 2017-07-14 12:33 Vladimir Sementsov-Ogievskiy
  2017-07-14 16:00 ` Max Reitz
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2017-07-14 12:33 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: mreitz, kwolf, eblake, den, vsementsov, peter.maydell

Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
qcow2_remove_persistent_dirty_bitmap was added).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2-bitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 3e8735a20d..e8d3bdbd6e 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -487,6 +487,10 @@ static inline void bitmap_directory_to_be(uint8_t *dir, size_t size)
 
 static void bitmap_free(Qcow2Bitmap *bm)
 {
+    if (bm == NULL) {
+        return;
+    }
+
     g_free(bm->name);
     g_free(bm);
 }
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free
  2017-07-14 12:33 [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free Vladimir Sementsov-Ogievskiy
@ 2017-07-14 16:00 ` Max Reitz
  2017-07-25 15:02   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 4+ messages in thread
From: Max Reitz @ 2017-07-14 16:00 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy, qemu-devel, qemu-block
  Cc: kwolf, eblake, den, peter.maydell

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

On 2017-07-14 14:33, Vladimir Sementsov-Ogievskiy wrote:
> Fix possible crash on error path in
> qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
> 88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
> qcow2_remove_persistent_dirty_bitmap was added).
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  block/qcow2-bitmap.c | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks, applied to my block branch:

https://github.com/XanClic/qemu/commits/block

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free
  2017-07-14 16:00 ` Max Reitz
@ 2017-07-25 15:02   ` Philippe Mathieu-Daudé
  2017-07-25 15:33     ` Eric Blake
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-25 15:02 UTC (permalink / raw)
  To: Max Reitz, Vladimir Sementsov-Ogievskiy, qemu-devel, qemu-block
  Cc: kwolf, den, peter.maydell, Eric Blake

Maybe worth adding "Coverity: CID 1377700"

On 07/14/2017 01:00 PM, Max Reitz wrote:
> On 2017-07-14 14:33, Vladimir Sementsov-Ogievskiy wrote:
>> Fix possible crash on error path in
>> qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
>> 88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
>> qcow2_remove_persistent_dirty_bitmap was added).
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> ---
>>   block/qcow2-bitmap.c | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> Thanks, applied to my block branch:
> 
> https://github.com/XanClic/qemu/commits/block
> 
> Max
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free
  2017-07-25 15:02   ` Philippe Mathieu-Daudé
@ 2017-07-25 15:33     ` Eric Blake
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2017-07-25 15:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé,
	Max Reitz, Vladimir Sementsov-Ogievskiy, qemu-devel, qemu-block
  Cc: kwolf, den, peter.maydell

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On 07/25/2017 10:02 AM, Philippe Mathieu-Daudé wrote:
> Maybe worth adding "Coverity: CID 1377700"

At this point, the PULL request is already posted, so it may be too
late.  But it's not the end of the world if we miss the extra comment.

> 
> On 07/14/2017 01:00 PM, Max Reitz wrote:
>> On 2017-07-14 14:33, Vladimir Sementsov-Ogievskiy wrote:
>>> Fix possible crash on error path in
>>> qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
>>> 88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
>>> qcow2_remove_persistent_dirty_bitmap was added).
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>> ---
>>>   block/qcow2-bitmap.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>
>> Thanks, applied to my block branch:
>>
>> https://github.com/XanClic/qemu/commits/block
>>
>> Max
>>
> 

-- 
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] 4+ messages in thread

end of thread, other threads:[~2017-07-25 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 12:33 [Qemu-devel] [PATCH] qcow2-bitmap: fix bitmap_free Vladimir Sementsov-Ogievskiy
2017-07-14 16:00 ` Max Reitz
2017-07-25 15:02   ` Philippe Mathieu-Daudé
2017-07-25 15:33     ` Eric Blake

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.