Skip to content

Several error use-after-free

Vladimir Sementsov-Ogievskiy qemu-devel 1 version Applied

Status from this message: I queued the part that hasn't been merged. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 32 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6scripts/coccinelle: add error-use-after-free.cocciMAINTAINERS scripts/coccinelle/error-use-after-free.cocci+53 -013 replies
2/6block/mirror: fix use after free of local_errblock/mirror.c+1 -09 replies
3/6dump/win_dump: fix use after free of errdump/win_dump.c+1 -31 reply
4/6migration/colo: fix use after free of local_errmigration/colo.c+1 -01 reply
5/6migration/ram: fix use after free of local_errmigration/ram.c+1 -01 reply
6/6qga/commands-posix: fix use after free of local_errqga/commands-posix.c+3 -05 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRichard HendersonEric BlakeJohn SnowDr. David Alan GilbertMarkus ArmbrusterAlberto Garcia
SeriesR-b
1/6R-b R-b R-b
2/6R-b R-b
3/6R-b
4/6R-b
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v1 thread

Cover letter [PATCH for-5.0 0/6] Several error use-after-free

Hi all!

I accidentally found use-after-free of local_err in mirror, and decided to search for similar cases with help of small coccinelle script (patch 01). Happily, there no many cases.

Better to fix zero Error* pointer after each freeing everywhere, but this is too much for 5.0 and most of these cases will be covered by error-auto-propagation series.

Note also, that there are still a lot of use-after-free cases possible when error is not local variable but field of some structure, shared by several functions.

Vladimir Sementsov-Ogievskiy (6):
scripts/coccinelle: add error-use-after-free.cocci block/mirror: fix use after free of local_err dump/win_dump: fix use after free of err migration/colo: fix use after free of local_err migration/ram: fix use after free of local_err qga/commands-posix: fix use after free of local_err

 scripts/coccinelle/error-use-after-free.cocci | 52 +++++++++++++++++++
 block/mirror.c                                |  1 +
 dump/win_dump.c                               |  4 +-
 migration/colo.c                              |  1 +
 migration/ram.c                               |  1 +
 qga/commands-posix.c                          |  3 ++
 MAINTAINERS                                   |  1 +
 7 files changed, 60 insertions(+), 3 deletions(-)
 create mode 100644 scripts/coccinelle/error-use-after-free.cocci
Signature · 1 line
2.21.0