]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: Fix use after free error in bdrv_open_inherit()
authorAlberto Garcia <berto@igalia.com>
Thu, 6 Sep 2018 14:25:41 +0000 (17:25 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 27 Mar 2019 05:28:49 +0000 (00:28 -0500)
commit9e25063bb0039a9b9c5f91f8cc58f632f67af945
treea80e613ebbdf20e0e82b489b599e5f124ed33301
parent84cabd6c6c770632c3880cb2c3028a8fd73142d0
block: Fix use after free error in bdrv_open_inherit()

When a block device is opened with BDRV_O_SNAPSHOT and the
bdrv_append_temp_snapshot() call fails then the error code path tries
to unref the already destroyed 'options' QDict.

This can be reproduced easily by setting TMPDIR to a location where
the QEMU process can't write:

   $ TMPDIR=/nonexistent $QEMU -drive driver=null-co,snapshot=on

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 8961be33e8ca7e809c603223803ea66ef7ea5be7)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block.c