witness: lock order reversal: 1st 0xfffffd807f7d5628 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80650111b0 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(fffffd80650111b0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80650111b0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80650111a0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80650111a0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806998c320,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806998c320,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80699f14d8,0,ffff8000256c3578,ffff8000256c3548,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80699f14d8,0,ffff8000256c3578,ffff8000256c3548,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256c36e0,ffff8000256c3718,ffff8000256c3660,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd800857e2e0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256c3870,20000100) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256c3870) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256c3ab0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256c3ab0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xca36ab28e50, count: -15 ddb{1}> show registers rdi 0xffff800023496000 rsi 0x13863 mp_pdirpa+0x285d rbp 0xffff8000256c31f0 rbx 0x3 rdx 0xffff800023496000 rcx 0x13862 mp_pdirpa+0x285c rax 0xffffffff81519cc7 db_enter+0x17 r8 0xffffffff81ce7f6c witness_checkorder+0x10cc r9 0x5 r10 0x33982e78085eff4d r11 0xe110f2a56308d746 r12 0xfffffd8002da77c0 r13 0 r14 0 r15 0 rip 0xffffffff81519cc8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256c31e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=487429 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800021211500,0xffffffff828c91c0 process=0xffff8000ffff94f8 user=0xffff8000256be000, vmspace=0xfffffd800857e2e0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 68460 518952 89084 32767 7 0x10 syz-executor.1 *68460 487429 89084 32767 7 0x4000010 syz-executor.1 62755 92105 55390 32767 2 0x10 syz-executor.0 62755 333868 55390 32767 3 0x4000090 netio syz-executor.0 55390 370932 93542 32767 3 0x90 nanoslp syz-executor.0 93542 164389 4093 0 3 0x82 wait syz-executor.0 89084 168793 71745 32767 3 0x90 nanoslp syz-executor.1 71745 210931 4093 0 3 0x82 wait syz-executor.1 94952 289091 0 0 3 0x14200 bored sosplice 4093 234444 85543 0 3 0x82 thrsleep syz-fuzzer 4093 486506 85543 0 3 0x4000082 nanoslp syz-fuzzer 4093 441469 85543 0 3 0x4000082 thrsleep syz-fuzzer 4093 149916 85543 0 3 0x4000082 thrsleep syz-fuzzer 4093 74308 85543 0 3 0x4000082 thrsleep syz-fuzzer 4093 491276 85543 0 3 0x4000082 thrsleep syz-fuzzer 4093 109103 85543 0 3 0x4000082 kqread syz-fuzzer 4093 102216 85543 0 3 0x4000082 thrsleep syz-fuzzer 85543 273936 72954 0 3 0x10008a sigsusp ksh 72954 513775 81755 0 3 0x9a select sshd 15739 136265 1 0 3 0x100083 ttyin getty 81755 259398 1 0 3 0x88 select sshd 6634 136024 95403 73 3 0x100090 kqread syslogd 95403 127165 1 0 3 0x100082 netio syslogd 19485 265669 1 0 3 0x100080 kqread resolvd 57975 495219 93379 77 3 0x100092 kqread dhcpleased 67655 484855 93379 77 3 0x100092 kqread dhcpleased 93379 283088 1 0 3 0x80 kqread dhcpleased 3661 351997 0 0 3 0x14200 bored smr 21183 188421 0 0 2 0x14200 zerothread 35494 153019 0 0 3 0x14200 aiodoned aiodoned 93783 27412 0 0 3 0x14200 syncer update 52799 158898 0 0 3 0x14200 cleaner cleaner 96106 310738 0 0 3 0x14200 reaper reaper 10703 365309 0 0 3 0x14200 pgdaemon pagedaemon 77594 86991 0 0 3 0x14200 bored crynlk 4944 88656 0 0 3 0x14200 bored crypto 19145 167777 0 0 3 0x14200 bored viomb 37122 212619 0 0 3 0x40014200 acpi0 acpi0 79269 351836 0 0 3 0x40014200 idle1 13334 76035 0 0 3 0x14200 bored softnet 78106 229695 0 0 3 0x14200 bored systqmp 50952 515587 0 0 3 0x14200 bored systq 90376 6457 0 0 3 0x40014200 bored softclock 13473 100927 0 0 3 0x40014200 idle0 1 149848 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 68460 (syz-executor.1) thread 0xffff8000212117a0 (487429) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82839278) #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 (0xfffffd807f7d5628) #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 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10118 6354K 6380K 78643K 11214 0 pcb 13 8K 8K 78643K 13 0 rtable 112 3K 3K 78643K 356 0 ifaddr 39 10K 10K 78643K 53 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 48 0 ioctlops 0 0K 2K 78643K 108 0 iov 0 0K 16K 78643K 358 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1217 77K 77K 78643K 1373 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 30 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 6329 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 9018 0 sigio 0 0K 0K 78643K 39 0 proc 56 74K 99K 78643K 474 0 subproc 34 2K 2K 78643K 68 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 462 0 in_multi 33 2K 2K 78643K 133 0 ether_multi 1 0K 0K 78643K 7 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 49 228K 228K 78643K 49 0 exec 0 0K 2K 78643K 985 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 334 46K 46K 78643K 112577 0 UVM aobj 56 5K 5K 78643K 88 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 154 0 NDP 5 0K 0K 78643K 15 0 temp 102 4209K 4273K 78643K 20585 0 kqueue 10 14K 26K 78643K 284 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 224 0 221 1 0 1 1 0 8 0 rtentry 112 72 0 25 2 0 2 2 0 8 0 unpcb 120 2025 0 2012 2 1 1 2 0 8 0 syncache 296 106 0 106 12 12 0 1 0 8 0 tcpqe 32 803 0 803 11 11 0 2 0 8 0 tcpcb 736 1375 0 1371 19 18 1 5 0 8 0 arp 120 10 0 4 1 0 1 1 0 8 0 ipq 40 11 0 11 2 2 0 1 0 8 0 ipqe 40 361 0 361 2 2 0 1 0 8 0 inpcb 304 2819 0 2809 10 8 2 3 0 8 1 ip6q 72 4 0 4 2 2 0 1 0 8 0 ip6af 40 7 0 7 2 2 0 1 0 8 0 nd6 48 17 0 8 1 0 1 1 0 8 0 kcovpl 48 4 0 2 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 313 0 91 14 0 14 14 0 8 0 art_table 32 314 0 91 2 0 2 2 0 8 0 art_node 16 71 0 28 1 0 1 1 0 8 0 sysvmsgpl 40 36 0 12 1 0 1 1 0 8 0 semupl 112 10 0 10 1 1 0 1 0 8 0 semapl 112 6317 0 6307 1 0 1 1 0 8 0 shmpl 112 85 0 32 3 1 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 11348 0 9936 89 0 89 89 0 8 0 ffsino 272 11348 0 9936 95 0 95 95 0 8 0 nchpl 144 23454 0 21851 62 2 60 61 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 53114 0 53114 2 1 1 1 0 8 1 percpumem 16 36 0 2 1 0 1 1 0 8 0 scxspl 216 63285 0 63285 11 10 1 8 0 8 1 plimitpl 152 219 0 209 1 0 1 1 0 8 0 sigapl 424 9235 0 9199 6 1 5 5 0 8 1 futexpl 56 112246 0 112246 2 1 1 1 0 8 1 knotepl 112 66 0 0 2 0 2 2 0 8 0 kqueuepl 216 12297 0 12281 6 4 2 2 0 8 0 pipepl 336 784 0 773 8 6 2 2 0 8 0 fdescpl 496 9218 0 9199 3 0 3 3 0 8 0 filepl 152 36603 0 36486 9 4 5 7 0 8 0 lockfpl 104 859 0 856 1 0 1 1 0 8 0 lockfspl 48 333 0 330 1 0 1 1 0 8 0 sessionpl 144 19 0 9 1 0 1 1 0 8 0 pgrppl 48 55 0 45 1 0 1 1 0 8 0 ucredpl 96 2635 0 2623 1 0 1 1 0 8 0 zombiepl 144 9199 0 9199 1 0 1 1 0 8 1 processpl 1072 9235 0 9199 3 0 3 3 0 8 0 procpl 672 20636 0 20591 11 6 5 5 0 8 1 sosppl 168 92 0 92 11 11 0 1 0 8 0 sockpl 480 5096 0 5070 16 12 4 7 0 8 0 mcl64k 65536 26 0 0 4 0 4 4 0 8 0 mcl16k 16384 25 0 0 4 1 3 3 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 16 0 0 2 0 2 2 0 8 0 mcl8k 8192 19 0 0 3 0 3 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 13 0 0 1 0 1 1 0 8 0 mcl2k 2048 485 0 0 31 0 31 31 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1133 0 0 61 0 61 61 0 8 0 bufpl 280 13136 0 6804 453 0 453 453 0 8 0 anonpl 24 2435393 0 2410589 228 76 152 152 0 186 1 amapchunkpl 152 260706 0 259982 35 6 29 30 0 158 0 amappl16 200 20447 0 19418 115 60 55 55 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 9 0 5 1 0 1 1 0 8 0 amappl13 176 153 0 152 1 0 1 1 0 8 0 amappl12 168 2290 0 2288 1 0 1 1 0 8 0 amappl11 160 48 0 37 1 0 1 1 0 8 0 amappl10 152 4282 0 4274 1 0 1 1 0 8 0 amappl9 144 2468 0 2462 1 0 1 1 0 8 0 amappl8 136 594 0 473 5 0 5 5 0 8 0 amappl7 128 76 0 63 1 0 1 1 0 8 0 amappl6 120 2567 0 2552 1 0 1 1 0 8 0 amappl5 112 11572 0 11552 1 0 1 1 0 8 0 amappl4 104 805 0 774 1 0 1 1 0 8 0 amappl3 96 2975 0 2971 1 0 1 1 0 8 0 amappl2 88 3002 0 2942 2 0 2 2 0 8 0 amappl1 80 159281 0 158831 12 2 10 12 0 8 0 amappl 88 109503 0 109303 5 0 5 5 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 87 0 32 1 0 1 1 0 8 0 uaddrrnd 24 9218 0 9199 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 9218 0 9199 1 0 1 1 0 8 0 vmmpekpl 168 53817 0 53795 2 0 2 2 0 8 0 vmmpepl 168 1068866 0 1066177 161 42 119 119 0 357 2 vmsppl 368 9217 0 9199 2 0 2 2 0 8 0 rwobjpl 56 185271 0 183404 45 18 27 27 0 8 0 pdppl 4096 18444 0 18398 65 19 46 50 0 8 0 pvpl 32 5658836 0 5630269 353 116 237 238 0 265 6 pmappl 224 9217 0 9199 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 407 0 47 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff8276eff0) 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 __mp_lock(ffffffff82839070) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82839070) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7fffff0300, count: -6 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(fffffd80650111b0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80650111b0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80650111a0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80650111a0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806998c320,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806998c320,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80699f14d8,0,ffff8000256c3578,ffff8000256c3548,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80699f14d8,0,ffff8000256c3578,ffff8000256c3548,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256c36e0,ffff8000256c3718,ffff8000256c3660,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd800857e2e0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256c3870,20000100) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256c3870) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256c3ab0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256c3ab0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xca36ab28e50, count: -15