Replace KASSERT in uvm_fault_unwire_locked() with code that handles the
authorkettenis <kettenis@openbsd.org>
Mon, 4 Apr 2022 09:27:05 +0000 (09:27 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 4 Apr 2022 09:27:05 +0000 (09:27 +0000)
commitf77c8782807671b70da8a8171d88055f0c62bacf
tree6d0666ab5d615da536d74e6f762535c5a1c55af1
parent53aaab4a7b575828841c4273eb962fd0d92070cd
Replace KASSERT in uvm_fault_unwire_locked() with code that handles the
case where not all pages are wired.  The KASSERT can be triggered in
multi-threaded applications when a thread calling munmap(2) races another
thread that invokes sysctl(2).  Properly written code shouldn't do this,
but making the kernel crash in this case is a bit harsh.

ok gezdo@, deraadt@

Fixes:
Reported-by: syzbot+e8310909e2910c9cca08@syzkaller.appspotmail.com
sys/uvm/uvm_fault.c