Skip to content
Commit 058bc4b5 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

memory: destroy phys_sections one by one



phys_sections_clear is invoked after the dispatch tree has been
destroyed.  This leaves a window where phys_sections_nb > 0 but the
subpages are not valid anymore, which is a recipe for use-after-free
bugs.

Move the destruction of subpages in phys_sections_clear.  We will
still destroy the subpages when an address space is cleaned up,
because address_space_destroy will clear as->root and commit the
change before it calls address_space_destroy_dispatch.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 2c9b15ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment