witness: lock order reversal: 1st 0xfffffd807f0088b8 vmmaplk (&map->lock) 2nd 0xfffffd8070594920 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{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(fffffd8070594920,9,0) at witness_checkorder+0x1009 witness_debugger sys/kern/subr_witness.c:2504 [inline] witness_checkorder(fffffd8070594920,9,0) at witness_checkorder+0x1009 sys/kern/subr_witness.c:1086 rw_enter(fffffd8070594910,81) at rw_enter+0xd4 rrw_enter(fffffd8070594910,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:453 VOP_LOCK(fffffd8067530020,81) at VOP_LOCK+0xf9 sys/kern/vfs_vops.c:615 vn_lock(fffffd8067530020,81) at vn_lock+0x81 sys/kern/vfs_vnops.c:571 uvn_io(fffffd8062e59a30,ffff800024f65688,1,2,0) at uvn_io+0x2c8 sys/uvm/uvm_vnode.c:1189 uvn_get(fffffd8062e59a30,0,ffff800024f658e0,ffff800024f65874,0,1) at uvn_get+0x226 sys/uvm/uvm_vnode.c:1049 uvm_fault(fffffd807f0088a0,20002000,2,1) at uvm_fault+0x11cc sys/uvm/uvm_fault.c:1023 uvm_fault_wire(fffffd807f0088a0,20002000,20005000,1) at uvm_fault_wire+0x70 sys/uvm/uvm_fault.c:1295 uvm_map_pageable_wire(fffffd807f0088a0,fffffd8068486708,fffffd80684863c0,ffff800022d60000,0,0) at uvm_map_pageable_wire+0x2dd sys/uvm/uvm_map.c:2358 sys_mlock(ffff800020a99650,ffff800024f65ad8,ffff800024f65b20) at sys_mlock+0x185 sys/uvm/uvm_mmap.c:765 syscall(ffff800024f65ba0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800024f65ba0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc1295c91c00, count: -14 ddb{1}> show registers rdi 0x3 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024f65300 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022d60000 rax 0xffff800000a27e00 r8 0xffffffff818af532 witness_checkorder+0xfe2 r9 0x5 r10 0x3 r11 0x7e37f12745a11169 r12 0xfffffd800297c200 r13 0 r14 0xffffffff825ef630 w_lodata+0x43810 r15 0xffffffff82600f60 w_lodata+0x55140 rip 0xffffffff811551c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f652f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=83378 stat=onproc flags process=10 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a98290,0xffff800020a993e8 process=0xffff800020aece38 user=0xffff800024f60000, vmspace=0xfffffd807f0088a0 estcpu=36, cpticks=4, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 15731 128512 24991 32767 2 0x10 syz-executor.1 *15731 83378 24991 32767 7 0x4000010 syz-executor.1 15731 368069 24991 32767 3 0x4000090 fsleep syz-executor.1 24991 306261 38181 32767 3 0x90 nanosleep syz-executor.1 38181 338964 77548 0 3 0x82 wait syz-executor.1 97338 275832 0 0 3 0x14200 bored sosplice 43670 454651 7056 32767 3 0x90 nanosleep syz-executor.0 7056 412009 77548 0 3 0x82 wait syz-executor.0 77548 146327 3852 0 3 0x82 thrsleep syz-fuzzer 77548 350739 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 192989 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 25701 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 243780 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 494973 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 120316 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 192096 3852 0 3 0x4000082 thrsleep syz-fuzzer 77548 60791 3852 0 3 0x4000082 kqread syz-fuzzer 77548 272149 3852 0 3 0x4000082 thrsleep syz-fuzzer 3852 402167 48277 0 3 0x10008a pause ksh 48277 106230 22810 0 3 0x92 select sshd 77142 499380 1 0 3 0x100083 ttyin getty 22810 373319 1 0 3 0x80 select sshd 47168 247570 71493 73 3 0x100090 kqread syslogd 71493 339186 1 0 3 0x100082 netio syslogd 13360 108906 1 77 3 0x100090 poll dhclient 3913 420361 1 0 3 0x80 poll dhclient 18322 16631 0 0 3 0x14200 pgzero zerothread 69969 20810 0 0 3 0x14200 aiodoned aiodoned 64145 517672 0 0 3 0x14200 syncer update 97979 340496 0 0 3 0x14200 cleaner cleaner 40547 290312 0 0 7 0x14200 reaper 13420 190267 0 0 3 0x14200 pgdaemon pagedaemon 94464 216758 0 0 3 0x14200 bored crynlk 3116 463292 0 0 3 0x14200 bored crypto 49974 284154 0 0 3 0x40014200 acpi0 acpi0 66604 356890 0 0 3 0x40014200 idle1 74596 202180 0 0 3 0x14200 bored softnet 38422 270654 0 0 3 0x14200 bored systqmp 26329 124634 0 0 3 0x14200 bored systq 13665 509932 0 0 3 0x40014200 bored softclock 6563 403335 0 0 3 0x40014200 idle0 17558 28360 0 0 3 0x14200 bored smr 1 254846 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 15731 (syz-executor.1) thread 0xffff800020a99650 (83378) shared rwlock vmmaplk r = 0 (0xfffffd807f0088b8) #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 (0xffffffff82660f10) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9482 6334K 6334K 78643K 10670 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 1242 0 ifaddr 39 10K 10K 78643K 209 0 counters 39 33K 33K 78643K 39 0 ioctlops 0 0K 2K 78643K 76 0 iov 0 0K 32K 78643K 283 0 mount 1 1K 1K 78643K 1 0 vnodes 1215 76K 76K 78643K 1796 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 43 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 743 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 7 21K 33K 78643K 2251 0 sigio 0 0K 0K 78643K 59 0 proc 48 50K 82K 78643K 3699 0 subproc 34 2K 2K 78643K 442 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 232 0 in_multi 33 2K 2K 78643K 313 0 ether_multi 1 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 132 583K 583K 78643K 132 0 exec 0 0K 1K 78643K 607 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 150 33K 33K 78643K 7697 0 UVM aobj 130 4K 5K 78643K 138 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 1K 78643K 8502 0 NDP 5 0K 0K 78643K 81 0 temp 106 3034K 3126K 78643K 10547 0 kqueue 0 0K 0K 78643K 31 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 55 0 48 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 261 0 259 1 0 1 1 0 8 0 rtentry 112 286 0 241 2 0 2 2 0 8 0 unpcb 120 1473 0 1465 6 4 2 2 0 8 1 syncache 264 9 0 9 4 4 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 2 0 2 2 2 0 1 0 8 0 tcpcb 544 536 0 530 7 4 3 3 0 8 2 ipq 40 22 0 22 4 3 1 1 0 8 1 ipqe 40 782 0 782 4 3 1 1 0 8 1 inpcb 280 18118 0 18106 9 5 4 4 0 8 2 nd6 48 52 0 48 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1287 0 1071 14 0 14 14 0 8 0 art_table 32 1288 0 1071 2 0 2 2 0 8 0 art_node 16 285 0 244 1 0 1 1 0 8 0 sysvmsgpl 40 92 0 52 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 739 0 729 1 0 1 1 0 8 0 shmpl 112 136 0 8 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4768 0 3358 46 0 46 46 0 8 0 ffsino 272 4768 0 3358 95 0 95 95 0 8 0 nchpl 144 10651 0 9045 60 0 60 60 0 8 0 uvmvnodes 72 5219 0 0 95 0 95 95 0 8 0 vnodes 208 5219 0 0 275 0 275 275 0 8 0 namei 1024 56629 0 56629 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 24345 0 24345 17 16 1 5 0 8 1 plimitpl 152 256 0 247 1 0 1 1 0 8 0 sigapl 432 2350 0 2335 3 1 2 3 0 8 0 futexpl 56 91267 0 91266 2 1 1 1 0 8 0 knotepl 112 739 0 720 8 7 1 3 0 8 0 kqueuepl 104 738 0 736 3 2 1 3 0 8 0 pipepl 160 1320 0 1301 7 5 2 2 0 8 1 fdescpl 488 2351 0 2335 3 0 3 3 0 8 1 filepl 152 49910 0 49805 24 16 8 11 0 8 3 lockfpl 104 328 0 327 1 0 1 1 0 8 0 lockfspl 48 110 0 109 1 0 1 1 0 8 0 sessionpl 112 41 0 31 1 0 1 1 0 8 0 pgrppl 48 53 0 43 1 0 1 1 0 8 0 ucredpl 96 21385 0 21376 1 0 1 1 0 8 0 zombiepl 144 2335 0 2334 3 2 1 1 0 8 0 processpl 904 2367 0 2334 4 0 4 4 0 8 0 procpl 632 5833 0 5789 11 6 5 5 0 8 1 srpgc 64 48 0 48 6 6 0 1 0 8 0 sosppl 128 33 0 33 6 5 1 1 0 8 1 sockpl 384 19896 0 19877 34 24 10 10 0 8 7 mcl64k 65536 18 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 150 0 0 17 1 16 17 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 552 0 0 21 0 21 21 0 8 0 bufpl 280 10806 0 3740 505 0 505 505 0 8 0 anonpl 16 303556 0 286186 117 39 78 79 0 125 8 amapchunkpl 152 16622 0 16352 28 17 11 11 0 158 0 amappl16 192 10992 0 10127 110 59 51 56 0 8 7 amappl15 184 260 0 255 1 0 1 1 0 8 0 amappl14 176 302 0 298 1 0 1 1 0 8 0 amappl13 168 45 0 45 3 3 0 1 0 8 0 amappl12 160 263 0 261 1 0 1 1 0 8 0 amappl11 152 1330 0 1314 1 0 1 1 0 8 0 amappl10 144 167 0 162 1 0 1 1 0 8 0 amappl9 136 939 0 936 1 0 1 1 0 8 0 amappl8 128 399 0 351 2 0 2 2 0 8 0 amappl7 120 367 0 351 1 0 1 1 0 8 0 amappl6 112 1248 0 1237 1 0 1 1 0 8 0 amappl5 104 1537 0 1528 1 0 1 1 0 8 0 amappl4 96 2543 0 2509 1 0 1 1 0 8 0 amappl3 88 481 0 474 1 0 1 1 0 8 0 amappl2 80 16189 0 16112 3 1 2 3 0 8 0 amappl1 72 62856 0 62370 24 14 10 20 0 8 0 amappl 80 6492 0 6441 2 0 2 2 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 137 0 8 3 0 3 3 0 8 0 uaddrrnd 24 2351 0 2335 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2351 0 2335 1 0 1 1 0 8 0 vmmpekpl 168 20051 0 20021 2 0 2 2 0 8 0 vmmpepl 168 310874 0 308606 180 57 123 124 0 357 24 vmsppl 368 2350 0 2334 2 0 2 2 0 8 0 pdppl 4096 4709 0 4668 7 1 6 6 0 8 0 pvpl 32 796493 0 775403 258 67 191 191 0 265 19 pmappl 232 2350 0 2334 2 1 1 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 188 0 10 6 0 6 6 0 8 0