Skip to content

zero pointer after bdrv_unref_child

Vladimir Sementsov-Ogievskiy qemu-devel 1 version Applied

Status from this message: Thanks, applied to my block branch:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2block: bdrv_set_backing_bs: fix use-after-freeblock.c+1 -12 replies
2/2block/qcow2: zero data_file child after freeblock/qcow2.c+2 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéJohn Snow
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] zero pointer after bdrv_unref_child

Hi all!

I faced use-after-free of bs->backing pointer after bdrv_unref_child in bdrv_set_backing_hd.

Fix it, and do similar thing for s->data_file in qcow2.c.

I'm not sure that this is the full fix. Is it safe to keep bs->backing during bdrv_unref_child itself? Is it safe to keep bs->backing during all-child-unref loop in bdrv_close?

Vladimir Sementsov-Ogievskiy (2):
block: bdrv_set_backing_bs: fix use-after-free
block/qcow2: zero data_file child after free

 block.c       | 2 +-
 block/qcow2.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.21.0