CVSROOT:        /cvs
Module name:    src
Changes by:     k...@cvs.openbsd.org    2022/02/14 14:11:02

Modified files:
        sys/uvm        : uvm_map.c 

Log message:
Unwire with map lock held

This is an updated version of uvm_map.c r1.283 "Unwire with map lock held".

The previous version introduced a use-after-free by not unlocking vm_map
locks in uvm_map_teardown(), resulting in dangling references on the
reaper's lock list (thanks visa!).

Lock and unlock the map in around uvm_map_teardown() instead.
This code path holds the last reference, hence the lock isn't strictly
needed except for satisfying upcoming locking assertions.

Tested on amd64, arm64, i386, macppc, octeon, sparc64.
This time also with WITNESS enabled (except on sparc64 which builds but does
not boot with WITNESS;  this is a known issue).

OK mpi visa

Reply via email to