witness: lock order reversal: 1st 0xfffffd806f13d250 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd8069f25810 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(fffffd8069f25810,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8069f25810,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8069f25800,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8069f25800,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e14fe78,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e14fe78,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e0cd9e8,0,ffff8000232b3938,ffff8000232b3908,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e0cd9e8,0,ffff8000232b3938,ffff8000232b3908,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000232b3aa0,ffff8000232b3ad8,ffff8000232b3a20,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8069f8ab90,20001000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000232b3c30,20001280) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000232b3c30) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000232b3e70) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232b3e70) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x3aa66087760, count: -15 ddb{1}> show registers rdi 0xffff800023498000 rsi 0x14c63 acpi_pdirpa+0xacb rbp 0xffff8000232b35b0 rbx 0x3 rdx 0xffff800023498000 rcx 0x14c62 acpi_pdirpa+0xaca rax 0xffffffff8164e697 db_enter+0x17 r8 0xffffffff81dc5d8c witness_checkorder+0x10cc r9 0x5 r10 0xc75b91abe738d556 r11 0x34c777555ea79382 r12 0xfffffd8002da97c0 r13 0 r14 0 r15 0 rip 0xffffffff8164e698 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000232b35a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=217208 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021272a80,0xffff800021272550 process=0xffff8000ffffae18 user=0xffff8000232ae000, vmspace=0xfffffd8069f8ab90 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 27338 50398 2416 0 7 0 syz-executor.0 27338 295963 2416 0 3 0x4000080 fsleep syz-executor.0 27338 480087 2416 0 2 0x4000000 syz-executor.0 27338 145508 2416 0 3 0x4000080 fsleep syz-executor.0 62419 443130 9039 0 2 0 syz-executor.1 *62419 217208 9039 0 7 0x4000000 syz-executor.1 62419 259022 9039 0 3 0x4000000 biowait syz-executor.1 62419 140245 9039 0 3 0x4000080 fsleep syz-executor.1 2416 166679 8301 0 3 0x82 nanoslp syz-executor.0 95456 2132 0 0 3 0x14200 bored sosplice 9039 95377 8301 0 3 0x82 nanoslp syz-executor.1 8301 380428 69961 0 3 0x82 thrsleep syz-fuzzer 8301 385582 69961 0 3 0x4000082 thrsleep syz-fuzzer 8301 343981 69961 0 3 0x4000082 thrsleep syz-fuzzer 8301 273021 69961 0 3 0x4000082 thrsleep syz-fuzzer 8301 22493 69961 0 3 0x4000082 kqread syz-fuzzer 8301 217694 69961 0 3 0x4000082 thrsleep syz-fuzzer 8301 505909 69961 0 3 0x4000082 thrsleep syz-fuzzer 8301 307763 69961 0 3 0x4000082 thrsleep syz-fuzzer 69961 32690 54948 0 3 0x10008a sigsusp ksh 54948 41491 56332 0 3 0x9a select sshd 36912 243711 1 0 3 0x100083 ttyin getty 56332 151341 1 0 3 0x88 select sshd 72567 18991 91641 74 3 0x100092 bpf pflogd 91641 180591 1 0 3 0x80 netio pflogd 86678 298613 34766 73 3 0x100090 kqread syslogd 34766 455018 1 0 3 0x100082 netio syslogd 16333 43966 1 0 3 0x100080 kqread resolvd 12442 189359 48950 77 3 0x100092 kqread dhcpleased 15345 351958 48950 77 3 0x100092 kqread dhcpleased 48950 215905 1 0 3 0x80 kqread dhcpleased 19585 84721 0 0 3 0x14200 bored smr 78644 52539 0 0 2 0x14200 zerothread 35114 465728 0 0 3 0x14200 aiodoned aiodoned 95635 32504 0 0 3 0x14200 syncer update 67161 376332 0 0 3 0x14200 cleaner cleaner 81837 394739 0 0 3 0x14200 reaper reaper 19602 486799 0 0 3 0x14200 pgdaemon pagedaemon 94736 457714 0 0 3 0x14200 bored crynlk 98686 409450 0 0 3 0x14200 bored crypto 84787 191927 0 0 3 0x14200 bored viomb 44673 410900 0 0 3 0x40014200 acpi0 acpi0 39998 156097 0 0 3 0x40014200 idle1 46472 79913 0 0 3 0x14200 bored softnet 94354 216782 0 0 3 0x14200 bored systqmp 32137 139690 0 0 3 0x14200 bored systq 19374 510324 0 0 3 0x40014200 bored softclock 74335 188735 0 0 3 0x40014200 idle0 1 240913 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 62419 (syz-executor.1) thread 0xffff800021272000 (217208) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8283f868) #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 (0xfffffd806f13d250) #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 Process 62419 (syz-executor.1) thread 0xffff800021273ce0 (259022) exclusive rrwlock inode r = 0 (0xfffffd8069f25810) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:579 #5 vn_write+0x11d sys/kern/vfs_vnops.c:411 #6 dofilewritev+0x1a3 sys/kern/sys_generic.c:365 #7 sys_pwritev+0xb2 sys/kern/vfs_syscalls.c:3357 #8 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10171 6447K 7088K 78643K 16165 0 pcb 13 8K 8K 78643K 220 0 rtable 106 12K 12K 78643K 622 0 ifaddr 72 14K 15K 78643K 282 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 128 0 ioctlops 0 0K 4K 78643K 1653 0 iov 1 12K 24K 78643K 225 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1233 78K 78K 78643K 2945 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 51 0 VM map 2 1K 1K 78643K 2 0 sem 10 0K 0K 78643K 11 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 5361 0 sigio 0 0K 0K 78643K 27 0 proc 71 87K 111K 78643K 625 0 subproc 32 2K 3K 78643K 153 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 294 0 in_multi 29 1K 2K 78643K 263 0 ether_multi 1 0K 0K 78643K 50 0 mrt 0 0K 0K 78643K 22 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 611 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 290 98K 101K 78643K 66321 0 UVM aobj 75 5K 5K 78643K 88 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 1K 78643K 252 0 NDP 13 0K 0K 78643K 80 0 temp 136 4210K 4275K 78643K 34172 0 kqueue 10 14K 22K 78643K 247 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 188 0 185 1 0 1 1 0 8 0 rtentry 112 143 0 102 3 1 2 2 0 8 0 unpcb 120 1057 0 1040 2 1 1 2 0 8 0 syncache 296 38 0 38 5 5 0 1 0 8 0 tcpqe 32 124 0 124 4 4 0 1 0 8 0 tcpcb 736 784 0 780 25 24 1 4 0 8 0 arp 120 13 0 7 1 0 1 1 0 8 0 inpcb 304 1954 0 1947 14 13 1 2 0 8 0 rttmr 72 9 0 9 1 1 0 1 0 8 0 nd6 48 31 0 27 1 0 1 1 0 8 0 pkpcb 40 13 0 13 2 2 0 1 0 8 0 kcovpl 48 9 0 7 1 0 1 1 0 8 0 ppxss 1248 9 0 9 2 2 0 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfrktable 1344 2 0 2 1 1 0 1 0 8 0 pfstitem 24 88 0 75 1 0 1 1 0 8 0 pfstkey 112 88 0 75 2 0 2 2 0 8 0 pfstate 320 88 0 75 5 3 2 4 0 8 0 pfrule 1360 65 0 59 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 675 0 499 17 6 11 13 0 8 0 art_table 32 676 0 499 2 0 2 2 0 8 0 art_node 16 142 0 104 1 0 1 1 0 8 0 sysvmsgpl 40 53 0 20 1 0 1 1 0 8 0 semupl 112 10 0 10 1 1 0 1 0 8 0 semapl 112 9 0 1 1 0 1 1 0 8 0 shmpl 112 85 0 13 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 7914 0 6503 89 0 89 89 0 8 0 ffsino 272 7914 0 6503 95 0 95 95 0 8 0 nchpl 144 14263 0 12654 61 0 61 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 35681 0 35681 1 0 1 1 0 8 1 percpumem 16 76 0 42 1 0 1 1 0 8 0 vcpupl 1984 5 0 0 1 0 1 1 0 8 0 vmpool 560 5 0 0 1 0 1 1 0 8 0 scxspl 216 41116 0 41115 8 7 1 4 0 8 0 plimitpl 152 203 0 194 1 0 1 1 0 8 0 sigapl 424 5591 0 5555 6 1 5 5 0 8 0 futexpl 56 38378 0 38375 1 0 1 1 0 8 0 knotepl 112 67 0 0 2 0 2 2 0 8 0 kqueuepl 216 2663 0 2656 2 1 1 2 0 8 0 pipepl 336 320 0 309 18 16 2 2 0 8 0 fdescpl 496 5574 0 5555 3 0 3 3 0 8 0 filepl 152 18286 0 18168 10 5 5 6 0 8 0 lockfpl 104 555 0 551 1 0 1 1 0 8 0 lockfspl 48 202 0 199 1 0 1 1 0 8 0 sessionpl 144 25 0 14 1 0 1 1 0 8 0 pgrppl 48 36 0 25 1 0 1 1 0 8 0 ucredpl 96 2442 0 2430 1 0 1 1 0 8 0 zombiepl 144 5555 0 5555 1 0 1 1 0 8 1 processpl 1072 5591 0 5555 3 0 3 3 0 8 0 procpl 672 12425 0 12376 19 14 5 5 0 8 0 srpgc 96 2 0 2 1 1 0 1 0 8 0 sosppl 168 76 0 76 8 8 0 1 0 8 0 sockpl 480 3220 0 3193 15 10 5 6 0 8 0 mcl64k 65536 18 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 1 2 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 19 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 448 0 0 23 1 22 22 0 8 0 mtagpl 96 256 0 0 6 0 6 6 0 8 0 mbufpl 256 1187 0 0 57 1 56 56 0 8 0 bufpl 280 10236 0 3900 453 0 453 453 0 8 0 anonpl 24 1440908 0 1429018 110 30 80 94 0 186 1 amapchunkpl 152 159727 0 159141 63 35 28 37 0 158 5 amappl16 200 11603 0 11217 39 16 23 31 0 8 2 amappl15 192 834 0 831 1 0 1 1 0 8 0 amappl14 184 8 0 8 3 3 0 1 0 8 0 amappl13 176 1214 0 1213 1 0 1 1 0 8 0 amappl12 168 7 0 6 1 0 1 1 0 8 0 amappl11 160 2669 0 2653 1 0 1 1 0 8 0 amappl10 152 760 0 750 1 0 1 1 0 8 0 amappl9 144 252 0 248 1 0 1 1 0 8 0 amappl8 136 529 0 460 3 0 3 3 0 8 0 amappl7 128 93 0 79 1 0 1 1 0 8 0 amappl6 120 160 0 142 1 0 1 1 0 8 0 amappl5 112 3561 0 3542 1 0 1 1 0 8 0 amappl4 104 5948 0 5917 1 0 1 1 0 8 0 amappl3 96 204 0 201 1 0 1 1 0 8 0 amappl2 88 1748 0 1693 2 0 2 2 0 8 0 amappl1 80 98301 0 97834 14 3 11 13 0 8 0 amappl 88 65503 0 65325 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 13 2 0 2 2 0 8 0 uaddrrnd 24 5579 0 5555 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5579 0 5555 1 0 1 1 0 8 0 vmmpekpl 168 31142 0 31112 2 0 2 2 0 8 0 vmmpepl 168 621841 0 619962 141 45 96 96 0 357 14 vmsppl 368 5578 0 5555 3 0 3 3 0 8 0 rwobjpl 56 108919 0 107717 24 6 18 20 0 8 1 pdppl 4096 11166 0 11115 73 22 51 53 0 8 0 pvpl 32 3135958 0 3120451 248 109 139 158 0 265 4 pmappl 224 5578 0 5555 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 422 0 74 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(ffffffff827dcff0) 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(ffffffff8283f660) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8283f660) at __mp_lock+0x122 sys/kern/kern_lock.c:147 intr_handler(ffff8000212693f0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f __sanitizer_cov_trace_const_cmp8(6,2) at __sanitizer_cov_trace_const_cmp8+0x11 kd_curproc sys/dev/kcov.c:559 [inline] __sanitizer_cov_trace_const_cmp8(6,2) at __sanitizer_cov_trace_const_cmp8+0x11 trace_cmp sys/dev/kcov.c:165 [inline] __sanitizer_cov_trace_const_cmp8(6,2) at __sanitizer_cov_trace_const_cmp8+0x11 sys/dev/kcov.c:229 syscall(ffff800021269590) at syscall+0x24d sys/arch/amd64/amd64/trap.c:576 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbd3e0, count: -9 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(fffffd8069f25810,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8069f25810,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8069f25800,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8069f25800,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e14fe78,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e14fe78,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e0cd9e8,0,ffff8000232b3938,ffff8000232b3908,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e0cd9e8,0,ffff8000232b3938,ffff8000232b3908,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000232b3aa0,ffff8000232b3ad8,ffff8000232b3a20,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8069f8ab90,20001000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000232b3c30,20001280) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000232b3c30) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000232b3e70) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232b3e70) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x3aa66087760, count: -15