Assert the VM map lock is held in function used by mmap/mprotect/munmap.
authormpi <mpi@openbsd.org>
Fri, 4 Nov 2022 09:36:44 +0000 (09:36 +0000)
committermpi <mpi@openbsd.org>
Fri, 4 Nov 2022 09:36:44 +0000 (09:36 +0000)
commit55490b0115c4653a78bbcd99d48b987aafd98657
tree75538056dbcd85cededbe6a1a9ccd7be371b78ec
parent921be97db90d3e909f1f032b78b6faf6bd04e8f1
Assert the VM map lock is held in function used by mmap/mprotect/munmap.

Also grab the lock in uvm_map_teardown() and uvm_map_deallocate() to
satisfy the assertions.  Grabbing the lock there shouldn't be strictly
necessary, because no other reference to the map should exist when the
reaper is holding it, but it doesn't hurt and makes our life easier.

Inputs & tests from Ivo van der Sangen, tb@, gnezdo@, kn@

kettenis@ and tb@ agree with the direction, ok kn@
sys/uvm/uvm_addr.c
sys/uvm/uvm_fault.c
sys/uvm/uvm_map.c
sys/uvm/uvm_map.h