login: witness: lock order reversal: 1st 0xfffffd806e781c08 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807be6e0a0 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(fffffd807be6e0a0,9,0) at witness_checkorder+0x108b rw_enter(fffffd807be6e090,1) at rw_enter+0xd4 rrw_enter(fffffd807be6e090,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd80687d0580,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd80687d0580,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd80687d0580,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021268fc0,fffffd80687d0580,fffffd807f7d8a20,ffff8000222c55b0,ffff8000222c5590) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021268fc0,ffffffff823b712b,ffff8000222c5698,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021268fc0,ffffffff823b712b,ffff8000222c5698,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021268fc0,ffff8000222c5708,ffff8000222c5750) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000222c57d0) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c57d0) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9a8588a5a10, count: -12 ddb{1}> show registers rdi 0xffff8000234c0000 rsi 0xc3ad __ALIGN_SIZE+0xb3ad rbp 0xffff8000222c51c0 rbx 0x3 rdx 0xffff8000234c0000 rcx 0xc3ac __ALIGN_SIZE+0xb3ac rax 0xffffffff81148857 db_enter+0x17 r8 0xffffffff819b29b1 witness_checkorder+0x1061 r9 0x5 r10 0x59f0c439b4e43a5a r11 0x66798fb84a91e0b r12 0 r13 0xfffffd807be6e0a0 r14 0 r15 0xfffffd8002cf56c0 rip 0xffffffff81148858 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222c51b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=162628 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800021268d20,0xffff800021268010 process=0xffff800021226a40 user=0xffff8000222c0000, vmspace=0xfffffd80084d28a0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 68632 435589 65103 0 7 0 syz-executor.0 68632 219323 65103 0 2 0x4000000 syz-executor.0 46458 503699 30758 0 2 0 syz-executor.1 *46458 162628 30758 0 7 0x4000001 syz-executor.1 73342 415788 0 0 3 0x14200 bored sosplice 30758 312347 22437 0 3 0x82 nanoslp syz-executor.1 65103 424624 22437 0 3 0x82 nanoslp syz-executor.0 22437 79488 39416 0 3 0x82 thrsleep syz-fuzzer 22437 451147 39416 0 3 0x4000082 thrsleep syz-fuzzer 22437 117761 39416 0 3 0x4000082 thrsleep syz-fuzzer 22437 141092 39416 0 3 0x4000082 thrsleep syz-fuzzer 22437 21222 39416 0 3 0x4000082 kqread syz-fuzzer 22437 504232 39416 0 3 0x4000082 thrsleep syz-fuzzer 22437 394412 39416 0 3 0x4000082 thrsleep syz-fuzzer 22437 373734 39416 0 3 0x4000082 thrsleep syz-fuzzer 39416 114396 20024 0 3 0x10008a sigsusp ksh 20024 295025 4504 0 3 0x92 select sshd 42753 117886 1 0 3 0x100083 ttyin getty 4504 516534 1 0 3 0x80 select sshd 82797 286947 3446 74 3 0x100092 bpf pflogd 3446 293211 1 0 3 0x80 netio pflogd 89684 170733 34883 73 3 0x100090 kqread syslogd 34883 366631 1 0 3 0x100082 netio syslogd 67142 143207 1 77 3 0x100090 poll dhclient 50674 359194 1 0 3 0x80 poll dhclient 76656 494393 0 0 3 0x14200 bored smr 92063 228038 0 0 2 0x14200 zerothread 19303 39803 0 0 3 0x14200 aiodoned aiodoned 95171 445808 0 0 3 0x14200 syncer update 15685 384668 0 0 3 0x14200 cleaner cleaner 60670 285075 0 0 3 0x14200 reaper reaper 63635 436922 0 0 3 0x14200 pgdaemon pagedaemon 10783 47366 0 0 3 0x14200 bored crynlk 93989 417415 0 0 3 0x14200 bored crypto 92838 475671 0 0 3 0x14200 bored viomb 53895 151878 0 0 3 0x40014200 acpi0 acpi0 37421 449521 0 0 3 0x40014200 idle1 98040 21811 0 0 3 0x14200 bored softnet 84776 22640 0 0 3 0x14200 bored systqmp 50781 372135 0 0 3 0x14200 bored systq 97509 510568 0 0 3 0x40014200 bored softclock 71027 262735 0 0 3 0x40014200 idle0 1 341855 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 46458 (syz-executor.1) thread 0xffff800021268fc0 (162628) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82947670) #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 (0xfffffd806e781c08) #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 10131 6486K 6933K 78643K 12399 0 pcb 13 8K 8K 78643K 49 0 rtable 110 4K 4K 78643K 240 0 ifaddr 50 11K 11K 78643K 51 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1530 0 iov 0 0K 12K 78643K 54 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1219 77K 77K 78643K 1530 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 61 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 1028 0 proc 62 63K 95K 78643K 492 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 29 0 in_multi 33 2K 2K 78643K 54 0 ether_multi 1 0K 0K 78643K 11 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 49 228K 228K 78643K 49 0 exec 0 0K 2K 78643K 361 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 185 57K 57K 78643K 13585 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 33 0 NDP 7 0K 0K 78643K 11 0 temp 97 3980K 4044K 78643K 5914 0 kqueue 3 4K 12K 78643K 57 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 56 0 54 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 117 0 105 1 0 1 1 0 8 0 syncache 296 7 0 7 2 2 0 1 0 8 0 tcpqe 32 367 0 367 3 3 0 2 0 8 0 tcpcb 736 96 0 87 2 0 2 2 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 322 0 314 2 1 1 2 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 34 0 34 3 3 0 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 2 0 1 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 pfrktable 1344 2 0 0 1 0 1 1 0 8 0 pfstitem 24 14 0 5 1 0 1 1 0 8 0 pfstkey 112 14 0 5 1 0 1 1 0 8 0 pfstate 320 14 0 5 1 0 1 1 0 8 0 pfrule 1360 55 0 33 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 188 0 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 29 0 1 1 0 1 1 0 8 0 semapl 112 59 0 49 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2582 0 1176 89 1 88 89 0 8 0 ffsino 272 2582 0 1176 95 0 95 95 0 8 0 nchpl 144 3928 0 2317 60 0 60 60 0 8 0 uvmvnodes 72 2880 0 0 53 0 53 53 0 8 0 vnodes 224 2880 0 0 170 0 170 170 0 8 0 namei 1024 9523 0 9523 1 0 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 vcpupl 1984 6 0 0 1 0 1 1 0 8 0 vmpool 560 6 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 17 0 0 1 0 1 1 0 8 0 scxspl 216 11400 0 11400 9 8 1 8 0 8 1 plimitpl 152 20 0 12 1 0 1 1 0 8 0 sigapl 424 1244 0 1210 4 0 4 4 0 8 0 futexpl 56 6379 0 6379 1 0 1 1 0 8 1 knotepl 112 117 0 97 1 0 1 1 0 8 0 kqueuepl 168 512 0 510 1 0 1 1 0 8 0 pipepl 336 84 0 72 3 1 2 2 0 8 0 fdescpl 496 1227 0 1210 3 0 3 3 0 8 0 filepl 152 3904 0 3796 5 0 5 5 0 8 0 lockfpl 104 103 0 102 1 0 1 1 0 8 0 lockfspl 48 50 0 49 1 0 1 1 0 8 0 sessionpl 144 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 362 0 353 1 0 1 1 0 8 0 zombiepl 144 1210 0 1210 1 0 1 1 0 8 1 processpl 1080 1244 0 1210 3 0 3 3 0 8 0 procpl 672 2450 0 2407 4 0 4 4 0 8 0 sosppl 168 2 0 1 1 0 1 1 0 8 0 sockpl 480 529 0 507 4 0 4 4 0 8 0 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 7 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 225 0 0 28 0 28 28 0 8 0 mtagpl 96 57 0 0 2 0 2 2 0 8 0 mbufpl 256 413 0 0 25 0 25 25 0 8 0 bufpl 280 4455 0 154 308 0 308 308 0 8 0 anonpl 24 306215 0 297133 75 16 59 74 0 186 0 amapchunkpl 152 31926 0 31522 18 1 17 17 0 158 1 amappl16 200 2874 0 2561 28 9 19 27 0 8 0 amappl15 192 567 0 560 1 0 1 1 0 8 0 amappl14 184 25 0 25 2 2 0 1 0 8 0 amappl13 176 565 0 560 1 0 1 1 0 8 0 amappl12 168 73 0 65 1 0 1 1 0 8 0 amappl11 160 53 0 41 1 0 1 1 0 8 0 amappl10 152 29 0 21 1 0 1 1 0 8 0 amappl9 144 283 0 283 1 1 0 1 0 8 0 amappl8 136 318 0 284 2 0 2 2 0 8 0 amappl7 128 70 0 61 1 0 1 1 0 8 0 amappl6 120 109 0 94 1 0 1 1 0 8 0 amappl5 112 679 0 667 1 0 1 1 0 8 0 amappl4 104 529 0 502 1 0 1 1 0 8 0 amappl3 96 1059 0 1049 1 0 1 1 0 8 0 amappl2 88 440 0 394 2 0 2 2 0 8 0 amappl1 80 23691 0 23256 12 2 10 12 0 8 0 amappl 88 13279 0 13150 3 0 3 3 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 1233 0 1210 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1233 0 1210 1 0 1 1 0 8 0 vmmpekpl 168 9738 0 9715 2 0 2 2 0 8 0 vmmpepl 168 135063 0 133426 81 9 72 80 0 357 0 vmsppl 368 1232 0 1210 2 0 2 2 0 8 0 rwobjpl 56 26130 0 25133 18 2 16 17 0 8 0 pdppl 4096 2473 0 2426 65 17 48 48 0 8 1 pvpl 32 692457 0 681982 130 40 90 128 0 265 3 pmappl 232 1232 0 1210 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 335 0 22 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(ffffffff826d4ff0) 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 __mp_lock(ffffffff82947468) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82947468) at __mp_lock+0x122 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(ffffffff82947468) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82947468) at __mp_lock+0x122 sys/kern/kern_lock.c:147 syscall(ffff8000222bf640) at syscall+0x37b mi_syscall sys/sys/syscall_mi.h:75 [inline] syscall(ffff8000222bf640) at syscall+0x37b sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc6080, 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:398 witness_checkorder(fffffd807be6e0a0,9,0) at witness_checkorder+0x108b rw_enter(fffffd807be6e090,1) at rw_enter+0xd4 rrw_enter(fffffd807be6e090,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd80687d0580,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd80687d0580,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd80687d0580,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021268fc0,fffffd80687d0580,fffffd807f7d8a20,ffff8000222c55b0,ffff8000222c5590) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021268fc0,ffffffff823b712b,ffff8000222c5698,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021268fc0,ffffffff823b712b,ffff8000222c5698,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021268fc0,ffff8000222c5708,ffff8000222c5750) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000222c57d0) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c57d0) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9a8588a5a10, count: -12