witness: lock order reversal: 1st 0xfffffd80715e3638 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80667211b0 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(fffffd80667211b0,9,0) at witness_checkorder+0x108b rw_enter(fffffd80667211a0,1) at rw_enter+0xd4 rrw_enter(fffffd80667211a0,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806b381808,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806b381808,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806b381808,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff80002122cd20,fffffd806b381808,fffffd807f7d83c0,ffff8000242c5430,ffff8000242c5410) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff80002122cd20,ffffffff823b9dc3,ffff8000242c5518,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff80002122cd20,ffffffff823b9dc3,ffff8000242c5518,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff80002122cd20,ffff8000242c5588,ffff8000242c55d0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000242c5650) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000242c5650) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x76902d92610, count: -12 ddb{1}> show registers rdi 0xffff8000222ba000 rsi 0x17685 acpi_pdirpa+0x34ed rbp 0xffff8000242c5040 rbx 0x3 rdx 0xffff8000222ba000 rcx 0x17684 acpi_pdirpa+0x34ec rax 0xffffffff8183eaa7 db_enter+0x17 r8 0xffffffff81567231 witness_checkorder+0x1061 r9 0x5 r10 0x37d9d36aa6a19105 r11 0x51dcc006d60fadf8 r12 0 r13 0xfffffd80667211b0 r14 0 r15 0xfffffd8002cf4740 rip 0xffffffff8183eaa8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000242c5030 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=341300 stat=onproc flags process=10 proc=4000001 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff80002122c7e0,0xffffffff828e0d20 process=0xffff8000212250f0 user=0xffff8000242c0000, vmspace=0xfffffd80084d25c0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 60399 191043 2315 60929 7 0x11 syz-executor.1 *60399 341300 2315 60929 7 0x4000011 syz-executor.1 2315 72359 10477 0 3 0x82 nanoslp syz-executor.1 22512 118145 10477 0 3 0x82 nanoslp syz-executor.0 10477 328584 29010 0 3 0x82 thrsleep syz-fuzzer 10477 23649 29010 0 3 0x4000082 thrsleep syz-fuzzer 10477 111566 29010 0 3 0x4000082 thrsleep syz-fuzzer 10477 236653 29010 0 3 0x4000082 kqread syz-fuzzer 10477 299445 29010 0 3 0x4000082 thrsleep syz-fuzzer 10477 333404 29010 0 3 0x4000082 thrsleep syz-fuzzer 10477 341680 29010 0 3 0x4000082 thrsleep syz-fuzzer 10477 225682 29010 0 3 0x4000082 thrsleep syz-fuzzer 29010 354425 79505 0 3 0x10008a sigsusp ksh 79505 316680 25348 0 3 0x92 select sshd 14349 85986 1 0 3 0x100083 ttyin getty 25348 406971 1 0 3 0x80 select sshd 81276 49278 21881 74 3 0x100092 bpf pflogd 21881 125217 1 0 3 0x80 netio pflogd 84102 264171 8961 73 3 0x100090 kqread syslogd 8961 367534 1 0 3 0x100082 netio syslogd 29854 482816 1 77 3 0x100090 poll dhclient 12766 157976 1 0 3 0x80 poll dhclient 79736 394426 0 0 3 0x14200 bored smr 32477 139045 0 0 3 0x14200 pgzero zerothread 85773 342955 0 0 3 0x14200 aiodoned aiodoned 22970 459210 0 0 3 0x14200 syncer update 23001 520411 0 0 3 0x14200 cleaner cleaner 58822 287190 0 0 3 0x14200 reaper reaper 62855 190828 0 0 3 0x14200 pgdaemon pagedaemon 20960 96503 0 0 3 0x14200 bored crynlk 44402 160494 0 0 3 0x14200 bored crypto 60007 202570 0 0 3 0x14200 bored viomb 65985 382048 0 0 3 0x40014200 acpi0 acpi0 11960 40921 0 0 3 0x40014200 idle1 92850 69752 0 0 3 0x14200 bored softnet 13149 230132 0 0 3 0x14200 bored systqmp 7007 282583 0 0 3 0x14200 bored systq 35899 176147 0 0 3 0x40014200 bored softclock 89066 514452 0 0 3 0x40014200 idle0 1 393662 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 60399 (syz-executor.1) thread 0xffff80002122cd20 (341300) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82795c40) #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 (0xfffffd80715e3638) #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 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10161 6575K 6961K 78643K 12707 0 pcb 13 8K 8K 78643K 93 0 rtable 105 3K 3K 78643K 325 0 ifaddr 61 12K 12K 78643K 77 0 counters 44 34K 34K 78643K 48 0 ioctlops 0 0K 4K 78643K 1502 0 iov 0 0K 12K 78643K 44 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1241 78K 78K 78643K 1901 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 12 0 VM map 2 1K 1K 78643K 2 0 sem 10 1K 1K 78643K 16 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 1921 0 sigio 0 0K 0K 78643K 10 0 proc 63 63K 95K 78643K 802 0 subproc 32 2K 3K 78643K 102 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 104 0 in_multi 33 2K 2K 78643K 164 0 ether_multi 1 0K 0K 78643K 34 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 541 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 172 24K 33K 78643K 24080 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 0K 78643K 82 0 NDP 10 0K 0K 78643K 20 0 temp 123 3982K 4048K 78643K 47508 0 kqueue 3 4K 8K 78643K 46 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 91 0 89 1 0 1 1 0 8 0 rtentry 112 67 0 23 2 0 2 2 0 8 0 unpcb 120 420 0 408 1 0 1 1 0 8 0 syncache 296 8 0 8 2 2 0 1 0 8 0 tcpqe 32 13 0 13 2 2 0 1 0 8 0 tcpcb 736 229 0 225 10 8 2 5 0 8 1 arp 120 10 0 4 1 0 1 1 0 8 0 inpcb 304 590 0 584 1 0 1 1 0 8 0 nd6 48 12 0 6 1 0 1 1 0 8 0 pkpcb 40 57 0 57 6 6 0 1 0 8 0 kcovpl 48 6 0 4 1 0 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 40 0 37 1 0 1 1 0 8 0 pfstkey 112 40 0 37 1 0 1 1 0 8 0 pfstate 320 40 0 37 3 2 1 3 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 277 0 88 12 0 12 12 0 8 0 art_table 32 278 0 88 2 0 2 2 0 8 0 art_node 16 66 0 26 1 0 1 1 0 8 0 sysvmsgpl 40 40 0 40 1 1 0 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 8 0 0 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 3906 0 2492 90 1 89 89 0 8 0 ffsino 272 3906 0 2492 95 0 95 95 0 8 0 nchpl 144 6399 0 4800 60 0 60 60 0 8 0 uvmvnodes 72 4394 0 0 80 0 80 80 0 8 0 vnodes 224 4394 0 0 259 0 259 259 0 8 0 namei 1024 15846 0 15846 1 0 1 1 0 8 1 percpumem 16 35 0 2 1 0 1 1 0 8 0 scsiplug 72 4 0 4 1 1 0 1 0 8 0 scxspl 216 18536 0 18536 12 9 3 8 0 8 3 plimitpl 152 59 0 51 1 0 1 1 0 8 0 sigapl 424 2124 0 2092 4 0 4 4 0 8 0 futexpl 56 13803 0 13803 1 0 1 1 0 8 1 knotepl 112 199 0 179 1 0 1 1 0 8 0 kqueuepl 168 856 0 854 1 0 1 1 0 8 0 pipepl 336 143 0 132 4 2 2 2 0 8 1 fdescpl 496 2108 0 2092 3 0 3 3 0 8 0 filepl 152 6970 0 6866 5 0 5 5 0 8 0 lockfpl 104 150 0 149 1 0 1 1 0 8 0 lockfspl 48 72 0 71 1 0 1 1 0 8 0 sessionpl 144 22 0 11 1 0 1 1 0 8 0 pgrppl 48 22 0 11 1 0 1 1 0 8 0 ucredpl 96 673 0 658 1 0 1 1 0 8 0 zombiepl 144 2092 0 2091 1 0 1 1 0 8 0 processpl 1080 2124 0 2091 3 0 3 3 0 8 0 procpl 672 4394 0 4353 4 0 4 4 0 8 0 sockpl 480 1176 0 1156 6 3 3 4 0 8 0 mcl64k 65536 22 0 0 3 0 3 3 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 13 0 0 2 0 2 2 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 218 0 0 17 0 17 17 0 8 0 mtagpl 96 53 0 0 2 0 2 2 0 8 0 mbufpl 256 452 0 0 23 0 23 23 0 8 0 bufpl 280 6257 0 154 436 0 436 436 0 8 0 anonpl 24 516799 0 510320 47 2 45 45 0 186 4 amapchunkpl 152 57015 0 56654 19 3 16 18 0 158 1 amappl16 200 3690 0 3520 12 1 11 11 0 8 2 amappl15 192 409 0 402 1 0 1 1 0 8 0 amappl14 184 627 0 625 1 0 1 1 0 8 0 amappl13 176 40 0 38 1 0 1 1 0 8 0 amappl12 168 38 0 31 1 0 1 1 0 8 0 amappl11 160 642 0 629 1 0 1 1 0 8 0 amappl10 152 25 0 19 1 0 1 1 0 8 0 amappl9 144 464 0 461 1 0 1 1 0 8 0 amappl8 136 387 0 345 2 0 2 2 0 8 0 amappl7 128 373 0 361 1 0 1 1 0 8 0 amappl6 120 123 0 107 1 0 1 1 0 8 0 amappl5 112 2236 0 2222 1 0 1 1 0 8 0 amappl4 104 1180 0 1150 1 0 1 1 0 8 0 amappl3 96 103 0 98 1 0 1 1 0 8 0 amappl2 88 1106 0 1058 2 0 2 2 0 8 0 amappl1 80 38543 0 38127 12 2 10 12 0 8 0 amappl 88 23663 0 23549 4 1 3 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 2108 0 2092 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2108 0 2092 1 0 1 1 0 8 0 vmmpekpl 168 13194 0 13168 2 0 2 2 0 8 0 vmmpepl 168 231532 0 230135 82 15 67 78 0 357 1 vmsppl 368 2107 0 2092 2 0 2 2 0 8 0 rwobjpl 56 41763 0 40923 15 2 13 13 0 8 0 pdppl 4096 4223 0 4184 61 20 41 45 0 8 2 pvpl 32 1150592 0 1140744 152 57 95 128 0 265 12 pmappl 232 2107 0 2092 3 2 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 330 0 34 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff826fbff0) 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+0x43 sys/dev/kcov.c:149 __mp_lock(ffffffff82795a38) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82795a38) at __mp_lock+0x133 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(ffffffff82795a38) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82795a38) at __mp_lock+0x129 sys/kern/kern_lock.c:147 ktrstruct(ffff80002122c7e0,ffffffff823c815c,ffff80002169f908,10) at ktrstruct+0xee sys_clock_gettime(ffff80002122c7e0,ffff80002169f970,ffff80002169f9c0) at sys_clock_gettime+0xfb sys/kern/kern_time.c:171 syscall(ffff80002169fa40) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002169fa40) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd8d80, 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(fffffd80667211b0,9,0) at witness_checkorder+0x108b rw_enter(fffffd80667211a0,1) at rw_enter+0xd4 rrw_enter(fffffd80667211a0,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806b381808,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806b381808,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806b381808,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff80002122cd20,fffffd806b381808,fffffd807f7d83c0,ffff8000242c5430,ffff8000242c5410) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff80002122cd20,ffffffff823b9dc3,ffff8000242c5518,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff80002122cd20,ffffffff823b9dc3,ffff8000242c5518,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff80002122cd20,ffff8000242c5588,ffff8000242c55d0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000242c5650) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000242c5650) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x76902d92610, count: -12