[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/21] parallels: Set s->used_bmap to NULL in parallels_free_u
|
From: |
Alexander Ivanov |
|
Subject: |
[PATCH v3 01/21] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap() |
|
Date: |
Fri, 27 Oct 2023 09:46:16 +0200 |
After used bitmap freeng s->used_bmap points to the freed memory. If we try
to free used bitmap one more time it leads to double free error.
Set s->used_bmap to NULL to exclude double free error.
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
block/parallels.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/parallels.c b/block/parallels.c
index 1d695ce7fb..01a61a4ebd 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -245,6 +245,7 @@ static void parallels_free_used_bitmap(BlockDriverState *bs)
BDRVParallelsState *s = bs->opaque;
s->used_bmap_size = 0;
g_free(s->used_bmap);
+ s->used_bmap = NULL;
}
static int64_t coroutine_fn GRAPH_RDLOCK
--
2.34.1
- [PATCH v3 00/21] parallels: Add full dirty bitmap support, Alexander Ivanov, 2023/10/27
- [PATCH v3 03/21] parallels: Make mark_used() a global function, Alexander Ivanov, 2023/10/27
- [PATCH v3 21/21] tests: Add parallels format support to image-fleecing, Alexander Ivanov, 2023/10/27
- [PATCH v3 05/21] parallels: Move host clusters allocation to a separate function, Alexander Ivanov, 2023/10/27
- [PATCH v3 11/21] parallels: Mark parallels_inactivate GRAPH_RDLOCK, guard parallels_close, Alexander Ivanov, 2023/10/27
- [PATCH v3 01/21] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap(),
Alexander Ivanov <=
- [PATCH v3 02/21] parallels: Move inactivation code to a separate function, Alexander Ivanov, 2023/10/27
- [PATCH v3 04/21] parallels: Add parallels_mark_unused() helper, Alexander Ivanov, 2023/10/27
- [PATCH v3 20/21] tests: Turned on 256, 299, 304 and block-status-cache for parallels format, Alexander Ivanov, 2023/10/27
- [PATCH v3 09/21] parallels: Create used bitmap even if checks needed, Alexander Ivanov, 2023/10/27
- [PATCH v3 12/21] parallels: Let image extensions work in RW mode, Alexander Ivanov, 2023/10/27
- [PATCH v3 06/21] parallels: Set data_end value in parallels_check_leak(), Alexander Ivanov, 2023/10/27