witness: lock order reversal: 1st 0xfffffd806f14d630 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80774abf80 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(fffffd80774abf80,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80774abf80,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80774abf70,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80774abf70,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8076b6dda8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8076b6dda8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80734567e8,0,ffff8000256c0d08,ffff8000256c0cd8,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80734567e8,0,ffff8000256c0d08,ffff8000256c0cd8,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256c0e70,ffff8000256c0ea8,ffff8000256c0df0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd800857e170,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256c1000,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256c1000) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256c1230) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256c1230) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x67b2ba72e70, count: -15 ddb{1}> show registers rdi 0xffff800021282000 rsi 0x1462e acpi_pdirpa+0x496 rbp 0xffff8000256c0980 rbx 0x3 rdx 0xffff800021282000 rcx 0x1462d acpi_pdirpa+0x495 rax 0xffffffff811a7667 db_enter+0x17 r8 0xffffffff823a84fc witness_checkorder+0x10cc r9 0x5 r10 0x9e1f135a46edc421 r11 0xaf01b81d61b27d35 r12 0xfffffd8002da77c0 r13 0 r14 0 r15 0 rip 0xffffffff811a7668 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256c0970 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=227010 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021247500,0xffffffff82908398 process=0xffff8000ffff8868 user=0xffff8000256bc000, vmspace=0xfffffd800857e170 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 22634 424999 88160 32767 7 0x10 syz-executor.1 22634 105697 88160 32767 3 0x4000090 fsleep syz-executor.1 97281 382761 68548 32767 2 0x10 syz-executor.0 *97281 227010 68548 32767 7 0x4000010 syz-executor.0 68548 440551 79762 32767 3 0x90 nanoslp syz-executor.0 79762 464459 98571 0 3 0x82 wait syz-executor.0 88160 374376 6884 32767 3 0x90 nanoslp syz-executor.1 6884 453156 98571 0 3 0x82 wait syz-executor.1 89202 490045 0 0 3 0x14200 bored sosplice 98571 139943 89889 0 3 0x82 thrsleep syz-fuzzer 98571 46150 89889 0 3 0x4000082 nanoslp syz-fuzzer 98571 168971 89889 0 3 0x4000082 kqread syz-fuzzer 98571 71988 89889 0 3 0x4000082 thrsleep syz-fuzzer 98571 220745 89889 0 3 0x4000082 thrsleep syz-fuzzer 98571 272132 89889 0 3 0x4000082 thrsleep syz-fuzzer 98571 177446 89889 0 3 0x4000082 thrsleep syz-fuzzer 98571 462471 89889 0 3 0x4000082 thrsleep syz-fuzzer 89889 478970 34415 0 3 0x10008a sigsusp ksh 34415 510424 64358 0 3 0x9a select sshd 99210 177894 1 0 3 0x100083 ttyin getty 64358 441494 1 0 3 0x88 select sshd 51651 252191 26447 73 3 0x100090 kqread syslogd 26447 38100 1 0 3 0x100082 netio syslogd 88163 69361 1 0 3 0x100080 kqread resolvd 47852 347527 15156 77 3 0x100092 kqread dhcpleased 91711 39914 15156 77 3 0x100092 kqread dhcpleased 15156 459943 1 0 3 0x80 kqread dhcpleased 1894 89181 0 0 3 0x14200 bored smr 26974 487390 0 0 2 0x14200 zerothread 14074 62068 0 0 3 0x14200 aiodoned aiodoned 27635 40652 0 0 3 0x14200 syncer update 63080 104810 0 0 3 0x14200 cleaner cleaner 82278 280066 0 0 3 0x14200 reaper reaper 56775 207460 0 0 3 0x14200 pgdaemon pagedaemon 509 443179 0 0 3 0x14200 bored crynlk 52245 134224 0 0 3 0x14200 bored crypto 14994 510571 0 0 3 0x14200 bored viomb 90950 335139 0 0 3 0x40014200 acpi0 acpi0 9725 399070 0 0 3 0x40014200 idle1 14534 469136 0 0 3 0x14200 bored softnet 87314 119081 0 0 3 0x14200 bored systqmp 4719 286750 0 0 3 0x14200 bored systq 2249 382968 0 0 3 0x40014200 bored softclock 7423 343381 0 0 3 0x40014200 idle0 1 134451 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 22634 (syz-executor.1) thread 0xffff800021246000 (424999) shared rwlock vmmaplk r = 0 (0xfffffd800857e5d8) #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 97281 (syz-executor.0) thread 0xffff800021246d20 (227010) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82841138) #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 (0xfffffd806f14d630) #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 10119 6354K 6380K 78643K 11239 0 pcb 13 8K 8K 78643K 13 0 rtable 112 3K 4K 78643K 585 0 ifaddr 39 10K 10K 78643K 113 0 sysctl 3 1K 1K 78643K 5 0 counters 44 34K 34K 78643K 64 0 ioctlops 0 0K 2K 78643K 161 0 iov 0 0K 16K 78643K 10148 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1217 77K 77K 78643K 1506 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 38 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 26623 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 28416 0 sigio 0 0K 0K 78643K 32 0 proc 56 74K 99K 78643K 734 0 subproc 34 2K 2K 78643K 204 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 395 0 in_multi 33 2K 2K 78643K 239 0 ether_multi 1 0K 0K 78643K 22 0 mrt 1 0K 0K 78643K 2 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 8573 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 411 53K 54K 78643K 337924 0 UVM aobj 81 7K 7K 78643K 109 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 224 0 NDP 5 0K 0K 78643K 39 0 temp 102 4209K 4273K 78643K 60316 0 kqueue 21 36K 54K 78643K 344 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 249 0 246 1 0 1 1 0 8 0 rtentry 112 162 0 115 2 0 2 2 0 8 0 unpcb 120 2434 0 2410 4 3 1 2 0 8 0 syncache 296 81 0 81 11 11 0 1 0 8 0 tcpqe 32 736 0 736 14 14 0 1 0 8 0 tcpcb 736 1334 0 1328 21 20 1 6 0 8 0 arp 120 26 0 20 1 0 1 1 0 8 0 ipq 40 3 0 3 3 3 0 1 0 8 0 ipqe 40 6 0 6 3 3 0 1 0 8 0 inpcb 304 2721 0 2714 9 8 1 2 0 8 0 rttmr 72 5 0 4 1 0 1 1 0 8 0 ip6q 72 8 0 8 3 3 0 1 0 8 0 ip6af 40 15 0 15 3 3 0 1 0 8 0 nd6 48 42 0 34 1 0 1 1 0 8 0 kcovpl 48 12 0 10 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 760 0 515 20 4 16 17 0 8 0 art_table 32 761 0 515 3 1 2 3 0 8 0 art_node 16 161 0 118 1 0 1 1 0 8 0 sysvmsgpl 40 7 0 7 1 1 0 1 0 8 0 semapl 112 26621 0 26611 1 0 1 1 0 8 0 shmpl 112 106 0 28 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 34134 0 32728 90 2 88 89 0 8 0 ffsino 272 34134 0 32728 95 0 95 95 0 8 0 nchpl 144 85178 0 83575 61 1 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 150324 0 150324 2 1 1 1 0 8 1 percpumem 16 44 0 10 1 0 1 1 0 8 0 scxspl 216 193412 0 193412 11 10 1 8 0 8 1 plimitpl 152 215 0 205 1 0 1 1 0 8 0 sigapl 424 28609 0 28573 6 1 5 5 0 8 0 futexpl 56 265372 0 265371 2 1 1 1 0 8 0 knotepl 112 107 0 0 3 0 3 3 0 8 0 kqueuepl 216 35982 0 35954 8 6 2 3 0 8 0 pipepl 336 760 0 750 14 12 2 2 0 8 1 fdescpl 496 28592 0 28573 3 0 3 3 0 8 0 filepl 152 84568 0 84452 12 7 5 7 0 8 0 lockfpl 104 1213 0 1210 1 0 1 1 0 8 0 lockfspl 48 460 0 457 1 0 1 1 0 8 0 sessionpl 144 27 0 17 1 0 1 1 0 8 0 pgrppl 48 50 0 40 1 0 1 1 0 8 0 ucredpl 96 2800 0 2788 1 0 1 1 0 8 0 zombiepl 144 28573 0 28573 1 0 1 1 0 8 1 processpl 1072 28609 0 28573 3 0 3 3 0 8 0 procpl 672 60099 0 60054 10 6 4 5 0 8 0 sosppl 168 128 0 128 8 8 0 1 0 8 0 sockpl 480 5461 0 5427 11 5 6 7 0 8 0 mcl64k 65536 19 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 8 0 0 1 0 1 1 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 41 0 0 3 0 3 3 0 8 0 mcl2k2 2112 14 0 0 1 0 1 1 0 8 0 mcl2k 2048 811 0 0 40 2 38 38 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1439 0 0 63 0 63 63 0 8 0 bufpl 280 35422 0 29090 453 0 453 453 0 8 0 anonpl 24 7169199 0 7142322 235 72 163 172 0 186 1 amapchunkpl 152 794988 0 794008 58 19 39 40 0 158 1 amappl16 200 41157 0 40324 88 44 44 55 0 8 0 amappl15 192 13685 0 13682 2 1 1 1 0 8 0 amappl14 184 93 0 89 1 0 1 1 0 8 0 amappl13 176 228 0 227 1 0 1 1 0 8 0 amappl12 168 1616 0 1614 1 0 1 1 0 8 0 amappl11 160 12649 0 12637 1 0 1 1 0 8 0 amappl10 152 67 0 59 1 0 1 1 0 8 0 amappl9 144 284 0 281 1 0 1 1 0 8 0 amappl8 136 816 0 661 6 0 6 6 0 8 0 amappl7 128 116 0 102 1 0 1 1 0 8 0 amappl6 120 451 0 441 1 0 1 1 0 8 0 amappl5 112 14709 0 14692 1 0 1 1 0 8 0 amappl4 104 26316 0 26279 8 7 1 2 0 8 0 amappl3 96 2294 0 2291 1 0 1 1 0 8 0 amappl2 88 2474 0 2415 2 0 2 2 0 8 0 amappl1 80 506033 0 505579 12 2 10 12 0 8 0 amappl 88 334830 0 334597 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 108 0 28 2 0 2 2 0 8 0 uaddrrnd 24 28592 0 28573 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 28592 0 28573 1 0 1 1 0 8 0 vmmpekpl 168 148023 0 148001 2 0 2 2 0 8 0 vmmpepl 168 3249522 0 3246963 190 78 112 119 0 357 0 vmsppl 368 28591 0 28573 2 0 2 2 0 8 0 rwobjpl 56 545131 0 543397 40 15 25 27 0 8 0 pdppl 4096 57192 0 57146 66 20 46 50 0 8 0 pvpl 32 15630070 0 15599451 374 125 249 266 0 265 2 pmappl 224 28591 0 28573 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 433 0 64 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(ffffffff82768ff0) 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0xb sys/dev/kcov.c:139 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __mp_lock(ffffffff82840f30) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82840f30) at __mp_lock+0x129 sys/kern/kern_lock.c:147 uvm_fault(fffffd800857e5c0,94950ce5000,0,1) at uvm_fault+0x192 sys/uvm/uvm_fault.c:623 upageflttrap(ffff800021265b30,94950ce5000) at upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 usertrap(ffff800021265b30) at usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7fffff8a30, 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:399 witness_checkorder(fffffd80774abf80,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80774abf80,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80774abf70,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80774abf70,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8076b6dda8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8076b6dda8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80734567e8,0,ffff8000256c0d08,ffff8000256c0cd8,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80734567e8,0,ffff8000256c0d08,ffff8000256c0cd8,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256c0e70,ffff8000256c0ea8,ffff8000256c0df0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd800857e170,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256c1000,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256c1000) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256c1230) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256c1230) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x67b2ba72e70, count: -15