witness: lock order reversal: 1st 0xfffffd806f1dddf0 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807a4335f0 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(fffffd807a4335f0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807a4335f0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807a4335e0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807a4335e0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd803fddf478,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd803fddf478,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd804025d7f8,0,ffff800023497208,ffff8000234971d8,0,0,8fafcb00d35e94aa,ffffffff81a3f030) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd804025d7f8,0,ffff800023497208,ffff8000234971d8,0,0,8fafcb00d35e94aa,ffffffff81a3f030) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800023497370,ffff8000234973a8,ffff8000234972f0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807effb2e0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800023497500,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800023497500) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800023497730) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023497730) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b7275a0aa0, count: -15 ddb{1}> show registers rdi 0xffff800021282000 rsi 0x767f __ALIGN_SIZE+0x667f rbp 0xffff800023496e80 rbx 0x3 rdx 0xffff800021282000 rcx 0x767e __ALIGN_SIZE+0x667e rax 0xffffffff822db327 db_enter+0x17 r8 0xffffffff81086fdc witness_checkorder+0x10cc r9 0x5 r10 0x29c23f70c24c7a80 r11 0xe6719b9991bae8ea r12 0xfffffd8002dc1900 r13 0 r14 0 r15 0 rip 0xffffffff822db328 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023496e70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=498496 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000211b3ce8,0xffff8000211b3278 process=0xffff8000ffffa9e8 user=0xffff800023492000, vmspace=0xfffffd807effb2e0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 2372 274182 46818 32767 7 0x10 syz-executor.1 55363 88149 68243 32767 2 0x10 syz-executor.0 *55363 498496 68243 32767 7 0x4000010 syz-executor.0 46818 40165 71666 32767 2 0x10 syz-executor.1 68243 28477 93494 32767 3 0x90 nanoslp syz-executor.0 71666 518652 31594 0 3 0x82 wait syz-executor.1 93494 215691 31594 0 3 0x82 wait syz-executor.0 31594 218062 74097 0 3 0x82 thrsleep syz-fuzzer 31594 220729 74097 0 3 0x4000082 nanoslp syz-fuzzer 31594 431984 74097 0 3 0x4000082 nanoslp syz-fuzzer 31594 98306 74097 0 3 0x4000082 thrsleep syz-fuzzer 31594 79003 74097 0 3 0x4000082 thrsleep syz-fuzzer 31594 101331 74097 0 3 0x4000082 kqread syz-fuzzer 31594 55577 74097 0 3 0x4000082 thrsleep syz-fuzzer 31594 167001 74097 0 3 0x4000082 thrsleep syz-fuzzer 74097 217995 42389 0 3 0x10008a sigsusp ksh 42389 56345 78773 0 3 0x9a select sshd 63310 410406 1 0 3 0x100083 ttyin getty 78773 79372 1 0 3 0x88 select sshd 88068 411669 39047 73 3 0x100090 kqread syslogd 39047 105279 1 0 3 0x100082 netio syslogd 93613 321860 1 0 3 0x100080 kqread resolvd 57490 216932 6220 77 3 0x100092 kqread dhcpleased 6173 102177 6220 77 3 0x100092 kqread dhcpleased 6220 76327 1 0 3 0x80 kqread dhcpleased 82315 5585 0 0 3 0x14200 bored smr 33397 257553 0 0 3 0x14200 pgzero zerothread 51720 125506 0 0 3 0x14200 aiodoned aiodoned 81430 466255 0 0 3 0x14200 syncer update 57761 406676 0 0 3 0x14200 cleaner cleaner 92648 334625 0 0 3 0x14200 reaper reaper 85418 199875 0 0 3 0x14200 pgdaemon pagedaemon 75522 35902 0 0 3 0x14200 bored crynlk 9348 468443 0 0 3 0x14200 bored crypto 47479 82561 0 0 3 0x14200 bored viomb 88607 266377 0 0 3 0x40014200 acpi0 acpi0 71661 134348 0 0 3 0x40014200 idle1 76266 259991 0 0 3 0x14200 bored softnet 37507 337397 0 0 3 0x14200 bored systqmp 63329 416381 0 0 3 0x14200 bored systq 50390 305568 0 0 3 0x40014200 bored softclock 36105 107281 0 0 3 0x40014200 idle0 1 7475 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 2372 (syz-executor.1) thread 0xffff8000211b3268 (274182) shared rwlock vmmaplk r = 0 (0xfffffd807effb188) #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 55363 (syz-executor.0) thread 0xffff8000211b2548 (498496) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82975230) #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 (0xfffffd806f1dddf0) #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 10113 6407K 6433K 78643K 11203 0 pcb 13 8K 8K 78643K 13 0 rtable 106 3K 3K 78643K 210 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 1314 0 iov 0 0K 0K 78643K 44 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1216 76K 76K 78643K 1222 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 5 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 4871 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 22244 0 sigio 0 0K 0K 78643K 9 0 proc 56 74K 99K 78643K 292 0 subproc 34 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 0 ether_multi 1 0K 0K 78643K 1 0 mrt 2 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 31 148K 148K 78643K 31 0 exec 0 0K 2K 78643K 379 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 1049 103K 103K 78643K 265871 0 UVM aobj 10 2K 2K 78643K 12 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 9 0 temp 101 4209K 4273K 78643K 46615 0 kqueue 10 14K 19K 78643K 42 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 62 0 59 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 467 0 450 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 231 0 231 1 1 0 1 0 8 0 tcpcb 736 10 0 6 1 0 1 1 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 45 0 38 1 0 1 1 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 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 sysvmsgpl 40 1 0 0 1 0 1 1 0 8 0 semupl 112 6 0 6 1 1 0 1 0 8 0 semapl 112 4869 0 4859 1 0 1 1 0 8 0 shmpl 112 9 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 27425 0 26021 88 0 88 88 0 8 0 ffsino 272 27425 0 26021 95 1 94 94 0 8 0 nchpl 144 54271 0 52657 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 117714 0 117714 3 2 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 149916 0 149916 11 10 1 8 0 8 1 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 22467 0 22432 5 1 4 5 0 8 0 futexpl 56 148380 0 148380 1 0 1 1 0 8 1 knotepl 112 48 0 0 2 0 2 2 0 8 0 kqueuepl 216 33638 0 33628 2 0 2 2 0 8 1 pipepl 336 349 0 339 12 11 1 2 0 8 0 fdescpl 496 22451 0 22432 3 0 3 3 0 8 0 filepl 152 74545 0 74429 5 0 5 5 0 8 0 lockfpl 104 67 0 65 1 0 1 1 0 8 0 lockfspl 48 28 0 26 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 694 0 682 1 0 1 1 0 8 0 zombiepl 144 22432 0 22432 3 2 1 1 0 8 1 processpl 1072 22467 0 22432 3 0 3 3 0 8 0 procpl 672 47028 0 46985 8 4 4 5 0 8 0 sockpl 480 831 0 804 16 12 4 4 0 8 0 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 14 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 33 0 0 4 1 3 3 0 8 0 mcl2k2 2112 12 0 0 1 0 1 1 0 8 0 mcl2k 2048 479 0 0 51 25 26 51 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 894 0 0 30 0 30 30 0 8 0 bufpl 280 25797 0 19473 452 0 452 452 0 8 0 anonpl 24 5754349 0 5569479 1131 14 1117 1117 0 186 1 amapchunkpl 152 630557 0 622915 299 3 296 296 0 158 2 amappl16 200 35157 0 31109 215 1 214 214 0 8 0 amappl15 192 67 0 63 1 0 1 1 0 8 0 amappl14 184 11087 0 11079 1 0 1 1 0 8 0 amappl13 176 11176 0 11170 1 0 1 1 0 8 0 amappl12 168 11 0 7 1 0 1 1 0 8 0 amappl11 160 72 0 56 1 0 1 1 0 8 0 amappl10 152 17 0 14 1 0 1 1 0 8 0 amappl9 144 343 0 339 1 0 1 1 0 8 0 amappl8 136 360 0 308 2 0 2 2 0 8 0 amappl7 128 56 0 45 1 0 1 1 0 8 0 amappl6 120 53 0 42 1 0 1 1 0 8 0 amappl5 112 240 0 221 1 0 1 1 0 8 0 amappl4 104 11594 0 11567 1 0 1 1 0 8 0 amappl3 96 11569 0 11548 1 0 1 1 0 8 0 amappl2 88 12127 0 12086 3 1 2 2 0 8 0 amappl1 80 386425 0 385991 14 4 10 12 0 8 0 amappl 88 263665 0 262684 24 1 23 23 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 11 0 2 1 0 1 1 0 8 0 uaddrrnd 24 22451 0 22432 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 22451 0 22432 1 0 1 1 0 8 0 vmmpekpl 168 86963 0 86935 2 0 2 2 0 8 0 vmmpepl 168 2547426 0 2541053 438 158 280 429 0 357 2 vmsppl 368 22450 0 22432 2 0 2 2 0 8 0 rwobjpl 56 419389 0 413774 83 3 80 80 0 8 0 pdppl 4096 44910 0 44864 72 26 46 50 0 8 0 pvpl 32 10020580 0 9832138 1554 29 1525 1526 0 265 2 pmappl 224 22450 0 22432 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 382 0 68 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(ffffffff827f9ff0) 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(ffffffff82975028) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82975028) at __mp_lock+0x129 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __mp_lock(ffffffff82975028) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82975028) at __mp_lock+0x122 sys/kern/kern_lock.c:147 uvm_fault(fffffd807effb170,1b32e20000,0,2) at uvm_fault+0x224 sys/uvm/uvm_fault.c:637 upageflttrap(ffff8000256b7b70,1b32e20000) at upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 usertrap(ffff8000256b7b70) at usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffc1f90, count: -11 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(fffffd807a4335f0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807a4335f0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807a4335e0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807a4335e0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd803fddf478,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd803fddf478,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd804025d7f8,0,ffff800023497208,ffff8000234971d8,0,0,8fafcb00d35e94aa,ffffffff81a3f030) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd804025d7f8,0,ffff800023497208,ffff8000234971d8,0,0,8fafcb00d35e94aa,ffffffff81a3f030) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800023497370,ffff8000234973a8,ffff8000234972f0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807effb2e0,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800023497500,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800023497500) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800023497730) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023497730) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b7275a0aa0, count: -15