witness: lock order reversal: 1st 0xfffffd806b04c438 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd8067dda920 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:440 witness_checkorder(fffffd8067dda920,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8067dda920,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8067dda910,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8067dda910,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806385f478,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd806385f478,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8069a3e648,0,ffff80002349d128,ffff80002349d0f8,0,0,3dad28d91e22cf0e,ffffffff81c593f0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8069a3e648,0,ffff80002349d128,ffff80002349d0f8,0,0,3dad28d91e22cf0e,ffffffff81c593f0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002349d290,ffff80002349d2c8,ffff80002349d210,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807effa730,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002349d420,20000180) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002349d420) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002349d650) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002349d650) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2bb7b436210, count: -15 ddb{1}> show registers rdi 0xffff800021292000 rsi 0x689d __ALIGN_SIZE+0x589d rbp 0xffff80002349cda0 rbx 0x3 rdx 0xffff800021292000 rcx 0x689c __ALIGN_SIZE+0x589c rax 0xffffffff814ee847 db_enter+0x17 r8 0xffffffff81734efc witness_checkorder+0x10cc r9 0x5 r10 0x2ffced3fc1123e59 r11 0x2fa5b2072ee49599 r12 0xfffffd8002dbe900 r13 0 r14 0 r15 0 rip 0xffffffff814ee848 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002349cd90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=313863 stat=onproc flags process=10 proc=4000000 pri=76, usrpri=76, nice=20 forw=0xffffffffffffffff, list=0xffff80002123a2a0,0xffff80002123b7b0 process=0xffff8000ffffa9e8 user=0xffff800023498000, vmspace=0xfffffd807effa730 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 52915 69998 45418 32767 7 0x10 syz-executor.0 *52915 313863 45418 32767 7 0x4000010 syz-executor.0 52915 117423 45418 32767 2 0x4000090 syz-executor.0 4765 299040 0 0 3 0x14200 bored sosplice 52236 264290 73219 32767 3 0x90 nanoslp syz-executor.1 45418 213782 27999 32767 3 0x90 nanoslp syz-executor.0 73219 364721 85760 0 3 0x82 wait syz-executor.1 27999 110004 85760 0 3 0x82 wait syz-executor.0 85760 437467 74474 0 3 0x82 thrsleep syz-fuzzer 85760 163227 74474 0 3 0x4000082 nanoslp syz-fuzzer 85760 260130 74474 0 3 0x4000082 thrsleep syz-fuzzer 85760 313331 74474 0 3 0x4000082 thrsleep syz-fuzzer 85760 181796 74474 0 3 0x4000082 thrsleep syz-fuzzer 85760 206039 74474 0 3 0x4000082 thrsleep syz-fuzzer 85760 466739 74474 0 3 0x4000082 kqread syz-fuzzer 85760 417270 74474 0 3 0x4000082 thrsleep syz-fuzzer 74474 89305 65540 0 3 0x10008a sigsusp ksh 65540 295324 73837 0 3 0x9a select sshd 6378 424597 1 0 3 0x100083 ttyin getty 73837 409714 1 0 3 0x88 select sshd 52415 464177 92545 73 3 0x100090 kqread syslogd 92545 1895 1 0 3 0x100082 netio syslogd 12490 87071 1 0 3 0x100080 kqread resolvd 38550 437129 44384 77 3 0x100092 kqread dhcpleased 35932 388649 44384 77 3 0x100092 kqread dhcpleased 44384 295914 1 0 3 0x80 kqread dhcpleased 79348 177960 0 0 3 0x14200 bored smr 45444 244455 0 0 3 0x14200 pgzero zerothread 24782 252783 0 0 3 0x14200 aiodoned aiodoned 13039 119137 0 0 3 0x14200 syncer update 65422 95323 0 0 3 0x14200 cleaner cleaner 74245 502219 0 0 3 0x14200 reaper reaper 51878 308010 0 0 3 0x14200 pgdaemon pagedaemon 23308 271516 0 0 3 0x14200 bored crynlk 42393 6716 0 0 3 0x14200 bored crypto 40602 161647 0 0 3 0x14200 bored viomb 70262 497770 0 0 3 0x40014200 acpi0 acpi0 13352 272980 0 0 3 0x40014200 idle1 21574 199921 0 0 3 0x14200 bored softnet 16995 53205 0 0 3 0x14200 bored systqmp 33400 432553 0 0 3 0x14200 bored systq 11621 397734 0 0 3 0x40014200 bored softclock 12151 11031 0 0 3 0x40014200 idle0 1 488977 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 52915 (syz-executor.0) thread 0xffff80002123ba40 (313863) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82860ca8) #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 (0xfffffd806b04c438) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10118 6407K 6433K 78643K 11208 0 pcb 13 8K 8K 78643K 13 0 rtable 108 3K 3K 78643K 246 0 ifaddr 39 10K 10K 78643K 39 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 96 0 iov 0 0K 24K 78643K 147 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1216 76K 77K 78643K 1324 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 12 0K 0K 78643K 3017 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 45462 0 sigio 0 0K 0K 78643K 39 0 proc 56 74K 99K 78643K 355 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 317 0 in_multi 33 2K 2K 78643K 114 0 ether_multi 1 0K 0K 78643K 22 0 mrt 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 624 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 366 52K 53K 78643K 536900 0 UVM aobj 18 2K 2K 78643K 54 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 185 0 NDP 5 0K 0K 78643K 9 0 temp 101 4209K 4273K 78643K 93184 0 kqueue 10 14K 22K 78643K 280 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 133 0 130 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 2412 0 2395 2 1 1 2 0 8 0 syncache 296 42 0 42 7 7 0 1 0 8 0 sackhl 24 3 0 3 2 2 0 1 0 8 0 tcpqe 32 650 0 650 15 15 0 2 0 8 0 tcpcb 736 1437 0 1433 24 23 1 5 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 ipq 40 1 0 1 1 1 0 1 0 8 0 ipqe 40 5 0 5 1 1 0 1 0 8 0 inpcb 304 2354 0 2347 9 8 1 2 0 8 0 ip6q 72 3 0 3 1 1 0 1 0 8 0 ip6af 40 5 0 5 1 1 0 1 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 20 0 10 1 0 1 1 0 8 0 semupl 112 9 0 9 1 1 0 1 0 8 0 semapl 112 3015 0 3005 1 0 1 1 0 8 0 shmpl 112 51 0 36 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 49820 0 48412 90 1 89 89 0 8 0 ffsino 272 49820 0 48412 95 0 95 95 0 8 0 nchpl 144 99237 0 97622 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 214100 0 214100 1 0 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 290245 0 290245 11 10 1 8 0 8 1 plimitpl 152 119 0 109 1 0 1 1 0 8 0 sigapl 424 45686 0 45651 6 1 5 5 0 8 0 futexpl 56 278117 0 278117 1 0 1 1 0 8 1 knotepl 112 57 0 0 2 0 2 2 0 8 0 kqueuepl 216 70560 0 70554 7 6 1 2 0 8 0 pipepl 336 543 0 533 16 15 1 3 0 8 0 fdescpl 496 45669 0 45651 4 1 3 3 0 8 0 filepl 152 143184 0 143070 10 5 5 7 0 8 0 lockfpl 104 3553 0 3551 1 0 1 1 0 8 0 lockfspl 48 1696 0 1694 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 30 0 20 1 0 1 1 0 8 0 ucredpl 96 2320 0 2308 1 0 1 1 0 8 0 zombiepl 144 45651 0 45650 1 0 1 1 0 8 0 processpl 1072 45686 0 45650 3 0 3 3 0 8 0 procpl 672 92759 0 92714 16 12 4 5 0 8 0 sosppl 168 63 0 63 7 7 0 1 0 8 0 sockpl 480 4930 0 4903 10 6 4 6 0 8 0 mcl64k 65536 19 0 0 3 0 3 3 0 8 0 mcl16k 16384 25 0 0 4 1 3 3 0 8 0 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 9 0 0 1 0 1 1 0 8 0 mcl8k 8192 22 0 0 3 1 2 3 0 8 0 mcl4k 4096 34 0 0 3 0 3 3 0 8 0 mcl2k2 2112 17 0 0 2 0 2 2 0 8 0 mcl2k 2048 1128 0 0 43 2 41 41 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1442 0 0 69 1 68 69 0 8 0 bufpl 280 63904 0 57580 453 1 452 453 0 8 0 anonpl 24 11316264 0 11289571 287 124 163 163 0 186 0 amapchunkpl 152 1257795 0 1256707 75 31 44 44 0 158 1 amappl16 200 72880 0 72168 114 76 38 40 0 8 0 amappl15 192 22827 0 22821 1 0 1 1 0 8 0 amappl14 184 8 0 4 1 0 1 1 0 8 0 amappl13 176 22751 0 22748 1 0 1 1 0 8 0 amappl12 168 11 0 5 1 0 1 1 0 8 0 amappl11 160 66 0 52 1 0 1 1 0 8 0 amappl10 152 10 0 9 1 0 1 1 0 8 0 amappl9 144 268 0 266 1 0 1 1 0 8 0 amappl8 136 576 0 437 5 0 5 5 0 8 0 amappl7 128 50 0 43 1 0 1 1 0 8 0 amappl6 120 53 0 43 1 0 1 1 0 8 0 amappl5 112 45844 0 45821 1 0 1 1 0 8 0 amappl4 104 641 0 617 1 0 1 1 0 8 0 amappl3 96 522 0 506 1 0 1 1 0 8 0 amappl2 88 23151 0 23113 2 1 1 2 0 8 0 amappl1 80 746535 0 746097 12 2 10 12 0 8 0 amappl 88 530916 0 530701 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 53 0 36 1 0 1 1 0 8 0 uaddrrnd 24 45669 0 45651 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 45669 0 45651 1 0 1 1 0 8 0 vmmpekpl 168 193545 0 193521 2 0 2 2 0 8 0 vmmpepl 168 5148257 0 5145927 172 65 107 107 0 357 1 vmsppl 368 45668 0 45651 2 0 2 2 0 8 0 rwobjpl 56 828977 0 827386 41 18 23 23 0 8 0 pdppl 4096 91346 0 91302 62 16 46 50 0 8 2 pvpl 32 23026099 0 22996201 476 229 247 247 0 265 3 pmappl 224 45668 0 45651 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 434 0 62 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(ffffffff8278eff0) 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 __mp_lock(ffffffff82860aa0) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82860aa0) 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: 0x7f7ffffc88c0, 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:440 witness_checkorder(fffffd8067dda920,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8067dda920,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8067dda910,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8067dda910,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806385f478,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd806385f478,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8069a3e648,0,ffff80002349d128,ffff80002349d0f8,0,0,3dad28d91e22cf0e,ffffffff81c593f0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8069a3e648,0,ffff80002349d128,ffff80002349d0f8,0,0,3dad28d91e22cf0e,ffffffff81c593f0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002349d290,ffff80002349d2c8,ffff80002349d210,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807effa730,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002349d420,20000180) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002349d420) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002349d650) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002349d650) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2bb7b436210, count: -15