login: witness: lock order reversal:
1st 0xfffffd806e9aa300 vmmaplk (&map->lock)
2nd 0xfffffd806fc14928 inode (&ip->i_lock)
lock order "&ip->i_lock"(rrwlock) -> "&map->lock"(rwlock) first seen at:
#0 witness_checkorder+0x69c witness_lock_order_check sys/kern/subr_witness.c:2442 [inline]
#0 witness_checkorder+0x69c sys/kern/subr_witness.c:873
#1 rw_enter_read+0x66 sys/kern/kern_rwlock.c:109
#2 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1448
#3 uvm_fault+0x7f sys/uvm/uvm_fault.c:524
#4 pageflttrap+0x1b8 sys/arch/amd64/amd64/trap.c:221
#5 kerntrap+0xec sys/arch/amd64/amd64/trap.c:302
#6 alltraps_kern_meltdown+0x7b
#7 copyout+0x53
#8 ffs_read+0x3d2 sys/ufs/ffs/ffs_vnops.c:258
#9 VOP_READ+0xbf sys/kern/vfs_vops.c:247
#10 vn_read+0x124 sys/kern/vfs_vnops.c:375
#11 dofilereadv+0x1a1 sys/kern/sys_generic.c:237
#12 sys_read+0x83 sys/kern/sys_generic.c:157
#13 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#13 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#14 Xsyscall+0x128
lock order "&map->lock"(rwlock) -> "&ip->i_lock"(rrwlock) first seen at:
#0 witness_checkorder+0x69c witness_lock_order_check sys/kern/subr_witness.c:2442 [inline]
#0 witness_checkorder+0x69c sys/kern/subr_witness.c:873
#1 rw_enter+0xd4
#2 rrw_enter+0x88 sys/kern/kern_rwlock.c:453
#3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602
#4 vn_lock+0x81 sys/kern/vfs_vnops.c:575
#5 uvn_io+0x2c8 sys/uvm/uvm_vnode.c:1196
#6 uvn_get+0x226 sys/uvm/uvm_vnode.c:1056
#7 uvm_fault+0x11cc sys/uvm/uvm_fault.c:1023
#8 uvm_fault_wire+0x70 sys/uvm/uvm_fault.c:1295
#9 uvm_map_pageable_wire+0x2dd sys/uvm/uvm_map.c:2358
#10 sys_mlock+0x185 sys/uvm/uvm_mmap.c:765
#11 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#11 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#12 Xsyscall+0x128
Stopped at db_enter+0x18: addq $0x8,%rsp
ddb{1}>
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
the kernel did not panic
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
witness_checkorder(fffffd806fc14928,9,0) at witness_checkorder+0x1009 witness_debugger sys/kern/subr_witness.c:2505 [inline]
witness_checkorder(fffffd806fc14928,9,0) at witness_checkorder+0x1009 sys/kern/subr_witness.c:1087
rw_enter(fffffd806fc14918,81) at rw_enter+0xd4
rrw_enter(fffffd806fc14918,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:453
VOP_LOCK(fffffd806fc15770,81) at VOP_LOCK+0x4b sys/kern/vfs_vops.c:602
vn_lock(fffffd806fc15770,81) at vn_lock+0x81 sys/kern/vfs_vnops.c:575
uvn_io(fffffd806df11680,ffff800020b2f268,1,2,0) at uvn_io+0x2c8 sys/uvm/uvm_vnode.c:1196
uvn_get(fffffd806df11680,0,ffff800020b2f4c0,ffff800020b2f454,0,1) at uvn_get+0x226 sys/uvm/uvm_vnode.c:1056
uvm_fault(fffffd806e9aa2e8,20002000,2,3) at uvm_fault+0x11cc sys/uvm/uvm_fault.c:1023
uvm_fault_wire(fffffd806e9aa2e8,20002000,20003000,3) at uvm_fault_wire+0x70 sys/uvm/uvm_fault.c:1295
uvm_map_pageable_wire(fffffd806e9aa2e8,fffffd806e364ee0,fffffd806e364268,0,0,0) at uvm_map_pageable_wire+0x2dd sys/uvm/uvm_map.c:2358
sys_mlock(ffff800020a7cea8,ffff800020b2f6b8,ffff800020b2f700) at sys_mlock+0x185 sys/uvm/uvm_mmap.c:765
syscall(ffff800020b2f780) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800020b2f780) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x54099eddc10, count: -14
ddb{1}> show registers
rdi 0x3
rsi 0xffffffff82502c30 __sancov_gen_cov_switch_values.129
rbp 0xffff800020b2eee0
rbx 0x3
rdx 0x8b
rcx 0x3
rax 0x3
r8 0xffffffff81c63a92 witness_checkorder+0xfe2
r9 0x5
r10 0xc482c5aafc79c714
r11 0xc536319cb6e13d53
r12 0xfffffd80029a82c0
r13 0
r14 0xffffffff82623050 w_lodata+0x4f470
r15 0xffffffff82627d50 w_lodata+0x54170
rip 0xffffffff8219a9e8 db_enter+0x18
cs 0x8
rflags 0x246
rsp 0xffff800020b2eed0
ss 0x10
db_enter+0x18: addq $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor8489) pid=135360 stat=onproc
flags process=0 proc=4000000<THREAD>
pri=32, usrpri=51, nice=20
forw=0xffffffffffffffff, list=0xffff800020a7c008,0xffffffff82682e08
process=0xffff800020a903d0 user=0xffff800020b2a000, vmspace=0xfffffd806e9aa2e8
estcpu=2, cpticks=0, pctcpu=0.0
user=0, sys=0, intr=0
ddb{1}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
64560 92526 63025 0 7 0 syz-executor8489
64560 19696 63025 0 2 0x4000000 syz-executor8489
*64560 135360 63025 0 7 0x4000000 syz-executor8489
63025 397455 84687 0 3 0x82 nanosleep syz-executor8489
84687 153080 28809 0 3 0x10008a pause ksh
28809 522366 6307 0 3 0x92 select sshd
44278 140188 1 0 3 0x100083 ttyin getty
6307 8296 1 0 3 0x80 select sshd
65752 386093 93819 74 3 0x100092 bpf pflogd
93819 90295 1 0 3 0x80 netio pflogd
28084 106759 27592 73 3 0x100090 kqread syslogd
27592 370625 1 0 3 0x100082 netio syslogd
21612 346799 1 77 3 0x100090 poll dhclient
52296 125603 1 0 3 0x80 poll dhclient
26393 47549 0 0 3 0x14200 bored smr
81580 388517 0 0 3 0x14200 pgzero zerothread
13202 338080 0 0 3 0x14200 aiodoned aiodoned
94690 501905 0 0 3 0x14200 syncer update
59420 52740 0 0 3 0x14200 cleaner cleaner
39232 235718 0 0 3 0x14200 reaper reaper
31946 109140 0 0 3 0x14200 pgdaemon pagedaemon
77512 234566 0 0 3 0x14200 bored crynlk
64730 375484 0 0 3 0x14200 bored crypto
84125 213551 0 0 3 0x40014200 acpi0 acpi0
86373 179671 0 0 3 0x40014200 idle1
56647 105072 0 0 3 0x14200 bored softnet
96461 178433 0 0 3 0x14200 bored systqmp
25483 50107 0 0 3 0x14200 bored systq
50190 440363 0 0 3 0x40014200 bored softclock
25616 278632 0 0 3 0x40014200 idle0
1 391902 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper
ddb{1}> show all locks
Process 64560 (syz-executor8489) thread 0xffff800020a7cea8 (135360)
shared rwlock vmmaplk r = 0 (0xfffffd806e9aa300)
#0 witness_lock+0x52e sys/kern/subr_witness.c:1164
#1 rw_enter+0x453 sys/kern/kern_rwlock.c:309
#2 vm_map_lock_ln+0x111 sys/uvm/uvm_map.c:5409
#3 uvm_map_pageable+0x11d sys/uvm/uvm_map.c:2454
#4 sys_mlock+0x185 sys/uvm/uvm_mmap.c:765
#5 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#5 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570
#6 Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82641eb8)
#0 witness_lock+0x52e sys/kern/subr_witness.c:1164
#1 syscall+0x400 mi_syscall sys/sys/syscall_mi.h:93 [inline]
#1 syscall+0x400 sys/arch/amd64/amd64/trap.c:570
#2 Xsyscall+0x128
ddb{1}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 9462 6393K 6394K 78643K 10553 0
pcb 13 8K 8K 78643K 13 0
rtable 61 2K 2K 78643K 127 0
ifaddr 29 8K 8K 78643K 30 0
counters 39 33K 33K 78643K 39 0
ioctlops 0 0K 4K 78643K 1467 0
mount 1 1K 1K 78643K 1 0
vnodes 1183 74K 75K 78643K 1188 0
UFS quota 1 32K 32K 78643K 1 0
UFS mount 5 36K 36K 78643K 5 0
shm 2 1K 1K 78643K 2 0
VM map 2 1K 1K 78643K 2 0
sem 2 0K 0K 78643K 2 0
dirhash 12 2K 2K 78643K 12 0
ACPI 1809 196K 290K 78643K 12766 0
file desc 1 0K 0K 78643K 1 0
proc 59 63K 71K 78643K 358 0
NFS srvsock 1 0K 0K 78643K 1 0
NFS daemon 1 16K 16K 78643K 1 0
in_multi 11 0K 0K 78643K 11 0
ether_multi 1 0K 0K 78643K 1 0
ISOFS mount 1 32K 32K 78643K 1 0
MSDOSFS mount 1 16K 16K 78643K 1 0
ttys 19 95K 95K 78643K 19 0
exec 0 0K 1K 78643K 177 0
pagedep 1 8K 8K 78643K 1 0
inodedep 1 32K 32K 78643K 1 0
newblk 1 0K 0K 78643K 1 0
VM swap 7 26K 26K 78643K 7 0
UVM amap 65 3K 4K 78643K 807 0
UVM aobj 2 2K 2K 78643K 2 0
memdesc 1 4K 4K 78643K 1 0
crypto data 1 1K 1K 78643K 1 0
NDP 4 0K 0K 78643K 4 0
temp 24 3009K 3073K 78643K 1665 0
kqueue 2 2K 2K 78643K 2 0
SYN cache 2 16K 16K 78643K 2 0
ddb{1}> show all pools
Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp 64 2 0 0 1 0 1 1 0 8 0
plcache 128 20 0 0 1 0 1 1 0 8 0
rtpcb 80 15 0 13 1 0 1 1 0 8 0
rtentry 112 23 0 1 1 0 1 1 0 8 0
unpcb 120 29 0 19 1 0 1 1 0 8 0
syncache 264 5 0 5 2 1 1 1 0 8 1
tcpcb 544 8 0 5 1 0 1 1 0 8 0
inpcb 280 29 0 23 1 0 1 1 0 8 0
pfosfp 40 846 0 423 5 0 5 5 0 8 0
pfosfpen 112 1428 0 714 21 0 21 21 0 8 0
pfstitem 24 8 0 2 1 0 1 1 0 8 0
pfstkey 112 8 0 2 1 0 1 1 0 8 0
pfstate 328 8 0 2 1 0 1 1 0 8 0
pfrule 1360 21 0 16 2 1 1 2 0 8 0
art_heap8 4096 1 0 0 1 0 1 1 0 8 0
art_heap4 256 96 0 0 6 0 6 6 0 8 0
art_table 32 97 0 0 1 0 1 1 0 8 0
art_node 16 22 0 2 1 0 1 1 0 8 0
dirhash 1024 17 0 0 3 0 3 3 0 8 0
dino1pl 128 1401 0 16 45 0 45 45 0 8 0
ffsino 272 1401 0 16 93 0 93 93 0 8 0
nchpl 144 1578 0 35 58 0 58 58 0 8 0
uvmvnodes 72 1411 0 0 26 0 26 26 0 8 0
vnodes 208 1411 0 0 75 0 75 75 0 8 0
namei 1024 3749 0 3749 2 1 1 1 0 8 1
percpumem 16 30 0 0 1 0 1 1 0 8 0
scxspl 192 2917 0 2917 9 8 1 7 0 8 1
plimitpl 152 14 0 8 1 0 1 1 0 8 0
sigapl 424 222 0 193 4 0 4 4 0 8 0
futexpl 56 5 0 5 1 0 1 1 0 8 1
knotepl 112 5 0 0 1 0 1 1 0 8 0
kqueuepl 144 1 0 0 1 0 1 1 0 8 0
pipelkpl 48 64 0 60 2 1 1 1 0 8 0
pipepl 120 128 0 121 2 1 1 1 0 8 0
fdescpl 496 207 0 193 3 0 3 3 0 8 0
filepl 152 966 0 916 2 0 2 2 0 8 0
lockfpl 104 5 0 4 1 0 1 1 0 8 0
lockfspl 48 3 0 2 1 0 1 1 0 8 0
sessionpl 112 18 0 9 1 0 1 1 0 8 0
pgrppl 48 18 0 9 1 0 1 1 0 8 0
ucredpl 96 52 0 43 1 0 1 1 0 8 0
zombiepl 144 193 0 193 2 1 1 1 0 8 1
processpl 960 222 0 193 4 0 4 4 0 8 0
procpl 624 227 0 196 3 0 3 3 0 8 0
sockpl 400 73 0 55 2 0 2 2 0 8 0
mcl4k 4096 3 0 0 1 0 1 1 0 8 0
mcl2k 2048 73 0 0 9 0 9 9 0 8 0
mtagpl 80 1 0 0 1 0 1 1 0 8 0
mbufpl 256 110 0 0 6 0 6 6 0 8 0
bufpl 280 1857 0 79 127 0 127 127 0 8 0
anonpl 16 19277 0 18009 7 1 6 7 0 124 0
amapchunkpl 152 537 0 494 2 0 2 2 0 158 0
amappl16 192 83 0 79 1 0 1 1 0 8 0
amappl15 184 1 0 0 1 0 1 1 0 8 0
amappl14 176 1 0 1 1 1 0 1 0 8 0
amappl13 168 14 0 13 2 1 1 1 0 8 0
amappl12 160 1 0 1 1 1 0 1 0 8 0
amappl11 152 69 0 51 1 0 1 1 0 8 0
amappl10 144 7 0 5 1 0 1 1 0 8 0
amappl9 136 222 0 221 1 0 1 1 0 8 0
amappl8 128 239 0 236 1 0 1 1 0 8 0
amappl7 120 92 0 84 1 0 1 1 0 8 0
amappl6 112 15 0 15 2 1 1 1 0 8 1
amappl5 104 161 0 146 1 0 1 1 0 8 0
amappl4 96 482 0 454 1 0 1 1 0 8 0
amappl3 88 96 0 90 1 0 1 1 0 8 0
amappl2 80 825 0 765 3 1 2 2 0 8 0
amappl1 72 14254 0 13826 16 6 10 16 0 8 0
amappl 80 416 0 392 1 0 1 1 0 84 0
dma4096 4096 1 0 1 1 1 0 1 0 8 0
dma256 256 6 0 6 1 1 0 1 0 8 0
dma128 128 253 0 253 1 1 0 1 0 8 0
dma64 64 6 0 6 1 1 0 1 0 8 0
dma32 32 7 0 7 1 1 0 1 0 8 0
dma16 16 18 0 17 1 0 1 1 0 8 0
aobjpl 64 1 0 0 1 0 1 1 0 8 0
uaddrrnd 24 207 0 193 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 207 0 193 1 0 1 1 0 8 0
vmmpekpl 168 5414 0 5391 2 0 2 2 0 8 0
vmmpepl 168 29336 0 28450 53 14 39 51 0 357 0
vmsppl 368 206 0 193 2 0 2 2 0 8 0
pdppl 4096 421 0 386 5 0 5 5 0 8 0
pvpl 32 79642 0 76609 31 3 28 28 0 265 1
pmappl 232 206 0 193 1 0 1 1 0 8 0
extentpl 40 46 0 29 1 0 1 1 0 8 0
phpool 112 138 0 4 4 0 4 4 0 8 0