login: witness: lock order reversal: 1st 0xfffffd8008462188 vmmaplk (&map->lock) 2nd 0xfffffd804ab50a28 inode (&ip->i_lock) lock order "&ip->i_lock"(rrwlock) -> "&map->lock"(rwlock) first seen at: #0 witness_checkorder+0x65e witness_lock_order_add sys/kern/subr_witness.c:2463 [inline] #0 witness_checkorder+0x65e sys/kern/subr_witness.c:880 #1 rw_enter_read+0x66 sys/kern/kern_rwlock.c:111 #2 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1438 #3 uvm_fault+0x7e sys/uvm/uvm_fault.c:526 #4 kpageflttrap+0x210 sys/arch/amd64/amd64/trap.c:267 #5 kerntrap+0xef sys/arch/amd64/amd64/trap.c:322 #6 alltraps_kern_meltdown+0x7b #7 copyout+0x53 #8 ffs_read+0x3e2 sys/ufs/ffs/ffs_vnops.c:258 #9 VOP_READ+0xbf sys/kern/vfs_vops.c:253 #10 vn_rdwr+0x10b #11 vmcmd_map_readvn+0xda sys/kern/exec_subr.c:246 #12 exec_process_vmcmds+0xb2 sys/kern/exec_subr.c:143 #13 sys_execve+0x9ff sys/kern/kern_exec.c:461 #14 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #14 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:591 #15 Xsyscall+0x128 lock order "&map->lock"(rwlock) -> "&ip->i_lock"(rrwlock) first seen at: #0 witness_checkorder+0x65e witness_lock_order_add sys/kern/subr_witness.c:2463 [inline] #0 witness_checkorder+0x65e sys/kern/subr_witness.c:880 #1 rw_enter+0xd4 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 #4 vn_lock+0x6c sys/kern/vfs_vnops.c:575 #5 uvn_io+0x2b5 sys/uvm/uvm_vnode.c:1196 #6 uvn_get+0x226 sys/uvm/uvm_vnode.c:1056 #7 uvm_fault+0x1197 sys/uvm/uvm_fault.c:1016 #8 uvm_fault_wire+0x63 sys/uvm/uvm_fault.c:1285 #9 uvm_map_pageable_wire+0x30d sys/uvm/uvm_map.c:2367 #10 sys_mlock+0x180 sys/uvm/uvm_mmap.c:772 #11 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #11 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:591 #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(fffffd804ab50a28,9,0) at witness_checkorder+0xf5a witness_debugger sys/kern/subr_witness.c:2490 [inline] witness_checkorder(fffffd804ab50a28,9,0) at witness_checkorder+0xf5a sys/kern/subr_witness.c:1087 rw_enter(fffffd804ab50a18,81) at rw_enter+0xd4 rrw_enter(fffffd804ab50a18,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:462 VOP_LOCK(fffffd804c88e8f8,81) at VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 vn_lock(fffffd804c88e8f8,81) at vn_lock+0x6c sys/kern/vfs_vnops.c:575 uvn_io(fffffd80480217f8,ffff800025711a48,1,2,0) at uvn_io+0x2b5 sys/uvm/uvm_vnode.c:1196 uvn_get(fffffd80480217f8,1000,ffff800025711ca0,ffff800025711c3c,0,5) at uvn_get+0x226 sys/uvm/uvm_vnode.c:1056 uvm_fault(fffffd8008462170,20001000,2,5) at uvm_fault+0x1197 sys/uvm/uvm_fault.c:1016 uvm_fault_wire(fffffd8008462170,20001000,20002000,5) at uvm_fault_wire+0x63 sys/uvm/uvm_fault.c:1285 uvm_map_pageable_wire(fffffd8008462170,fffffd804e85ca40,fffffd804e862b60,3c6,ffffffff81e4522e,0) at uvm_map_pageable_wire+0x30d sys/uvm/uvm_map.c:2367 sys_mlock(ffff8000ffff4018,ffff800025711e88,ffff800025711ed0) at sys_mlock+0x180 sys/uvm/uvm_mmap.c:772 syscall(ffff800025711f50) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800025711f50) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:591 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xee1c02185b0, count: -14 ddb{1}> show registers rdi 0x3 rsi 0x40000 acpi_pdirpa+0x2be68 rbp 0xffff8000257116a0 rbx 0x3 rdx 0xffff800000afce40 rcx 0x3 rax 0x3ffff acpi_pdirpa+0x2be67 r8 0xffffffff81e42ed3 witness_checkorder+0xf33 r9 0x5 r10 0xbd205573718225db r11 0x38d0a068445777d0 r12 0xffffffff82879400 w_lodata+0x542d0 r13 0 r14 0xffffffff82867ce0 w_lodata+0x42bb0 r15 0xfffffd8002c98500 rip 0xffffffff8103b618 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800025711690 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=157886 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4f78,0xffff8000ffff4548 process=0xffff8000ffff31a0 user=0xffff80002570d000, vmspace=0xfffffd8008462170 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 32180 231805 33278 32767 2 0x10 syz-executor.0 *32180 157886 33278 32767 7 0x4000010 syz-executor.0 32180 362240 33278 32767 3 0x4000090 fsleep syz-executor.0 44040 487640 67669 32767 3 0x90 nanosleep syz-executor.1 33278 510849 82948 32767 3 0x90 nanosleep syz-executor.0 67669 85666 18181 0 3 0x82 wait syz-executor.1 82948 104948 18181 0 3 0x82 wait syz-executor.0 18181 152745 47859 0 3 0x82 thrsleep syz-fuzzer 18181 132721 47859 0 3 0x4000082 nanosleep syz-fuzzer 18181 277383 47859 0 3 0x4000082 thrsleep syz-fuzzer 18181 497752 47859 0 3 0x4000082 thrsleep syz-fuzzer 18181 426162 47859 0 3 0x4000082 thrsleep syz-fuzzer 18181 449228 47859 0 3 0x4000082 thrsleep syz-fuzzer 18181 150225 47859 0 3 0x4000082 kqread syz-fuzzer 18181 455101 47859 0 3 0x4000082 nanosleep syz-fuzzer 47859 228374 54340 0 3 0x10008a pause ksh 54340 34816 68326 0 3 0x92 select sshd 36450 174746 1 0 3 0x100083 ttyin getty 68326 179153 1 0 3 0x80 select sshd 12729 357098 12322 73 3 0x100090 kqread syslogd 12322 182758 1 0 3 0x100082 netio syslogd 74935 418696 1 77 3 0x100090 poll dhclient 33257 56756 1 0 3 0x80 poll dhclient 39589 100059 0 0 3 0x14200 bored smr 47192 105337 0 0 3 0x14200 pgzero zerothread 86508 336455 0 0 3 0x14200 aiodoned aiodoned 78650 277550 0 0 3 0x14200 syncer update 70773 61947 0 0 3 0x14200 cleaner cleaner 52252 423087 0 0 7 0x14200 reaper 71532 3212 0 0 3 0x14200 pgdaemon pagedaemon 55223 212549 0 0 3 0x14200 bored crynlk 29702 227434 0 0 3 0x14200 bored crypto 63705 213975 0 0 3 0x14200 bored viomb 90808 463677 0 0 3 0x40014200 acpi0 acpi0 98842 366182 0 0 3 0x40014200 idle1 89471 146858 0 0 3 0x14200 bored softnet 64796 164308 0 0 3 0x14200 bored systqmp 60259 411739 0 0 3 0x14200 bored systq 79051 204919 0 0 3 0x40014200 bored softclock 8326 151343 0 0 3 0x40014200 idle0 1 229700 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 32180 (syz-executor.0) thread 0xffff8000ffff4018 (157886) shared rwlock vmmaplk r = 0 (0xfffffd8008462188) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1164 #1 rw_enter+0x446 sys/kern/kern_rwlock.c:311 #2 vm_map_lock_ln+0xda sys/uvm/uvm_map.c:5463 #3 uvm_map_pageable+0x120 sys/uvm/uvm_map.c:2463 #4 sys_mlock+0x180 sys/uvm/uvm_mmap.c:772 #5 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #5 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:591 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828822a0) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1164 #1 syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] #1 syscall+0x3fd sys/arch/amd64/amd64/trap.c:591 #2 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9475 6349K 6349K 78643K 10566 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 191 0 ifaddr 39 10K 10K 78643K 39 0 counters 43 33K 33K 78643K 43 0 ioctlops 0 0K 2K 78643K 400 0 iov 0 0K 16K 78643K 36 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1221 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 8 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 22 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1825 197K 290K 78643K 13109 0 file desc 7 21K 33K 78643K 8400 0 proc 48 50K 70K 78643K 380 0 subproc 34 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 803 0 in_multi 33 2K 2K 78643K 391 0 ether_multi 1 0K 0K 78643K 3 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 31 148K 148K 78643K 31 0 exec 0 0K 2K 78643K 320 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 966 95K 96K 78643K 20452 0 UVM aobj 14 2K 2K 78643K 17 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 6 0 NDP 5 0K 0K 78643K 9 0 temp 70 3953K 4017K 78643K 18575 0 kqueue 3 4K 5K 78643K 13 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 21 0 19 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 408 0 400 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 1723 0 1723 4 4 0 3 0 8 0 tcpcb 736 1321 0 1317 14 12 2 7 0 8 1 inpcb 296 1748 0 1741 3 2 1 2 0 8 0 nd6 48 7 0 0 1 0 1 1 0 8 0 kcovpl 48 2 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 190 0 0 12 0 12 12 0 8 0 art_table 32 191 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 10 0 10 3 3 0 1 0 8 0 semupl 112 6 0 6 1 1 0 1 0 8 0 semapl 112 18 0 8 1 0 1 1 0 8 0 shmpl 112 14 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 12230 0 10833 88 0 88 88 0 8 0 ffsino 272 12230 0 10833 94 0 94 94 0 8 0 nchpl 144 24984 0 23384 60 0 60 60 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 208 5926 0 0 312 0 312 312 0 8 0 namei 1024 47489 0 47489 4 3 1 1 0 8 1 percpumem 16 32 0 0 1 0 1 1 0 8 0 scxspl 216 104910 0 104910 30 27 3 8 0 8 3 plimitpl 152 21 0 12 1 0 1 1 0 8 0 sigapl 424 8588 0 8556 4 0 4 4 0 8 0 futexpl 56 52576 0 52575 2 1 1 1 0 8 0 knotepl 112 70 0 50 1 0 1 1 0 8 0 kqueuepl 152 8167 0 8163 1 0 1 1 0 8 0 pipepl 304 611 0 600 5 4 1 2 0 8 0 fdescpl 496 8572 0 8556 3 0 3 3 0 8 0 filepl 152 24938 0 24836 10 5 5 5 0 8 1 lockfpl 104 52 0 51 1 0 1 1 0 8 0 lockfspl 48 19 0 18 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 273 0 264 1 0 1 1 0 8 0 zombiepl 144 8556 0 8555 3 2 1 1 0 8 0 processpl 1056 8588 0 8555 5 2 3 3 0 8 0 procpl 656 17170 0 17128 4 0 4 4 0 8 0 sockpl 400 2618 0 2601 7 4 3 3 0 8 1 mcl64k 65536 17 0 0 3 0 3 3 0 8 0 mcl16k 16384 7 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 10 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 18 0 0 3 0 3 3 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 430 0 0 50 0 50 50 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 432 0 0 25 0 25 25 0 8 0 bufpl 280 53303 0 47056 447 0 447 447 0 8 0 anonpl 16 875895 0 707472 685 7 678 678 0 124 1 amapchunkpl 152 35536 0 28311 281 3 278 278 0 158 0 amappl16 192 26619 0 23319 169 3 166 166 0 8 0 amappl15 184 10 0 5 1 0 1 1 0 8 0 amappl14 176 4309 0 4299 1 0 1 1 0 8 0 amappl13 168 388 0 386 1 0 1 1 0 8 0 amappl12 160 15 0 9 1 0 1 1 0 8 0 amappl11 152 50 0 41 1 0 1 1 0 8 0 amappl10 144 4106 0 4099 1 0 1 1 0 8 0 amappl9 136 368 0 367 2 1 1 1 0 8 0 amappl8 128 131 0 96 2 0 2 2 0 8 0 amappl7 120 219 0 209 1 0 1 1 0 8 0 amappl6 112 4150 0 4139 1 0 1 1 0 8 0 amappl5 104 4796 0 4777 1 0 1 1 0 8 0 amappl4 96 4547 0 4516 1 0 1 1 0 8 0 amappl3 88 293 0 285 1 0 1 1 0 8 0 amappl2 80 60606 0 60532 2 0 2 2 0 8 0 amappl1 72 259462 0 258942 24 14 10 18 0 8 0 amappl 80 18272 0 17353 19 0 19 19 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 16 0 3 1 0 1 1 0 8 0 uaddrrnd 24 8572 0 8556 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 8572 0 8556 1 0 1 1 0 8 0 vmmpekpl 168 35089 0 35064 3 1 2 2 0 8 0 vmmpepl 168 1118238 0 1112655 387 141 246 364 0 357 2 vmsppl 368 8571 0 8555 2 0 2 2 0 8 0 pdppl 4096 17151 0 17110 6 0 6 6 0 8 0 pvpl 32 2427655 0 2255609 1423 28 1395 1395 0 265 6 pmappl 232 8571 0 8555 2 1 1 2 0 8 0 extentpl 40 57 0 39 1 0 1 1 0 8 0 phpool 112 317 0 21 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff82733ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff82882098) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82882098) at __mp_lock+0x122 sys/kern/kern_lock.c:147 intr_handler(ffff8000211d13f0,ffff80000065a300) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge4_untramp() at Xintr_ioapic_edge4_untramp+0x19f __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x43 sys/dev/kcov.c:149 __mp_lock(ffffffff82882098) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82882098) at __mp_lock+0x133 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __mp_lock(ffffffff82882098) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82882098) at __mp_lock+0x129 sys/kern/kern_lock.c:147 uvm_unmap_detach(ffff8000211d16c0,1) at uvm_unmap_detach+0xfc sys/uvm/uvm_map.c:1588 uvm_map_teardown(fffffd8008462b80) at uvm_map_teardown+0x262 sys/uvm/uvm_map.c:2764 uvmspace_free(fffffd8008462b80) at uvmspace_free+0xa6 sys/uvm/uvm_map.c:3664 reaper(ffff8000211d3718) at reaper+0x189 sys/kern/kern_exit.c:457 end trace frame: 0x0, count: -15 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd804ab50a28,9,0) at witness_checkorder+0xf5a witness_debugger sys/kern/subr_witness.c:2490 [inline] witness_checkorder(fffffd804ab50a28,9,0) at witness_checkorder+0xf5a sys/kern/subr_witness.c:1087 rw_enter(fffffd804ab50a18,81) at rw_enter+0xd4 rrw_enter(fffffd804ab50a18,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:462 VOP_LOCK(fffffd804c88e8f8,81) at VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 vn_lock(fffffd804c88e8f8,81) at vn_lock+0x6c sys/kern/vfs_vnops.c:575 uvn_io(fffffd80480217f8,ffff800025711a48,1,2,0) at uvn_io+0x2b5 sys/uvm/uvm_vnode.c:1196 uvn_get(fffffd80480217f8,1000,ffff800025711ca0,ffff800025711c3c,0,5) at uvn_get+0x226 sys/uvm/uvm_vnode.c:1056 uvm_fault(fffffd8008462170,20001000,2,5) at uvm_fault+0x1197 sys/uvm/uvm_fault.c:1016 uvm_fault_wire(fffffd8008462170,20001000,20002000,5) at uvm_fault_wire+0x63 sys/uvm/uvm_fault.c:1285 uvm_map_pageable_wire(fffffd8008462170,fffffd804e85ca40,fffffd804e862b60,3c6,ffffffff81e4522e,0) at uvm_map_pageable_wire+0x30d sys/uvm/uvm_map.c:2367 sys_mlock(ffff8000ffff4018,ffff800025711e88,ffff800025711ed0) at sys_mlock+0x180 sys/uvm/uvm_mmap.c:772 syscall(ffff800025711f50) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800025711f50) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:591 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xee1c02185b0, count: -14