mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-24 22:50:42 +00:00
block/nbd: Assert there are no timers when closed
Our two timers must not remain armed beyond nbd_clear_bdrvstate(), or they will access freed data when they fire. This patch is separate from the patches that actually fix the issue (HEAD^^ and HEAD^) so that you can run the associated regression iotest (281) on a configuration that reproducibly exposes the bug. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This commit is contained in:
parent
717be9644b
commit
8a39c381e5
@ -110,6 +110,10 @@ static void nbd_clear_bdrvstate(BlockDriverState *bs)
|
|||||||
|
|
||||||
yank_unregister_instance(BLOCKDEV_YANK_INSTANCE(bs->node_name));
|
yank_unregister_instance(BLOCKDEV_YANK_INSTANCE(bs->node_name));
|
||||||
|
|
||||||
|
/* Must not leave timers behind that would access freed data */
|
||||||
|
assert(!s->reconnect_delay_timer);
|
||||||
|
assert(!s->open_timer);
|
||||||
|
|
||||||
object_unref(OBJECT(s->tlscreds));
|
object_unref(OBJECT(s->tlscreds));
|
||||||
qapi_free_SocketAddress(s->saddr);
|
qapi_free_SocketAddress(s->saddr);
|
||||||
s->saddr = NULL;
|
s->saddr = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user