OpenBSD cvs log

created 2020-12-03T21:00:31Z
begin 2020-10-07T12:13:23Z
end 2020-10-07T12:26:20Z
path src/sys
commits 1

date 2020-10-07T12:26:20Z
author mpi
files src/sys/uvm/uvm_mmap.c log diff annotate
message Do not release the KERNEL_LOCK() when mmap(2)ing files.

Previous attempt to unlock amap & anon exposed a race in vnode reference
counting. So be conservative with the code paths that we're not fully moving
out of the KERNEL_LOCK() to allow us to concentrate on one area at a time.

The panic reported was:

....panic: vref used where vget required
....db_enter() at db_enter+0x5
....panic() at panic+0x129
....vref(ffffff03b20d29e8) at vref+0x5d
....uvn_attach(1010000,ffffff03a5879dc0) at uvn_attach+0x11d
....uvm_mmapfile(7,ffffff03a5879dc0,2,1,13,100000012) at uvm_mmapfile+0x12c
....sys_mmap(c50,ffff8000225f82a0,1) at sys_mmap+0x604
....syscall() at syscall+0x279

Note that this change has no effect as long as mmap(2) is still executed with
ze big lock.

ok kettenis@