witness: lock order reversal: 1st 0xfffffd807f7d5438 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80526f9700 inode (&ip->i_lock) lock order data w2 -> w1 missing lock order data w1 -> w2 missing 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:399 witness_checkorder(fffffd80526f9700,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80526f9700,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80526f96f0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80526f96f0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd805a7cc3e8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd805a7cc3e8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd804e67aa68,0,ffff8000256b5868,ffff8000256b5838,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd804e67aa68,0,ffff8000256b5868,ffff8000256b5838,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b59d0,ffff8000256b5a08,ffff8000256b5950,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f008000,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5b60,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256b5b60) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5da0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5da0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa945c813050, count: -15 ddb{1}> show registers rdi 0xffff80002349a000 rsi 0x144d5 acpi_pdirpa+0x33d rbp 0xffff8000256b54e0 rbx 0x3 rdx 0xffff80002349a000 rcx 0x144d4 acpi_pdirpa+0x33c rax 0xffffffff81f0b7c7 db_enter+0x17 r8 0xffffffff81dba31c witness_checkorder+0x10cc r9 0x5 r10 0x7d98894966e1b665 r11 0xeaf32079bb3e1267 r12 0xfffffd8002daa7c0 r13 0 r14 0 r15 0 rip 0xffffffff81f0b7c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256b54d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=213309 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800021247a48,0xffff8000212467f8 process=0xffff8000ffffa5b8 user=0xffff8000256b0000, vmspace=0xfffffd807f008000 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 36241 71770 95468 32767 2 0x10 syz-executor.1 *36241 213309 95468 32767 7 0x4000010 syz-executor.1 36241 422104 95468 32767 3 0x4000090 fsleep syz-executor.1 95468 469540 94537 32767 3 0x90 nanoslp syz-executor.1 50149 191470 7181 32767 3 0x10 biowait syz-executor.0 94537 346592 76596 0 3 0x82 wait syz-executor.1 7181 47309 76596 0 3 0x82 wait syz-executor.0 76596 170712 5885 0 3 0x82 thrsleep syz-fuzzer 76596 53705 5885 0 3 0x4000082 nanoslp syz-fuzzer 76596 112182 5885 0 3 0x4000082 thrsleep syz-fuzzer 76596 162149 5885 0 3 0x4000082 thrsleep syz-fuzzer 76596 354173 5885 0 7 0x4000002 syz-fuzzer 76596 121380 5885 0 3 0x4000082 thrsleep syz-fuzzer 76596 233832 5885 0 3 0x4000082 kqread syz-fuzzer 76596 506602 5885 0 3 0x4000082 thrsleep syz-fuzzer 5885 280476 17455 0 3 0x10008a sigsusp ksh 17455 177081 32468 0 3 0x9a select sshd 18762 368990 1 0 3 0x100083 ttyin getty 32468 8686 1 0 3 0x88 select sshd 66363 17649 33062 73 3 0x100090 kqread syslogd 33062 99505 1 0 3 0x100082 netio syslogd 81714 206134 1 0 3 0x100080 kqread resolvd 35884 384435 490 77 3 0x100092 kqread dhcpleased 70976 464608 490 77 3 0x100092 kqread dhcpleased 490 61490 1 0 3 0x80 kqread dhcpleased 74888 493553 0 0 3 0x14200 bored smr 82646 465047 0 0 3 0x14200 pgzero zerothread 13715 440843 0 0 3 0x14200 aiodoned aiodoned 39546 426664 0 0 3 0x14200 syncer update 51288 9914 0 0 3 0x14200 cleaner cleaner 99955 391208 0 0 3 0x14200 reaper reaper 56652 35244 0 0 3 0x14200 pgdaemon pagedaemon 72938 127013 0 0 3 0x14200 bored crynlk 22539 398528 0 0 3 0x14200 bored crypto 79310 361106 0 0 3 0x14200 bored viomb 28892 358011 0 0 3 0x40014200 acpi0 acpi0 55497 35844 0 0 3 0x40014200 idle1 99380 28637 0 0 3 0x14200 bored softnet 88514 81230 0 0 3 0x14200 bored systqmp 71296 311708 0 0 3 0x14200 bored systq 9786 239316 0 0 3 0x40014200 bored softclock 85268 82853 0 0 3 0x40014200 idle0 1 335709 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 36241 (syz-executor.1) thread 0xffff800021247508 (213309) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828fdde0) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 uvm_fault+0x224 sys/uvm/uvm_fault.c:637 #2 kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 #3 kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 #4 alltraps_kern_meltdown+0x7b #5 copyout+0x53 #6 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #6 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #7 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd807f7d5438) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 dopipe+0xd6 #2 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #3 Xsyscall+0x128 Process 50149 (syz-executor.0) thread 0xffff800021246d28 (191470) exclusive rrwlock inode r = 0 (0xfffffd80526f90a0) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:579 #5 vget+0x1eb sys/kern/vfs_subr.c:676 #6 ufs_ihashget+0x121 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x7c sys/ufs/ffs/ffs_vfsops.c:1321 #8 ufs_lookup+0x145f sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:88 #10 vfs_lookup+0x737 sys/kern/vfs_lookup.c:561 #11 namei+0x55a sys/kern/vfs_lookup.c:245 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1854 #13 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80526f9b40) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:579 #5 vfs_lookup+0xdd sys/kern/vfs_lookup.c:413 #6 namei+0x55a sys/kern/vfs_lookup.c:245 #7 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1854 #8 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10118 6354K 6380K 78643K 11208 0 pcb 13 8K 8K 78643K 13 0 rtable 106 3K 3K 78643K 168 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 66 0 iov 0 0K 12K 78643K 135 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1216 76K 76K 78643K 1233 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 15 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 6881 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 34272 0 sigio 0 0K 0K 78643K 12 0 proc 56 74K 99K 78643K 282 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 6 0 in_multi 33 2K 2K 78643K 34 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 55 254K 254K 78643K 55 0 exec 0 0K 2K 78643K 370 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 655 70K 70K 78643K 408228 0 UVM aobj 21 6K 6K 78643K 21 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 9 0 temp 102 4209K 4273K 78643K 70641 0 kqueue 10 14K 18K 78643K 52 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 plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 27 0 24 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 2797 0 2784 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 2047 0 2047 4 4 0 2 0 8 0 tcpcb 736 9297 0 9271 45 42 3 8 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 9332 0 9325 1 0 1 1 0 8 0 nd6 48 6 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 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 semupl 112 5 0 5 1 1 0 1 0 8 0 semapl 112 6879 0 6869 1 0 1 1 0 8 0 shmpl 112 18 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 35751 0 34347 88 0 88 88 0 8 0 ffsino 272 35751 0 34347 95 1 94 94 0 8 0 nchpl 144 77710 0 76097 60 0 60 60 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 186420 0 186420 2 1 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 210744 0 210743 11 10 1 8 0 8 0 plimitpl 152 24 0 14 1 0 1 1 0 8 0 sigapl 424 34494 0 34460 5 1 4 5 0 8 0 futexpl 56 220128 0 220127 1 0 1 1 0 8 0 knotepl 112 60 0 0 2 0 2 2 0 8 0 kqueuepl 216 41884 0 41873 3 1 2 2 0 8 1 pipepl 336 1066 0 1054 13 11 2 2 0 8 1 fdescpl 496 34478 0 34460 3 0 3 3 0 8 0 filepl 152 124313 0 124198 5 0 5 5 0 8 0 lockfpl 104 71 0 69 1 0 1 1 0 8 0 lockfspl 48 29 0 27 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 15523 0 15511 1 0 1 1 0 8 0 zombiepl 144 34460 0 34460 2 1 1 1 0 8 1 processpl 1072 34494 0 34460 3 0 3 3 0 8 0 procpl 672 70413 0 70370 8 3 5 5 0 8 1 sockpl 480 12235 0 12212 14 10 4 5 0 8 1 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 18 0 0 2 0 2 2 0 8 0 mcl9k 9216 10 0 0 1 0 1 1 0 8 0 mcl8k 8192 15 0 0 2 0 2 2 0 8 0 mcl4k 4096 19 0 0 3 0 3 3 0 8 0 mcl2k2 2112 18 0 0 2 0 2 2 0 8 0 mcl2k 2048 551 0 0 49 17 32 49 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1068 0 0 31 0 31 31 0 8 0 bufpl 280 37600 0 31268 453 0 453 453 0 8 0 anonpl 24 8574767 0 8472810 723 27 696 722 0 186 0 amapchunkpl 152 952894 0 948956 163 1 162 162 0 158 0 amappl16 200 53738 0 50429 198 22 176 187 0 8 0 amappl15 192 2 0 2 2 2 0 1 0 8 0 amappl14 184 34247 0 34243 1 0 1 1 0 8 0 amappl13 176 76 0 72 1 0 1 1 0 8 0 amappl12 168 6 0 5 1 0 1 1 0 8 0 amappl11 160 38 0 27 1 0 1 1 0 8 0 amappl10 152 37 0 29 1 0 1 1 0 8 0 amappl9 144 242 0 238 1 0 1 1 0 8 0 amappl8 136 374 0 320 2 0 2 2 0 8 0 amappl7 128 70 0 56 1 0 1 1 0 8 0 amappl6 120 115 0 101 1 0 1 1 0 8 0 amappl5 112 20102 0 20087 1 0 1 1 0 8 0 amappl4 104 17618 0 17585 1 0 1 1 0 8 0 amappl3 96 1309 0 1306 1 0 1 1 0 8 0 amappl2 88 509 0 456 2 0 2 2 0 8 0 amappl1 80 603784 0 603342 13 3 10 12 0 8 0 amappl 88 401662 0 401075 14 0 14 14 0 92 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 20 0 0 1 0 1 1 0 8 0 uaddrrnd 24 34478 0 34460 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 34478 0 34460 1 0 1 1 0 8 0 vmmpekpl 168 125442 0 125419 2 0 2 2 0 8 0 vmmpepl 168 3887646 0 3882467 392 161 231 380 0 357 1 vmsppl 368 34477 0 34460 2 0 2 2 0 8 0 rwobjpl 56 636549 0 632066 70 6 64 67 0 8 0 pdppl 4096 68964 0 68920 72 26 46 50 0 8 2 pvpl 32 18467591 0 18361824 1002 44 958 1002 0 265 0 pmappl 224 34477 0 34460 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 427 0 100 10 0 10 10 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff82761ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:353 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x37 kd_curproc sys/dev/kcov.c:570 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x37 sys/dev/kcov.c:143 __mp_lock(ffffffff828fdbd8) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828fdbd8) at __mp_lock+0x133 sys/kern/kern_lock.c:147 intr_handler(ffff800021245ef0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f end of kernel end trace frame: 0xc001dc3ae8, count: -7 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:399 witness_checkorder(fffffd80526f9700,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80526f9700,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80526f96f0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80526f96f0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd805a7cc3e8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd805a7cc3e8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd804e67aa68,0,ffff8000256b5868,ffff8000256b5838,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd804e67aa68,0,ffff8000256b5868,ffff8000256b5838,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b59d0,ffff8000256b5a08,ffff8000256b5950,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f008000,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5b60,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256b5b60) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5da0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5da0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa945c813050, count: -15