[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 06/15] block: fix dangling bs->explicit_options in bl
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 06/15] block: fix dangling bs->explicit_options in block.c |
Date: |
Tue, 1 Aug 2017 16:46:23 +0200 |
From: Manos Pitsidianakis <address@hidden>
In some error paths it is possible to QDECREF a freed dangling
explicit_options, resulting in a heap overflow crash. For example
bdrv_open_inherit()'s fail unrefs it, then calls bdrv_unref which calls
bdrv_close which also unrefs it.
Signed-off-by: Manos Pitsidianakis <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block.c b/block.c
index 37e72b7a96..7a78bc647b 100644
--- a/block.c
+++ b/block.c
@@ -2608,6 +2608,7 @@ fail:
QDECREF(bs->options);
QDECREF(options);
bs->options = NULL;
+ bs->explicit_options = NULL;
bdrv_unref(bs);
error_propagate(errp, local_err);
return NULL;
@@ -3087,6 +3088,7 @@ static void bdrv_close(BlockDriverState *bs)
QDECREF(bs->options);
QDECREF(bs->explicit_options);
bs->options = NULL;
+ bs->explicit_options = NULL;
QDECREF(bs->full_open_options);
bs->full_open_options = NULL;
}
--
2.13.3
- [Qemu-block] [PULL 00/15] Block layer patches for 2.10.0-rc1, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 04/15] iotests: Check dirty bitmap statistics in 124, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 05/15] iotests: Add test of recent fix to 'qemu-img measure', Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 03/15] iotests: Redirect stderr to stdout in 186, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 02/15] iotests: Fix test 156, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 06/15] block: fix dangling bs->explicit_options in block.c,
Kevin Wolf <=
- [Qemu-block] [PULL 08/15] qemu-iotests/041: Fix leaked scratch images, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 01/15] docs: add qemu-block-drivers(7) man page, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 09/15] qemu-iotests: Remove blkdebug.conf after tests, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 07/15] block: fix leaks in bdrv_open_driver(), Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 10/15] qemu-iotests/141: Fix image cleanup, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 13/15] qemu-iotests/063: Fix leaked image, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 11/15] qemu-iotests/153: Fix leaked scratch images, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 14/15] qemu-iotests/059: Fix leaked image files, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 15/15] block/qapi: Remove redundant NULL check to silence Coverity, Kevin Wolf, 2017/08/01
- [Qemu-block] [PULL 12/15] qemu-iotests/162: Fix leaked temporary files, Kevin Wolf, 2017/08/01