witness: lock order reversal: 1st 0xfffffd806ed0a448 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806abe0098 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:398 witness_checkorder(fffffd806abe0098,9,0) at witness_checkorder+0x108b rw_enter(fffffd806abe0088,1) at rw_enter+0xd4 rrw_enter(fffffd806abe0088,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807b3d68d8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807b3d68d8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807b3d68d8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021263ce0,fffffd807b3d68d8,fffffd807f7d8660,ffff8000212b3380,ffff8000212b3360) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021263ce0,ffffffff823be575,ffff8000212b3468,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021263ce0,ffffffff823be575,ffff8000212b3468,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021263ce0,ffff8000212b34d8,ffff8000212b3520) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000212b35a0) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212b35a0) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6ef609b0d0, count: -12 ddb{1}> show registers rdi 0xffff8000222b4000 rsi 0x17a53 acpi_pdirpa+0x38bb rbp 0xffff8000212b2f90 rbx 0x3 rdx 0xffff8000222b4000 rcx 0x17a52 acpi_pdirpa+0x38ba rax 0xffffffff818e5e97 db_enter+0x17 r8 0xffffffff8222e651 witness_checkorder+0x1061 r9 0x5 r10 0xb8c99271bbaf5cfb r11 0xfb0cbefedc4043d2 r12 0 r13 0xfffffd806abe0098 r14 0 r15 0xfffffd8002cf46c0 rip 0xffffffff818e5e98 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000212b2f80 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=60090 stat=onproc flags process=0 proc=4000001 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021262540,0xffffffff82846a50 process=0xffff800021224880 user=0xffff8000212ae000, vmspace=0xfffffd806b958180 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 45735 504630 96407 0 7 0x1 syz-executor.1 *45735 60090 96407 0 7 0x4000001 syz-executor.1 96407 434032 17726 0 3 0x82 nanoslp syz-executor.1 21657 419944 17726 0 3 0x2 biowait syz-executor.0 53844 98633 0 0 3 0x14200 bored sosplice 17726 349680 27482 0 3 0x82 thrsleep syz-fuzzer 17726 130070 27482 0 3 0x4000082 nanoslp syz-fuzzer 17726 376526 27482 0 3 0x4000082 thrsleep syz-fuzzer 17726 155427 27482 0 3 0x4000082 thrsleep syz-fuzzer 17726 303015 27482 0 3 0x4000082 thrsleep syz-fuzzer 17726 279770 27482 0 3 0x4000082 thrsleep syz-fuzzer 17726 395153 27482 0 3 0x4000082 thrsleep syz-fuzzer 17726 222411 27482 0 3 0x4000082 kqread syz-fuzzer 27482 157534 21654 0 3 0x10008a sigsusp ksh 21654 102177 21569 0 3 0x92 select sshd 45363 97394 1 0 3 0x100083 ttyin getty 21569 408499 1 0 3 0x80 select sshd 12088 154855 36898 74 3 0x100092 bpf pflogd 36898 100526 1 0 3 0x80 netio pflogd 15784 159711 63912 73 3 0x100090 kqread syslogd 63912 406684 1 0 3 0x100082 netio syslogd 44618 344048 1 77 3 0x100090 poll dhclient 50080 352078 1 0 3 0x80 poll dhclient 9132 437722 0 0 3 0x14200 bored smr 55298 463539 0 0 2 0x14200 zerothread 70391 365294 0 0 3 0x14200 aiodoned aiodoned 12061 2206 0 0 3 0x14200 syncer update 93581 70274 0 0 3 0x14200 cleaner cleaner 42628 125826 0 0 3 0x14200 reaper reaper 40407 134660 0 0 3 0x14200 pgdaemon pagedaemon 50353 89174 0 0 3 0x14200 bored crynlk 24910 440583 0 0 3 0x14200 bored crypto 37515 180029 0 0 3 0x14200 bored viomb 79899 279114 0 0 3 0x40014200 acpi0 acpi0 2387 391788 0 0 3 0x40014200 idle1 44317 373020 0 0 3 0x14200 bored softnet 33496 23815 0 0 3 0x14200 bored systqmp 26252 445432 0 0 3 0x14200 bored systq 44159 485116 0 0 3 0x40014200 bored softclock 58963 141572 0 0 3 0x40014200 idle0 1 462421 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 45735 (syz-executor.1) thread 0xffff800021263ce0 (60090) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82846558) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 ktrstruct+0xee #2 sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 #3 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 #4 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd806ed0a448) #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+0x219 #2 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 #3 Xsyscall+0x128 Process 21657 (syz-executor.0) thread 0xffff800021262a80 (419944) exclusive rrwlock inode r = 0 (0xfffffd806e7672c0) #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+0x416 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x88 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 vget+0x1f7 sys/kern/vfs_subr.c:676 #6 ufs_ihashget+0x121 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x6b sys/ufs/ffs/ffs_vfsops.c:1321 #8 ufs_lookup+0x151d sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:88 #10 vfs_lookup+0x708 sys/kern/vfs_lookup.c:562 #11 namei+0x58a sys/kern/vfs_lookup.c:245 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1859 #13 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806a4f44e0) #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+0x416 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x88 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 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:413 #6 namei+0x58a sys/kern/vfs_lookup.c:245 #7 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1859 #8 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10149 6507K 7155K 78643K 14830 0 pcb 13 8K 8K 78643K 168 0 rtable 108 3K 4K 78643K 381 0 ifaddr 57 12K 12K 78643K 73 0 sysctl 3 1K 1K 78643K 3 0 counters 44 34K 34K 78643K 48 0 ioctlops 0 0K 4K 78643K 1516 0 iov 0 0K 12K 78643K 44 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1224 77K 77K 78643K 2241 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 10 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 229 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 3264 0 sigio 0 0K 0K 78643K 10 0 proc 62 63K 95K 78643K 628 0 subproc 32 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 161 0 in_multi 33 2K 2K 78643K 141 0 ether_multi 1 0K 0K 78643K 30 0 mrt 0 0K 0K 78643K 35 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 61 281K 281K 78643K 61 0 exec 0 0K 2K 78643K 453 0 pfkey data 0 0K 1K 78643K 11 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 231 142K 268K 78643K 40513 0 UVM aobj 19 2K 2K 78643K 19 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 1K 78643K 164 0 NDP 11 0K 0K 78643K 19 0 temp 118 3982K 4050K 78643K 22953 0 kqueue 3 4K 12K 78643K 158 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 20 0 0 1 0 1 1 0 8 0 rtpcb 120 87 0 85 1 0 1 1 0 8 0 rtentry 112 67 0 23 2 0 2 2 0 8 0 unpcb 120 441 0 429 1 0 1 1 0 8 0 syncache 296 37 0 37 7 6 1 1 0 8 1 tcpqe 32 520 0 520 5 4 1 1 0 8 1 tcpcb 736 568 0 557 13 11 2 5 0 8 0 arp 120 10 0 4 1 0 1 1 0 8 0 inpcb 304 1322 0 1316 2 1 1 2 0 8 0 nd6 48 12 0 6 1 0 1 1 0 8 0 pkpcb 40 52 0 52 6 6 0 1 0 8 0 kcovpl 48 4 0 2 1 0 1 1 0 8 0 pffrag 232 9 0 7 2 1 1 1 0 482 0 pffrnode 88 9 0 7 2 1 1 1 0 8 0 pffrent 40 15 0 13 2 1 1 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 pfstitem 24 72 0 51 1 0 1 1 0 8 0 pfstkey 112 72 0 51 1 0 1 1 0 8 0 pfstate 320 72 0 51 3 1 2 3 0 8 0 pfrule 1360 26 0 21 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 276 0 88 12 0 12 12 0 8 0 art_table 32 277 0 88 2 0 2 2 0 8 0 art_node 16 66 0 26 1 0 1 1 0 8 0 sysvmsgpl 40 41 0 1 1 0 1 1 0 8 0 semapl 112 227 0 217 1 0 1 1 0 8 0 shmpl 112 16 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5224 0 3814 92 3 89 89 0 8 0 ffsino 272 5224 0 3814 95 0 95 95 0 8 0 nchpl 144 9015 0 7420 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 22481 0 22481 2 1 1 1 0 8 1 percpumem 16 35 0 2 1 0 1 1 0 8 0 vcpupl 1984 7 0 0 1 0 1 1 0 8 0 vmpool 560 7 0 0 1 0 1 1 0 8 0 scxspl 216 28358 0 28357 14 13 1 8 0 8 0 plimitpl 152 88 0 80 1 0 1 1 0 8 0 sigapl 424 3474 0 3441 4 0 4 4 0 8 0 futexpl 56 21633 0 21633 2 1 1 1 0 8 1 knotepl 112 312 0 292 1 0 1 1 0 8 0 kqueuepl 168 1510 0 1500 1 0 1 1 0 8 0 pipepl 336 234 0 223 7 5 2 3 0 8 0 fdescpl 496 3457 0 3441 3 0 3 3 0 8 0 filepl 152 11038 0 10935 7 2 5 7 0 8 1 lockfpl 104 466 0 465 1 0 1 1 0 8 0 lockfspl 48 160 0 159 1 0 1 1 0 8 0 sessionpl 144 20 0 9 1 0 1 1 0 8 0 pgrppl 48 30 0 19 1 0 1 1 0 8 0 ucredpl 96 1279 0 1270 1 0 1 1 0 8 0 zombiepl 144 3441 0 3441 1 0 1 1 0 8 1 processpl 1080 3474 0 3441 3 0 3 3 0 8 0 procpl 672 7540 0 7499 5 1 4 5 0 8 0 sosppl 168 25 0 25 2 2 0 1 0 8 0 sockpl 432 1907 0 1887 6 3 3 5 0 8 0 mcl64k 65536 13 0 0 2 0 2 2 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 11 0 0 2 0 2 2 0 8 0 mcl4k 4096 14 0 0 2 0 2 2 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 283 0 0 23 1 22 23 0 8 0 mtagpl 96 198 0 0 5 0 5 5 0 8 0 mbufpl 256 765 0 0 39 0 39 39 0 8 0 bufpl 280 8469 0 2205 448 0 448 448 0 8 0 anonpl 24 880093 0 872593 64 11 53 56 0 186 1 amapchunkpl 152 139403 0 138979 652 598 54 646 0 158 36 amappl16 200 7023 0 6811 22 10 12 13 0 8 0 amappl15 192 69 0 63 1 0 1 1 0 8 0 amappl14 184 1591 0 1590 1 0 1 1 0 8 0 amappl13 176 69 0 67 1 0 1 1 0 8 0 amappl12 168 35 0 28 1 0 1 1 0 8 0 amappl11 160 808 0 796 1 0 1 1 0 8 0 amappl10 152 30 0 20 1 0 1 1 0 8 0 amappl9 144 1147 0 1145 1 0 1 1 0 8 0 amappl8 136 401 0 342 3 0 3 3 0 8 0 amappl7 128 913 0 902 1 0 1 1 0 8 0 amappl6 120 125 0 106 1 0 1 1 0 8 0 amappl5 112 1766 0 1754 1 0 1 1 0 8 0 amappl4 104 2908 0 2880 1 0 1 1 0 8 0 amappl3 96 128 0 123 1 0 1 1 0 8 0 amappl2 88 2124 0 2076 2 0 2 2 0 8 0 amappl1 80 61138 0 60718 12 2 10 12 0 8 0 amappl 88 40051 0 39912 4 0 4 4 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 18 0 0 1 0 1 1 0 8 0 uaddrrnd 24 3464 0 3441 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3464 0 3441 1 0 1 1 0 8 0 vmmpekpl 168 19301 0 19272 2 0 2 2 0 8 0 vmmpepl 168 389561 0 388081 83 6 77 77 0 357 6 vmsppl 368 3463 0 3441 3 0 3 3 0 8 0 rwobjpl 56 68366 0 67444 15 1 14 14 0 8 0 pdppl 4096 6935 0 6889 66 18 48 49 0 8 2 pvpl 32 1938999 0 1928291 170 67 103 129 0 265 6 pmappl 232 3463 0 3441 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 368 0 42 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(ffffffff82707ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 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+0x7 sys/dev/kcov.c:139 intr_handler(ffff8000250e0e10,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_pc() at __sanitizer_cov_trace_pc+0x3e kd_curproc sys/dev/kcov.c:571 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x3e sys/dev/kcov.c:143 __mp_lock(ffffffff82846350) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82846350) at __mp_lock+0x133 sys/kern/kern_lock.c:147 ktrstruct(ffff800021262540,ffffffff823c9aab,ffff8000250e0ff8,10) at ktrstruct+0xee sys_clock_gettime(ffff800021262540,ffff8000250e1060,ffff8000250e10b0) at sys_clock_gettime+0xfb sys/kern/kern_time.c:171 syscall(ffff8000250e1130) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000250e1130) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffddd70, count: -12 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:398 witness_checkorder(fffffd806abe0098,9,0) at witness_checkorder+0x108b rw_enter(fffffd806abe0088,1) at rw_enter+0xd4 rrw_enter(fffffd806abe0088,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807b3d68d8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807b3d68d8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807b3d68d8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021263ce0,fffffd807b3d68d8,fffffd807f7d8660,ffff8000212b3380,ffff8000212b3360) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021263ce0,ffffffff823be575,ffff8000212b3468,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021263ce0,ffffffff823be575,ffff8000212b3468,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021263ce0,ffff8000212b34d8,ffff8000212b3520) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000212b35a0) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212b35a0) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6ef609b0d0, count: -12