witness: lock order reversal: 1st 0xfffffd80698bba18 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd8066428708 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{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(fffffd8066428708,9,0) at witness_checkorder+0x108b rw_enter(fffffd80664286f8,81) at rw_enter+0xd4 rrw_enter(fffffd80664286f8,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8069210a98,81) at VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 vn_lock(fffffd8069210a98,81) at vn_lock+0x6c sys/kern/vfs_vnops.c:575 uvn_get(fffffd8064e670f0,0,ffff800021268718,ffff8000212686e8,0,0) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8064e670f0,0,ffff800021268718,ffff8000212686e8,0,0) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800021268880,ffff8000212688b8,ffff800021268800,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f01a730,20000000,0,2) at uvm_fault+0x23e sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021268a10,20000080) at kpageflttrap+0x202 sys/arch/amd64/amd64/trap.c:265 kerntrap(ffff800021268a10) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:321 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021268c40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021268c40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa09cd5e7070, count: -15 ddb{0}> show registers rdi 0xffff8000212a7000 rsi 0x14a08 acpi_pdirpa+0x870 rbp 0xffff8000212683a0 rbx 0x3 rdx 0xffff8000212a7000 rcx 0x14a07 acpi_pdirpa+0x86f rax 0xffffffff812a50b7 db_enter+0x17 r8 0xffffffff81a82921 witness_checkorder+0x1061 r9 0x5 r10 0xec4229a72aa416dc r11 0xf94967a784ebe733 r12 0 r13 0xfffffd8066428708 r14 0 r15 0xfffffd8002ced680 rip 0xffffffff812a50b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021268390 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=160817 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4fc0,0xffff8000ffff5270 process=0xffff8000ffff1530 user=0xffff800021263000, vmspace=0xfffffd807f01a730 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 71884 18875 1587 32767 2 0x10 syz-executor.1 30921 377917 42730 32767 2 0x10 syz-executor.0 *30921 160817 42730 32767 7 0x4000010 syz-executor.0 30921 50777 42730 32767 7 0x4000090 syz-executor.0 42730 318511 59938 32767 3 0x90 nanoslp syz-executor.0 59938 334302 56518 0 3 0x82 wait syz-executor.0 47603 36530 0 0 3 0x14200 bored sosplice 1587 5861 7082 32767 3 0x90 nanoslp syz-executor.1 7082 95703 56518 0 3 0x82 wait syz-executor.1 56518 76075 47861 0 3 0x82 thrsleep syz-fuzzer 56518 481035 47861 0 3 0x4000082 nanoslp syz-fuzzer 56518 143203 47861 0 3 0x4000082 thrsleep syz-fuzzer 56518 101377 47861 0 3 0x4000082 thrsleep syz-fuzzer 56518 5147 47861 0 3 0x4000082 thrsleep syz-fuzzer 56518 101395 47861 0 3 0x4000082 thrsleep syz-fuzzer 56518 126444 47861 0 3 0x4000082 thrsleep syz-fuzzer 56518 520645 47861 0 3 0x4000082 kqread syz-fuzzer 47861 270245 38842 0 3 0x10008a sigsusp ksh 38842 104301 19468 0 3 0x92 select sshd 45043 244130 1 0 3 0x100083 ttyin getty 19468 378158 1 0 3 0x80 select sshd 58142 91182 65709 73 3 0x100090 kqread syslogd 65709 113319 1 0 3 0x100082 netio syslogd 45074 451150 1 77 3 0x100090 poll dhclient 21040 494999 1 0 3 0x80 poll dhclient 63295 465776 0 0 3 0x14200 bored smr 7405 331809 0 0 2 0x14200 zerothread 44379 47721 0 0 3 0x14200 aiodoned aiodoned 15130 272112 0 0 3 0x14200 syncer update 13334 100540 0 0 3 0x14200 cleaner cleaner 77527 147931 0 0 3 0x14200 reaper reaper 64478 429315 0 0 3 0x14200 pgdaemon pagedaemon 53176 456043 0 0 3 0x14200 bored crynlk 80499 447258 0 0 3 0x14200 bored crypto 96429 429487 0 0 3 0x14200 bored viomb 21379 132009 0 0 3 0x40014200 acpi0 acpi0 49078 50524 0 0 3 0x40014200 idle1 90558 102163 0 0 3 0x14200 bored softnet 99367 68563 0 0 3 0x14200 bored systqmp 21575 413446 0 0 3 0x14200 bored systq 68848 517761 0 0 3 0x40014200 bored softclock 10618 252117 0 0 3 0x40014200 idle0 1 458607 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 30921 (syz-executor.0) thread 0xffff8000ffff5ce0 (160817) exclusive kernel_lock &kernel_lock r = 1 (0xffffffff827b8288) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 kpageflttrap+0x1f1 sys/arch/amd64/amd64/trap.c:265 #2 kerntrap+0xef sys/arch/amd64/amd64/trap.c:321 #3 alltraps_kern_meltdown+0x7b #4 copyout+0x53 #5 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #5 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #6 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd80698bba18) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 sys_socketpair+0x219 #2 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #3 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9482 6350K 6350K 78643K 10575 0 pcb 13 8K 8K 78643K 13 0 rtable 109 3K 3K 78643K 348 0 ifaddr 39 10K 10K 78643K 46 0 sysctl 3 1K 1K 78643K 5 0 counters 44 34K 34K 78643K 46 0 ioctlops 0 0K 2K 78643K 104 0 iov 0 0K 12K 78643K 136 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1217 77K 77K 78643K 1421 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 17 0 VM map 2 1K 1K 78643K 2 0 sem 11 1K 1K 78643K 15 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 6317 0 sigio 0 0K 0K 78643K 33 0 proc 48 50K 83K 78643K 814 0 subproc 34 2K 2K 78643K 51 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 401 0 in_multi 33 2K 2K 78643K 188 0 ether_multi 1 0K 0K 78643K 13 0 mrt 0 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 717 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 286 36K 36K 78643K 78917 0 UVM aobj 108 3K 3K 78643K 143 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 110 0 NDP 5 0K 0K 78643K 12 0 temp 102 3981K 4073K 78643K 14900 0 kqueue 5 5K 23K 78643K 242 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 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 226 0 224 1 0 1 1 0 8 0 rtentry 112 59 0 13 2 0 2 2 0 8 0 unpcb 120 2154 0 2141 1 0 1 1 0 8 0 syncache 296 131 0 131 11 11 0 1 0 8 0 tcpqe 32 487 0 487 13 13 0 1 0 8 0 tcpcb 736 1324 0 1315 13 11 2 4 0 8 0 arp 120 9 0 3 1 0 1 1 0 8 0 ipq 40 12 0 12 4 4 0 1 0 8 0 ipqe 40 119 0 119 4 4 0 1 0 8 0 inpcb 304 2421 0 2410 5 3 2 2 0 8 0 ip6q 72 2 0 2 2 2 0 1 0 8 0 ip6af 40 4 0 4 2 2 0 1 0 8 0 nd6 48 11 0 3 1 0 1 1 0 8 0 kcovpl 48 3 0 1 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 247 0 44 13 0 13 13 0 8 0 art_table 32 248 0 44 2 0 2 2 0 8 0 art_node 16 58 0 16 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 0 1 0 1 1 0 8 0 semupl 112 7 0 7 1 1 0 1 0 8 0 semapl 112 11 0 2 1 0 1 1 0 8 0 shmpl 112 140 0 35 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 8566 0 7144 92 3 89 90 0 8 0 ffsino 272 8566 0 7144 96 0 96 96 0 8 0 nchpl 144 17194 0 15605 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 39478 0 39478 1 0 1 1 0 8 1 percpumem 16 34 0 1 1 0 1 1 0 8 0 scxspl 216 48519 0 48519 17 16 1 8 0 8 1 plimitpl 152 172 0 163 1 0 1 1 0 8 0 sigapl 424 6502 0 6468 4 0 4 4 0 8 0 futexpl 56 76131 0 76131 1 0 1 1 0 8 1 knotepl 112 400 0 380 2 1 1 2 0 8 0 kqueuepl 168 7216 0 7203 4 3 1 2 0 8 0 pipepl 336 494 0 483 11 9 2 3 0 8 0 fdescpl 496 6485 0 6468 3 0 3 3 0 8 0 filepl 152 25599 0 25494 8 3 5 7 0 8 0 lockfpl 104 507 0 505 1 0 1 1 0 8 0 lockfspl 48 212 0 210 1 0 1 1 0 8 0 sessionpl 144 18 0 8 1 0 1 1 0 8 0 pgrppl 48 58 0 48 1 0 1 1 0 8 0 ucredpl 96 2631 0 2622 1 0 1 1 0 8 0 zombiepl 144 6468 0 6468 1 0 1 1 0 8 1 processpl 1080 6502 0 6468 4 1 3 3 0 8 0 procpl 672 14680 0 14637 4 0 4 4 0 8 0 sosppl 168 97 0 97 7 7 0 1 0 8 0 sockpl 432 4822 0 4796 16 12 4 4 0 8 1 mcl64k 65536 24 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 1 mcl12k 12288 33 0 0 2 0 2 2 0 8 0 mcl9k 9216 12 0 0 1 0 1 1 0 8 0 mcl8k 8192 16 0 0 2 0 2 2 0 8 0 mcl4k 4096 26 0 0 3 0 3 3 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 419 0 0 28 0 28 28 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1172 0 0 64 0 64 64 0 8 0 bufpl 280 12114 0 5850 448 0 448 448 0 8 0 anonpl 24 1715380 0 1700211 145 49 96 106 0 186 0 amapchunkpl 152 184442 0 183866 31 8 23 24 0 158 0 amappl16 200 14187 0 13673 68 40 28 36 0 8 0 amappl15 192 62 0 56 1 0 1 1 0 8 0 amappl14 184 5626 0 5621 1 0 1 1 0 8 0 amappl13 176 109 0 107 1 0 1 1 0 8 0 amappl12 168 35 0 24 1 0 1 1 0 8 0 amappl11 160 43 0 34 1 0 1 1 0 8 0 amappl10 152 701 0 692 1 0 1 1 0 8 0 amappl9 144 113 0 112 1 0 1 1 0 8 0 amappl8 136 531 0 417 4 0 4 4 0 8 0 amappl7 128 59 0 49 1 0 1 1 0 8 0 amappl6 120 774 0 749 1 0 1 1 0 8 0 amappl5 112 1173 0 1164 1 0 1 1 0 8 0 amappl4 104 6187 0 6157 1 0 1 1 0 8 0 amappl3 96 385 0 380 1 0 1 1 0 8 0 amappl2 88 6156 0 6100 2 0 2 2 0 8 0 amappl1 80 111768 0 111348 12 3 9 12 0 8 0 amappl 88 77076 0 76911 4 0 4 4 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 142 0 35 2 0 2 2 0 8 0 uaddrrnd 24 6485 0 6468 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 6485 0 6468 1 0 1 1 0 8 0 vmmpekpl 168 35160 0 35139 2 0 2 2 0 8 0 vmmpepl 168 744023 0 741970 136 45 91 110 0 357 1 vmsppl 368 6484 0 6468 2 0 2 2 0 8 0 rwobjpl 56 129662 0 128395 26 7 19 20 0 8 0 pdppl 4096 12977 0 12936 55 14 41 45 0 8 0 pvpl 32 3948620 0 3929870 280 121 159 174 0 265 4 pmappl 232 6484 0 6468 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 393 0 39 11 0 11 11 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd8066428708,9,0) at witness_checkorder+0x108b rw_enter(fffffd80664286f8,81) at rw_enter+0xd4 rrw_enter(fffffd80664286f8,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8069210a98,81) at VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 vn_lock(fffffd8069210a98,81) at vn_lock+0x6c sys/kern/vfs_vnops.c:575 uvn_get(fffffd8064e670f0,0,ffff800021268718,ffff8000212686e8,0,0) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8064e670f0,0,ffff800021268718,ffff8000212686e8,0,0) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800021268880,ffff8000212688b8,ffff800021268800,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f01a730,20000000,0,2) at uvm_fault+0x23e sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021268a10,20000080) at kpageflttrap+0x202 sys/arch/amd64/amd64/trap.c:265 kerntrap(ffff800021268a10) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:321 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021268c40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021268c40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa09cd5e7070, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d58ff0) 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x64 kd_curproc sys/dev/kcov.c:571 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x64 sys/dev/kcov.c:143 __mp_lock(ffffffff827b8080) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff827b8080) at __mp_lock+0x133 sys/kern/kern_lock.c:147 __mp_acquire_count(ffffffff827b8080,2) at __mp_acquire_count+0x4c sys/kern/kern_lock.c:227 mi_switch() at mi_switch+0x390 sys/kern/sched_bsd.c:433 sleep_finish(ffff8000256d44f8,1) at sleep_finish+0x281 sys/kern/kern_synch.c:433 rwsleep(ffff8000ffff4540,ffffffff82729ab0,120,ffffffff823ca6b0,0) at rwsleep+0xe4 sys/kern/kern_synch.c:313 futex_wait(a09c80c6ca0,2,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:254 sys_futex(ffff8000ffff4540,ffff8000256d4690,ffff8000256d46e0) at sys_futex+0x114 sys/kern/sys_futex.c:110 syscall(ffff8000256d4760) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4760) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa0956f97860, count: -13