witness: lock order reversal: 1st 0xfffffd807921b638 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806e4770a0 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic the kernel did not panic ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd806e4770a0,9,0) at witness_checkorder+0x108b rw_enter(fffffd806e477090,1) at rw_enter+0xd4 rrw_enter(fffffd806e477090,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806ad10470,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806ad10470,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806ad10470,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021278a80,fffffd806ad10470,fffffd807f7d8960,ffff8000233055e0,ffff8000233055c0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021278a80,ffffffff823be683,ffff8000233056c8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021278a80,ffffffff823be683,ffff8000233056c8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021278a80,ffff800023305738,ffff800023305780) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800023305800) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023305800) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x40e83176b40, count: -12 ddb{0}> show registers rdi 0xffff8000244ba000 rsi 0x15414 acpi_pdirpa+0x127c rbp 0xffff8000233051f0 rbx 0x3 rdx 0xffff8000244ba000 rcx 0x15413 acpi_pdirpa+0x127b rax 0xffffffff816fa5f7 db_enter+0x17 r8 0xffffffff81819db1 witness_checkorder+0x1061 r9 0x5 r10 0x5884738a60080c43 r11 0x3c1c513c5469e5bc r12 0 r13 0xfffffd806e4770a0 r14 0 r15 0xfffffd8002cfb740 rip 0xffffffff816fa5f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000233051e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=379053 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021278fc0,0xffffffff8293ddb8 process=0xffff800021226a40 user=0xffff800023300000, vmspace=0xfffffd807f0095c0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 33888 161715 58165 0 7 0x1 syz-executor.0 *33888 379053 58165 0 7 0x4000001 syz-executor.0 58165 216654 99475 0 3 0x82 nanoslp syz-executor.0 1874 295692 99475 0 3 0x82 nanoslp syz-executor.1 79348 353299 1 0 3 0x100083 ttyin getty 56542 199564 0 0 3 0x14200 bored sosplice 99475 425882 7136 0 3 0x82 thrsleep syz-fuzzer 99475 288931 7136 0 3 0x4000082 thrsleep syz-fuzzer 99475 61003 7136 0 3 0x4000082 thrsleep syz-fuzzer 99475 506249 7136 0 3 0x4000082 thrsleep syz-fuzzer 99475 149754 7136 0 3 0x4000082 thrsleep syz-fuzzer 99475 360245 7136 0 3 0x4000082 kqread syz-fuzzer 99475 257018 7136 0 3 0x4000082 thrsleep syz-fuzzer 99475 278889 7136 0 3 0x4000082 thrsleep syz-fuzzer 7136 251997 14840 0 3 0x10008a sigsusp ksh 14840 171872 94148 0 3 0x92 select sshd 94148 20035 1 0 3 0x80 select sshd 32591 432984 7411 74 3 0x100092 bpf pflogd 7411 516376 1 0 3 0x80 netio pflogd 9737 386937 67870 73 3 0x100090 kqread syslogd 67870 430725 1 0 3 0x100082 netio syslogd 60627 502115 1 77 3 0x100090 poll dhclient 81475 457139 1 0 3 0x80 poll dhclient 172 227572 0 0 3 0x14200 bored smr 37727 302075 0 0 2 0x14200 zerothread 93857 444259 0 0 3 0x14200 aiodoned aiodoned 21777 396201 0 0 3 0x14200 syncer update 38300 405147 0 0 3 0x14200 cleaner cleaner 7668 122996 0 0 3 0x14200 reaper reaper 53285 448937 0 0 3 0x14200 pgdaemon pagedaemon 7375 505595 0 0 3 0x14200 bored crynlk 40924 341866 0 0 3 0x14200 bored crypto 64967 448202 0 0 3 0x14200 bored viomb 79917 224407 0 0 3 0x40014200 acpi0 acpi0 92428 396549 0 0 3 0x40014200 idle1 62483 37220 0 0 3 0x14200 bored softnet 28663 344831 0 0 3 0x14200 bored systqmp 92085 176463 0 0 3 0x14200 bored systq 58495 285561 0 0 3 0x40014200 bored softclock 33974 398483 0 0 3 0x40014200 idle0 1 489337 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 33888 (syz-executor.0) thread 0xffff800021278a80 (379053) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8295e578) #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:585 #4 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd807921b638) #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:585 #3 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10149 6491K 6878K 78643K 13566 0 pcb 13 8K 8K 78643K 106 0 rtable 83 2K 3K 78643K 410 0 ifaddr 54 11K 13K 78643K 106 0 sysctl 3 1K 1K 78643K 3 0 counters 42 33K 34K 78643K 58 0 ioctlops 0 0K 4K 78643K 1573 0 iov 0 0K 12K 78643K 130 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1227 77K 77K 78643K 2149 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 45 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 249 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 2802 0 sigio 0 0K 0K 78643K 5 0 proc 62 63K 83K 78643K 631 0 subproc 32 2K 2K 78643K 85 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 183 0 in_multi 22 1K 2K 78643K 156 0 ether_multi 1 0K 0K 78643K 24 0 mrt 0 0K 0K 78643K 12 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 532 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 235 142K 158K 78643K 34751 0 UVM aobj 43 7K 7K 78643K 43 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 105 0 NDP 9 0K 0K 78643K 28 0 temp 118 3982K 4046K 78643K 18804 0 kqueue 3 4K 16K 78643K 116 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> 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 94 0 92 1 0 1 1 0 8 0 rtentry 112 79 0 46 2 0 2 2 0 8 0 unpcb 120 511 0 498 1 0 1 1 0 8 0 syncache 296 33 0 33 2 2 0 1 0 8 0 tcpqe 32 101 0 101 1 1 0 1 0 8 0 tcpcb 736 357 0 353 9 8 1 4 0 8 0 arp 120 12 0 8 1 0 1 1 0 8 0 inpcb 304 1020 0 1014 1 0 1 1 0 8 0 nd6 48 16 0 13 1 0 1 1 0 8 0 pkpcb 40 36 0 36 5 4 1 1 0 8 1 kcovpl 48 5 0 3 1 0 1 1 0 8 0 pffrag 232 11 0 11 1 1 0 1 0 482 0 pffrnode 88 11 0 11 1 1 0 1 0 8 0 pffrent 40 27 0 27 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 pfstitem 24 81 0 47 1 0 1 1 0 8 0 pfstkey 112 81 0 47 2 0 2 2 0 8 0 pfstate 320 81 0 47 6 0 6 6 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 324 0 176 12 0 12 12 0 8 2 art_table 32 325 0 176 2 0 2 2 0 8 0 art_node 16 78 0 48 1 0 1 1 0 8 0 sysvmsgpl 40 5 0 5 1 0 1 1 0 8 1 semupl 112 5 0 5 1 1 0 1 0 8 0 semapl 112 247 0 237 1 0 1 1 0 8 0 shmpl 112 40 0 0 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4888 0 3488 89 1 88 89 0 8 0 ffsino 272 4888 0 3488 94 0 94 94 0 8 0 nchpl 144 8176 0 6585 60 0 60 60 0 8 0 uvmvnodes 72 5517 0 0 101 0 101 101 0 8 0 vnodes 224 5517 0 0 325 0 325 325 0 8 0 namei 1024 19602 0 19602 1 0 1 1 0 8 1 percpumem 16 40 0 8 1 0 1 1 0 8 0 vcpupl 1984 12 0 0 2 0 2 2 0 8 0 vmpool 560 37 0 25 1 0 1 1 0 8 0 scxspl 216 23205 0 23205 9 8 1 8 0 8 1 plimitpl 152 93 0 85 1 0 1 1 0 8 0 sigapl 424 3011 0 2978 4 0 4 4 0 8 0 futexpl 56 18111 0 18111 1 0 1 1 0 8 1 knotepl 112 246 0 226 1 0 1 1 0 8 0 kqueuepl 168 1373 0 1370 1 0 1 1 0 8 0 pipepl 336 126 0 115 5 4 1 2 0 8 0 fdescpl 496 2994 0 2978 3 0 3 3 0 8 0 filepl 152 9169 0 9065 6 1 5 6 0 8 1 lockfpl 104 292 0 291 1 0 1 1 0 8 0 lockfspl 48 110 0 109 1 0 1 1 0 8 0 sessionpl 144 23 0 12 1 0 1 1 0 8 0 pgrppl 48 23 0 12 1 0 1 1 0 8 0 ucredpl 96 874 0 865 1 0 1 1 0 8 0 zombiepl 144 2978 0 2977 1 0 1 1 0 8 0 processpl 1080 3011 0 2977 3 0 3 3 0 8 0 procpl 672 6286 0 6244 4 0 4 4 0 8 0 srpgc 96 2 0 2 1 0 1 1 0 8 1 sosppl 168 10 0 10 1 1 0 1 0 8 0 sockpl 480 1661 0 1640 6 2 4 4 0 8 0 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 7 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 18 0 0 3 0 3 3 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 216 0 0 19 0 19 19 0 8 0 mtagpl 96 76 0 0 2 0 2 2 0 8 0 mbufpl 256 869 0 0 51 0 51 51 0 8 0 bufpl 280 6472 0 206 448 0 448 448 0 8 0 anonpl 24 735193 0 727914 53 1 52 52 0 186 6 amapchunkpl 152 83153 0 82769 34 16 18 31 0 158 2 amappl16 200 5486 0 5296 14 1 13 13 0 8 2 amappl15 192 93 0 87 1 0 1 1 0 8 0 amappl14 184 7 0 5 1 0 1 1 0 8 0 amappl13 176 51 0 49 1 0 1 1 0 8 0 amappl12 168 42 0 33 1 0 1 1 0 8 0 amappl11 160 567 0 554 1 0 1 1 0 8 0 amappl10 152 746 0 740 1 0 1 1 0 8 0 amappl9 144 107 0 106 2 1 1 1 0 8 0 amappl8 136 2688 0 2629 3 0 3 3 0 8 0 amappl7 128 68 0 58 1 0 1 1 0 8 0 amappl6 120 858 0 839 1 0 1 1 0 8 0 amappl5 112 3254 0 3241 1 0 1 1 0 8 0 amappl4 104 1112 0 1078 1 0 1 1 0 8 0 amappl3 96 96 0 92 1 0 1 1 0 8 0 amappl2 88 560 0 508 2 0 2 2 0 8 0 amappl1 80 52761 0 52346 13 3 10 12 0 8 0 amappl 88 34233 0 34090 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 42 0 0 1 0 1 1 0 8 0 uaddrrnd 24 3031 0 3003 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3031 0 3003 1 0 1 1 0 8 0 vmmpekpl 168 17769 0 17744 2 0 2 2 0 8 0 vmmpepl 168 327061 0 325582 80 8 72 74 0 357 2 vmsppl 368 3030 0 3003 3 0 3 3 0 8 0 rwobjpl 56 58250 0 57337 17 2 15 15 0 8 1 pdppl 4096 6069 0 6018 71 18 53 55 0 8 2 pvpl 32 1593761 0 1583242 149 45 104 129 0 265 15 pmappl 232 3030 0 3003 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 369 0 34 10 0 10 10 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd806e4770a0,9,0) at witness_checkorder+0x108b rw_enter(fffffd806e477090,1) at rw_enter+0xd4 rrw_enter(fffffd806e477090,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806ad10470,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806ad10470,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806ad10470,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021278a80,fffffd806ad10470,fffffd807f7d8960,ffff8000233055e0,ffff8000233055c0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021278a80,ffffffff823be683,ffff8000233056c8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021278a80,ffffffff823be683,ffff8000233056c8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021278a80,ffff800023305738,ffff800023305780) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800023305800) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023305800) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x40e83176b40, count: -12 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d58ff0) 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+0x37 kd_curproc sys/dev/kcov.c:570 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x37 sys/dev/kcov.c:143 __mp_lock(ffffffff8295e370) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8295e370) at __mp_lock+0x133 sys/kern/kern_lock.c:147 ktrstruct(ffff800021278fc0,ffffffff823ce164,ffff8000232ffae8,10) at ktrstruct+0xee sys_clock_gettime(ffff800021278fc0,ffff8000232ffb50,ffff8000232ffba0) at sys_clock_gettime+0xfb sys/kern/kern_time.c:171 syscall(ffff8000232ffc20) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232ffc20) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd0870, count: -9