witness: lock order reversal: 1st 0xfffffd806aff4818 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80782fd098 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:440 witness_checkorder(fffffd80782fd098,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80782fd098,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80782fd088,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80782fd088,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8063b2de18,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8063b2de18,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80782593c0,0,ffff800025680da8,ffff800025680d78,0,0,e9f5dc01a1c00b0d,ffffffff823c07f0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80782593c0,0,ffff800025680da8,ffff800025680d78,0,0,e9f5dc01a1c00b0d,ffffffff823c07f0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800025680f10,ffff800025680f48,ffff800025680e90,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd80085968a0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256810a0,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256810a0) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256812d0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256812d0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6a0c5188610, count: -15 ddb{0}> show registers rdi 0xffff800023476000 rsi 0x6fba __ALIGN_SIZE+0x5fba rbp 0xffff800025680a20 rbx 0x3 rdx 0xffff800023476000 rcx 0x6fb9 __ALIGN_SIZE+0x5fb9 rax 0xffffffff819e54b7 db_enter+0x17 r8 0xffffffff81dab0dc witness_checkorder+0x10cc r9 0x5 r10 0xcbab499973ed4cef r11 0x6fb8ab525de56d24 r12 0xfffffd8002dc0900 r13 0 r14 0 r15 0 rip 0xffffffff819e54b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800025680a10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=374491 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff80002124a000,0xffff80002124a2b0 process=0xffff8000ffffae18 user=0xffff80002567c000, vmspace=0xfffffd80085968a0 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85869 406467 73321 32767 7 0x10 syz-executor.0 69232 256899 34701 32767 2 0x10 syz-executor.1 *69232 374491 34701 32767 7 0x4000010 syz-executor.1 34701 424124 2200 32767 3 0x90 nanoslp syz-executor.1 2200 269035 46565 0 3 0x82 wait syz-executor.1 73321 171067 46327 32767 3 0x90 nanoslp syz-executor.0 46327 81628 46565 0 3 0x82 wait syz-executor.0 44313 312967 0 0 3 0x14200 bored sosplice 46565 317445 1312 0 3 0x82 thrsleep syz-fuzzer 46565 105773 1312 0 3 0x4000082 nanoslp syz-fuzzer 46565 26789 1312 0 3 0x4000082 thrsleep syz-fuzzer 46565 139719 1312 0 3 0x4000082 thrsleep syz-fuzzer 46565 67283 1312 0 3 0x4000082 thrsleep syz-fuzzer 46565 15190 1312 0 3 0x4000082 thrsleep syz-fuzzer 46565 260417 1312 0 3 0x4000082 thrsleep syz-fuzzer 46565 268339 1312 0 3 0x4000082 kqread syz-fuzzer 1312 84301 80344 0 3 0x10008a sigsusp ksh 80344 407073 86533 0 3 0x9a select sshd 62987 255388 1 0 3 0x100083 ttyin getty 86533 317013 1 0 3 0x88 select sshd 6482 515023 83654 73 3 0x100090 kqread syslogd 83654 447646 1 0 3 0x100082 netio syslogd 51685 74030 1 0 3 0x100080 kqread resolvd 18530 398502 65151 77 3 0x100092 kqread dhcpleased 73981 462872 65151 77 3 0x100092 kqread dhcpleased 65151 4906 1 0 3 0x80 kqread dhcpleased 74744 125237 0 0 3 0x14200 bored smr 36700 189513 0 0 2 0x14200 zerothread 52218 68754 0 0 3 0x14200 aiodoned aiodoned 59221 239910 0 0 3 0x14200 syncer update 74995 254260 0 0 3 0x14200 cleaner cleaner 58120 61754 0 0 3 0x14200 reaper reaper 9255 253271 0 0 3 0x14200 pgdaemon pagedaemon 78209 185727 0 0 3 0x14200 bored crynlk 98966 342857 0 0 3 0x14200 bored crypto 89389 236366 0 0 3 0x14200 bored viomb 69533 411807 0 0 3 0x40014200 acpi0 acpi0 60393 456550 0 0 3 0x40014200 idle1 73402 375108 0 0 3 0x14200 bored softnet 3112 252641 0 0 3 0x14200 bored systqmp 53598 462834 0 0 3 0x14200 bored systq 99164 404969 0 0 3 0x40014200 bored softclock 75078 267327 0 0 3 0x40014200 idle0 1 214183 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 85869 (syz-executor.0) thread 0xffff80002124a2a0 (406467) exclusive rwlock amaplk r = 0 (0xfffffd8061c72248) #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_check+0x3d2 sys/uvm/uvm_fault.c:774 #2 uvm_fault+0x102 sys/uvm/uvm_fault.c:601 #3 upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 #4 usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 #5 recall_trap+0x8 shared rwlock vmmaplk r = 0 (0xfffffd8008596018) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1701 #2 uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 #3 uvm_fault+0x102 sys/uvm/uvm_fault.c:601 #4 upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 #5 usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 #6 recall_trap+0x8 Process 69232 (syz-executor.1) thread 0xffff80002124b7a0 (374491) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828c8310) #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 (0xfffffd806aff4818) #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+0x20f #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10118 6407K 6433K 78643K 11223 0 pcb 13 8K 8K 78643K 13 0 rtable 112 3K 3K 78643K 486 0 ifaddr 39 10K 10K 78643K 78 0 sysctl 2 0K 0K 78643K 4 0 counters 44 34K 34K 78643K 54 0 ioctlops 0 0K 2K 78643K 1063 0 iov 0 0K 16K 78643K 425 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1216 76K 77K 78643K 1474 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 47 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 9929 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 18483 0 sigio 0 0K 0K 78643K 56 0 proc 56 74K 99K 78643K 629 0 subproc 34 2K 2K 78643K 119 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 793 0 in_multi 33 2K 2K 78643K 260 0 ether_multi 1 0K 0K 78643K 38 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 1303 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 403 60K 74K 78643K 226398 0 UVM aobj 117 3K 5K 78643K 162 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 305 0 NDP 5 0K 0K 78643K 24 0 temp 102 4213K 4277K 78643K 40132 0 kqueue 11 14K 20K 78643K 323 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 22 0 0 1 0 1 1 0 8 0 rtpcb 120 272 0 269 1 0 1 1 0 8 0 rtentry 112 109 0 62 2 0 2 2 0 8 0 unpcb 120 3564 0 3541 4 3 1 2 0 8 0 syncache 296 140 0 140 13 13 0 1 0 8 0 tcpqe 32 593 0 593 14 14 0 1 0 8 0 tcpcb 736 1675 0 1671 20 19 1 9 0 8 0 arp 120 17 0 11 1 0 1 1 0 8 0 ipq 40 12 0 12 2 2 0 1 0 8 0 ipqe 40 360 0 360 2 2 0 1 0 8 0 inpcb 304 3683 0 3676 13 12 1 5 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 2 0 2 1 1 0 1 0 8 0 nd6 48 29 0 20 1 0 1 1 0 8 0 kcovpl 48 7 0 5 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 490 0 284 16 3 13 15 0 8 0 art_table 32 491 0 284 2 0 2 2 0 8 0 art_node 16 108 0 65 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 4 1 1 0 1 0 8 0 semupl 112 10 0 10 1 1 0 1 0 8 0 semapl 112 9927 0 9917 1 0 1 1 0 8 0 shmpl 112 159 0 45 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 22789 0 21380 91 2 89 89 0 8 0 ffsino 272 22789 0 21380 97 2 95 95 0 8 0 nchpl 144 47891 0 46289 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 104145 0 104145 2 1 1 1 0 8 1 percpumem 16 39 0 5 1 0 1 1 0 8 0 scxspl 216 129743 0 129743 12 11 1 8 0 8 1 plimitpl 152 221 0 211 1 0 1 1 0 8 0 sigapl 424 18692 0 18656 6 1 5 5 0 8 0 futexpl 56 215461 0 215461 2 1 1 1 0 8 1 knotepl 112 64 0 0 2 0 2 2 0 8 0 kqueuepl 216 28693 0 28658 10 7 3 3 0 8 1 pipepl 336 1333 0 1323 16 14 2 2 0 8 1 fdescpl 496 18675 0 18656 4 1 3 3 0 8 0 filepl 152 72316 0 72200 15 10 5 7 0 8 0 lockfpl 104 1557 0 1554 1 0 1 1 0 8 0 lockfspl 48 568 0 565 1 0 1 1 0 8 0 sessionpl 144 22 0 12 1 0 1 1 0 8 0 pgrppl 48 47 0 37 1 0 1 1 0 8 0 ucredpl 96 3259 0 3247 1 0 1 1 0 8 0 zombiepl 144 18656 0 18656 2 1 1 1 0 8 1 processpl 1072 18692 0 18656 3 0 3 3 0 8 0 procpl 672 40861 0 40817 15 10 5 5 0 8 1 sosppl 168 102 0 102 13 13 0 1 0 8 0 sockpl 480 7565 0 7532 19 13 6 10 0 8 0 mcl64k 65536 25 0 0 3 0 3 3 0 8 0 mcl16k 16384 27 0 0 4 1 3 3 0 8 0 mcl12k 12288 18 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 33 0 0 3 0 3 3 0 8 0 mcl2k2 2112 22 0 0 2 0 2 2 0 8 0 mcl2k 2048 617 0 0 35 0 35 35 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 973 0 0 49 0 49 49 0 8 0 bufpl 280 38120 0 31796 454 1 453 453 0 8 0 anonpl 24 4839960 0 4814117 292 134 158 181 0 186 1 amapchunkpl 152 529155 0 528044 66 22 44 56 0 158 0 amappl16 200 36709 0 36079 125 91 34 46 0 8 0 amappl15 192 91 0 86 1 0 1 1 0 8 0 amappl14 184 4888 0 4883 1 0 1 1 0 8 0 amappl13 176 197 0 196 1 0 1 1 0 8 0 amappl12 168 6 0 1 2 1 1 1 0 8 0 amappl11 160 9338 0 9322 1 0 1 1 0 8 0 amappl10 152 4051 0 4046 1 0 1 1 0 8 0 amappl9 144 42 0 39 1 0 1 1 0 8 0 amappl8 136 925 0 779 6 0 6 6 0 8 0 amappl7 128 294 0 283 1 0 1 1 0 8 0 amappl6 120 79 0 67 1 0 1 1 0 8 0 amappl5 112 14398 0 14380 1 0 1 1 0 8 0 amappl4 104 19308 0 19274 1 0 1 1 0 8 0 amappl3 96 1175 0 1157 1 0 1 1 0 8 0 amappl2 88 816 0 774 2 1 1 2 0 8 0 amappl1 80 330209 0 329762 13 3 10 12 0 8 0 amappl 88 221115 0 220866 6 0 6 6 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 161 0 45 2 0 2 2 0 8 0 uaddrrnd 24 18675 0 18656 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 18675 0 18656 1 0 1 1 0 8 0 vmmpekpl 168 92829 0 92804 2 0 2 2 0 8 0 vmmpepl 168 2140295 0 2137956 184 80 104 118 0 357 1 vmsppl 368 18674 0 18656 2 0 2 2 0 8 0 rwobjpl 56 362639 0 361122 45 23 22 25 0 8 0 pdppl 4096 37358 0 37312 64 18 46 50 0 8 0 pvpl 32 11789276 0 11759437 461 214 247 276 0 265 6 pmappl 224 18674 0 18656 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 412 0 62 11 1 10 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:440 witness_checkorder(fffffd80782fd098,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80782fd098,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80782fd088,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80782fd088,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8063b2de18,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8063b2de18,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80782593c0,0,ffff800025680da8,ffff800025680d78,0,0,e9f5dc01a1c00b0d,ffffffff823c07f0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80782593c0,0,ffff800025680da8,ffff800025680d78,0,0,e9f5dc01a1c00b0d,ffffffff823c07f0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800025680f10,ffff800025680f48,ffff800025680e90,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd80085968a0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256810a0,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256810a0) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256812d0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256812d0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6a0c5188610, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d38ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 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(ffffffff828c8108) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828c8108) at __mp_lock+0x133 sys/kern/kern_lock.c:147 uvm_fault(fffffd8008596000,1571a9e4000,0,2) at uvm_fault+0x224 sys/uvm/uvm_fault.c:637 upageflttrap(ffff800025687520,1571a9e4352) at upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 usertrap(ffff800025687520) at usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffead30, count: -9