login: witness: lock order reversal: 1st 0xfffffd807f004188 vmmaplk (&map->lock) 2nd 0xfffffd8064f701a8 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:2441 [inline] #0 witness_checkorder+0x69c sys/kern/subr_witness.c:872 #1 rw_enter+0xd4 #2 vm_map_lock_ln+0x10d sys/uvm/uvm_map.c:5406 #3 uvm_map+0x2da sys/uvm/uvm_map.c:1233 #4 km_alloc+0x18b sys/uvm/uvm_km.c:908 #5 pool_multi_alloc_ni+0xd0 sys/kern/subr_pool.c:1692 #6 pool_p_alloc+0x74 pool_allocator_alloc sys/kern/subr_pool.c:1606 [inline] #6 pool_p_alloc+0x74 sys/kern/subr_pool.c:927 #7 pool_do_get+0x10f sys/kern/subr_pool.c:712 #8 pool_get+0xeb sys/kern/subr_pool.c:581 #9 ufsdirhash_build+0x3ea sys/ufs/ufs/ufs_dirhash.c:180 #10 ufs_lookup+0x2a1 sys/ufs/ufs/ufs_lookup.c:200 #11 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:91 #12 vfs_lookup+0x7a6 sys/kern/vfs_lookup.c:568 #13 namei+0x63c sys/kern/vfs_lookup.c:249 #14 start_init+0xc9 check_console sys/kern/init_main.c:596 [inline] #14 start_init+0xc9 sys/kern/init_main.c:636 #15 proc_trampoline+0x1c 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:2441 [inline] #0 witness_checkorder+0x69c sys/kern/subr_witness.c:872 #1 rw_enter+0xd4 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:453 #3 VOP_LOCK+0xf9 sys/kern/vfs_vops.c:615 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:571 #5 uvn_io+0x2c8 sys/uvm/uvm_vnode.c:1189 #6 uvn_get+0x226 sys/uvm/uvm_vnode.c:1049 #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:92 [inline] #11 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #12 Xsyscall+0x128 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic the kernel did not panic ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd8064f701a8,9,0) at witness_checkorder+0x1009 witness_debugger sys/kern/subr_witness.c:2504 [inline] witness_checkorder(fffffd8064f701a8,9,0) at witness_checkorder+0x1009 sys/kern/subr_witness.c:1086 rw_enter(fffffd8064f70198,81) at rw_enter+0xd4 rrw_enter(fffffd8064f70198,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:453 VOP_LOCK(fffffd80622569d8,81) at VOP_LOCK+0xf9 sys/kern/vfs_vops.c:615 vn_lock(fffffd80622569d8,81) at vn_lock+0x81 sys/kern/vfs_vnops.c:571 uvn_io(fffffd8066ff89a8,ffff800022d6eb28,1,2,0) at uvn_io+0x2c8 sys/uvm/uvm_vnode.c:1189 uvn_get(fffffd8066ff89a8,0,ffff800022d6ed80,ffff800022d6ed14,0,0) at uvn_get+0x226 sys/uvm/uvm_vnode.c:1049 uvm_fault(fffffd807f004170,20000000,2,2) at uvm_fault+0x11cc sys/uvm/uvm_fault.c:1023 uvm_fault_wire(fffffd807f004170,20000000,20003000,2) at uvm_fault_wire+0x70 sys/uvm/uvm_fault.c:1295 uvm_map_pageable_wire(fffffd807f004170,fffffd806b394980,fffffd806b394440,ffff800020b6a000,0,0) at uvm_map_pageable_wire+0x2dd sys/uvm/uvm_map.c:2358 sys_mlock(ffff800020a98508,ffff800022d6ef78,ffff800022d6efc0) at sys_mlock+0x185 sys/uvm/uvm_mmap.c:765 syscall(ffff800022d6f040) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022d6f040) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xda31fb53900, count: -14 ddb{0}> show registers rdi 0x3 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800022d6e7a0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b6a000 rax 0xffff8000009f51c0 r8 0xffffffff81b6af72 witness_checkorder+0xfe2 r9 0x5 r10 0x3 r11 0xad84ff7e4b42934d r12 0xfffffd800297b100 r13 0 r14 0xffffffff825f35e0 w_lodata+0x4c870 r15 0xffffffff825fbd50 w_lodata+0x54fe0 rip 0xffffffff819657f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022d6e790 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=207432 stat=onproc flags process=10 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020aa7b38,0xffff800020a982a0 process=0xffff800020aa31c0 user=0xffff800022d6a000, vmspace=0xfffffd807f004170 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 74360 365770 4613 32767 7 0x10 syz-executor.0 *74360 207432 4613 32767 7 0x4000010 syz-executor.0 74360 116962 4613 32767 3 0x4000090 fsleep syz-executor.0 73761 407236 0 0 3 0x14200 bored sosplice 2390 106797 71996 32767 3 0x90 nanosleep syz-executor.1 71996 108556 54224 0 3 0x82 wait syz-executor.1 4613 99098 37243 32767 3 0x90 nanosleep syz-executor.0 37243 474184 54224 0 3 0x82 wait syz-executor.0 54224 112367 11261 0 3 0x82 thrsleep syz-fuzzer 54224 329719 11261 0 3 0x4000082 nanosleep syz-fuzzer 54224 482780 11261 0 3 0x4000082 kqread syz-fuzzer 54224 95263 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 48440 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 382171 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 500515 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 197501 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 194254 11261 0 3 0x4000082 thrsleep syz-fuzzer 54224 402289 11261 0 3 0x4000082 nanosleep syz-fuzzer 11261 431666 40307 0 3 0x10008a pause ksh 40307 210574 11906 0 3 0x92 select sshd 17512 135552 1 0 3 0x100083 ttyin getty 11906 385581 1 0 3 0x80 select sshd 47750 363829 54775 73 3 0x100090 kqread syslogd 54775 23217 1 0 3 0x100082 netio syslogd 31911 255930 1 77 3 0x100090 poll dhclient 8328 412898 1 0 3 0x80 poll dhclient 40030 490608 0 0 2 0x14200 zerothread 11978 73035 0 0 3 0x14200 aiodoned aiodoned 32324 215288 0 0 3 0x14200 syncer update 61353 345301 0 0 3 0x14200 cleaner cleaner 66658 71666 0 0 3 0x14200 reaper reaper 48742 466805 0 0 3 0x14200 pgdaemon pagedaemon 30363 145816 0 0 3 0x14200 bored crynlk 39531 349221 0 0 3 0x14200 bored crypto 7666 316280 0 0 3 0x14200 bored viomb 63674 494181 0 0 3 0x40014200 acpi0 acpi0 22777 144312 0 0 3 0x40014200 idle1 63888 174944 0 0 3 0x14200 bored softnet 38717 225771 0 0 3 0x14200 bored systqmp 82377 502765 0 0 3 0x14200 bored systq 29043 217924 0 0 3 0x40014200 bored softclock 88649 271284 0 0 3 0x40014200 idle0 58318 37089 0 0 3 0x14200 bored smr 1 381084 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 74360 (syz-executor.0) thread 0xffff800020a98508 (207432) shared rwlock vmmaplk r = 0 (0xfffffd807f004188) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:309 #2 vm_map_lock_ln+0x10d sys/uvm/uvm_map.c:5406 #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:92 [inline] #5 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82657328) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 syscall+0x400 mi_syscall sys/sys/syscall_mi.h:83 [inline] #1 syscall+0x400 sys/arch/amd64/amd64/trap.c:555 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9475 6340K 6340K 78643K 10565 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 199 0 ifaddr 39 10K 10K 78643K 39 0 counters 39 33K 33K 78643K 39 0 ioctlops 0 0K 2K 78643K 17 0 iov 0 0K 24K 78643K 12 0 mount 1 1K 1K 78643K 1 0 vnodes 1214 76K 76K 78643K 1219 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 12 1K 1K 78643K 13 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1810 197K 290K 78643K 12817 0 file desc 7 21K 33K 78643K 62 0 proc 48 50K 83K 78643K 366 0 subproc 34 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 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 36 159K 159K 78643K 36 0 exec 0 0K 1K 78643K 183 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 106 21K 22K 78643K 1033 0 UVM aobj 4 2K 2K 78643K 4 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 9 0 temp 73 3022K 3088K 78643K 3263 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 7 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 25 0 23 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 57 0 47 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8 0 8 1 1 0 1 0 8 0 tcpcb 544 27 0 22 1 0 1 1 0 8 0 inpcb 280 85 0 75 2 0 2 2 0 8 1 nd6 48 4 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 213 0 0 14 0 14 14 0 8 0 art_table 32 214 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 2 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 11 0 1 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1455 0 52 46 0 46 46 0 8 0 ffsino 272 1455 0 52 94 0 94 94 0 8 0 nchpl 144 1728 0 115 60 0 60 60 0 8 0 uvmvnodes 72 1498 0 0 28 0 28 28 0 8 0 vnodes 208 1498 0 0 79 0 79 79 0 8 0 namei 1024 4209 0 4209 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 4868 0 4868 8 3 5 7 0 8 5 plimitpl 152 21 0 12 1 0 1 1 0 8 0 sigapl 432 233 0 218 3 1 2 3 0 8 0 futexpl 56 590 0 589 1 0 1 1 0 8 0 knotepl 112 55 0 36 1 0 1 1 0 8 0 kqueuepl 104 16 0 14 1 0 1 1 0 8 0 pipepl 160 154 0 135 2 0 2 2 0 8 1 fdescpl 488 234 0 218 3 0 3 3 0 8 0 filepl 152 1297 0 1196 5 0 5 5 0 8 1 lockfpl 104 26 0 25 1 0 1 1 0 8 0 lockfspl 48 11 0 10 1 0 1 1 0 8 0 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 85 0 76 1 0 1 1 0 8 0 zombiepl 144 218 0 217 1 0 1 1 0 8 0 processpl 904 251 0 217 4 0 4 4 0 8 0 procpl 632 338 0 293 5 0 5 5 0 8 1 sosppl 128 2 0 0 1 0 1 1 0 8 0 sockpl 384 169 0 147 3 0 3 3 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 146 0 0 18 0 18 18 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 169 0 0 11 0 11 11 0 8 0 bufpl 280 6263 0 1326 353 0 353 353 0 8 0 anonpl 16 44437 0 30637 72 0 72 72 0 125 16 amapchunkpl 152 1365 0 1237 8 0 8 8 0 158 0 amappl16 192 1390 0 643 50 3 47 50 0 8 8 amappl15 184 58 0 53 1 0 1 1 0 8 0 amappl14 176 27 0 23 1 0 1 1 0 8 0 amappl13 168 19 0 16 1 0 1 1 0 8 0 amappl12 160 9 0 8 2 1 1 1 0 8 0 amappl11 152 53 0 42 1 0 1 1 0 8 0 amappl10 144 23 0 19 2 1 1 1 0 8 0 amappl9 136 580 0 574 1 0 1 1 0 8 0 amappl8 128 132 0 100 2 0 2 2 0 8 0 amappl7 120 101 0 88 1 0 1 1 0 8 0 amappl6 112 56 0 49 1 0 1 1 0 8 0 amappl5 104 119 0 110 1 0 1 1 0 8 0 amappl4 96 460 0 436 1 0 1 1 0 8 0 amappl3 88 117 0 108 1 0 1 1 0 8 0 amappl2 80 1072 0 1002 3 1 2 3 0 8 0 amappl1 72 14264 0 13807 24 12 12 20 0 8 2 amappl 80 563 0 520 2 0 2 2 0 84 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 234 0 218 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 234 0 218 1 0 1 1 0 8 0 vmmpekpl 168 5742 0 5718 2 0 2 2 0 8 0 vmmpepl 168 36682 0 34682 122 10 112 115 0 357 21 vmsppl 368 233 0 218 2 0 2 2 0 8 0 pdppl 4096 475 0 436 6 0 6 6 0 8 0 pvpl 32 135637 0 118723 176 0 176 176 0 265 35 pmappl 232 233 0 218 2 1 1 2 0 8 0 extentpl 40 50 0 32 1 0 1 1 0 8 0 phpool 112 160 0 2 5 0 5 5 0 8 0