witness: lock order reversal: 1st 0xfffffd8077827638 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806908b5f8 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(fffffd806908b5f8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806908b5e8,1) at rw_enter+0xd4 rrw_enter(fffffd806908b5e8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806ed9e8c8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806ed9e8c8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806ed9e8c8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff80002126a540,fffffd806ed9e8c8,fffffd807f7d89c0,ffff8000232e9100,ffff8000232e90e0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff80002126a540,ffffffff823bae47,ffff8000232e91e8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff80002126a540,ffffffff823bae47,ffff8000232e91e8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff80002126a540,ffff8000232e9258,ffff8000232e92a0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000232e9320) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232e9320) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x872bc608850, count: -12 ddb{1}> show registers rdi 0xffff8000222c2000 rsi 0xc9bd __ALIGN_SIZE+0xb9bd rbp 0xffff8000232e8d10 rbx 0x3 rdx 0xffff8000222c2000 rcx 0xc9bc __ALIGN_SIZE+0xb9bc rax 0xffffffff818b6a67 db_enter+0x17 r8 0xffffffff8203b7c1 witness_checkorder+0x1061 r9 0x5 r10 0xdc97feb8acb086f3 r11 0x120d5f0a24718914 r12 0 r13 0xfffffd806908b5f8 r14 0 r15 0xfffffd8002cf9740 rip 0xffffffff818b6a68 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000232e8d00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=448132 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=76, nice=20 forw=0xffffffffffffffff, list=0xffff80002126b260,0xffff80002126b510 process=0xffff800021226608 user=0xffff8000232e4000, vmspace=0xfffffd806e8ffe68 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 62940 308606 25383 0 7 0 syz-executor.0 62940 372180 25383 0 2 0x4000000 syz-executor.0 47160 515822 94196 0 2 0 syz-executor.1 *47160 448132 94196 0 7 0x4000001 syz-executor.1 76669 508483 0 0 3 0x14200 acct acct 15343 239043 0 0 3 0x14200 bored sosplice 94196 394699 48139 0 3 0x82 nanoslp syz-executor.1 25383 519621 48139 0 3 0x82 nanoslp syz-executor.0 48139 69518 31934 0 3 0x82 thrsleep syz-fuzzer 48139 301561 31934 0 3 0x4000082 nanoslp syz-fuzzer 48139 100157 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 161315 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 326893 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 361338 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 89450 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 388808 31934 0 3 0x4000082 thrsleep syz-fuzzer 48139 15443 31934 0 3 0x4000082 kqread syz-fuzzer 31934 351432 75063 0 3 0x10008a sigsusp ksh 75063 465392 74538 0 3 0x92 select sshd 63919 301062 1 0 3 0x100083 ttyin getty 74538 312560 1 0 3 0x80 select sshd 43375 11600 22163 74 3 0x100092 bpf pflogd 22163 72348 1 0 3 0x80 netio pflogd 14697 103914 24485 73 3 0x100090 kqread syslogd 24485 308145 1 0 3 0x100082 netio syslogd 49528 411801 1 77 3 0x100090 poll dhclient 39923 368910 1 0 3 0x80 poll dhclient 89993 491604 0 0 3 0x14200 bored smr 25534 381007 0 0 2 0x14200 zerothread 82850 24349 0 0 3 0x14200 aiodoned aiodoned 51304 212012 0 0 3 0x14200 syncer update 68392 380817 0 0 3 0x14200 cleaner cleaner 11093 509915 0 0 3 0x14200 reaper reaper 17578 5038 0 0 3 0x14200 pgdaemon pagedaemon 54226 230065 0 0 3 0x14200 bored crynlk 67066 131980 0 0 3 0x14200 bored crypto 48221 46950 0 0 3 0x14200 bored viomb 72535 469433 0 0 3 0x40014200 acpi0 acpi0 92901 282058 0 0 3 0x40014200 idle1 77114 450631 0 0 3 0x14200 bored softnet 46439 208023 0 0 3 0x14200 bored systqmp 55808 201306 0 0 3 0x14200 bored systq 89656 201856 0 0 3 0x40014200 bored softclock 94208 502788 0 0 3 0x40014200 idle0 1 467212 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 47160 (syz-executor.1) thread 0xffff80002126a540 (448132) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8282c6e0) #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 (0xfffffd8077827638) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10142 6496K 6747K 78643K 16049 0 pcb 13 8K 8K 78643K 3261 0 rtable 105 3K 3K 78643K 195 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 2054 0 iov 0 0K 4K 78643K 3034 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1221 77K 77K 78643K 6927 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 493 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 445 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 44972 0 sigio 0 0K 0K 78643K 1177 0 proc 60 63K 95K 78643K 438 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 55 254K 254K 78643K 55 0 exec 0 0K 2K 78643K 356 0 pfkey data 0 0K 0K 78643K 10 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 239 26K 26K 78643K 547016 0 UVM aobj 131 5K 5K 78643K 131 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 6 0K 0K 78643K 10 0 temp 73 3973K 4037K 78643K 99254 0 kqueue 3 4K 9K 78643K 528 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 328 0 326 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 18563 0 18551 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpcb 736 592 0 588 12 11 1 4 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 25991 0 25985 51 49 2 2 0 8 1 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 2931 0 2931 8 7 1 1 0 8 1 kcovpl 48 2 0 0 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 11 0 9 1 0 1 1 0 8 0 pfstkey 112 11 0 9 1 0 1 1 0 8 0 pfstate 320 11 0 9 1 0 1 1 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 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 semapl 112 443 0 433 1 0 1 1 0 8 0 shmpl 112 128 0 0 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 56229 0 54805 90 0 90 90 0 8 0 ffsino 272 56229 0 54805 96 0 96 96 0 8 0 nchpl 144 121637 0 120027 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 287046 0 287046 1 0 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 293802 0 293802 7 6 1 6 0 8 1 plimitpl 152 15 0 7 1 0 1 1 0 8 0 sigapl 424 45203 0 45168 4 0 4 4 0 8 0 futexpl 56 229818 0 229818 1 0 1 1 0 8 1 knotepl 112 555 0 535 1 0 1 1 0 8 0 kqueuepl 168 3319 0 3317 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 45171 0 45154 3 0 3 3 0 8 0 filepl 152 161727 0 161623 34 29 5 5 0 8 1 lockfpl 104 5497 0 5496 1 0 1 1 0 8 0 lockfspl 48 2079 0 2078 1 0 1 1 0 8 0 sessionpl 144 18 0 7 1 0 1 1 0 8 0 pgrppl 48 4430 0 4419 1 0 1 1 0 8 0 ucredpl 96 15605 0 15596 1 0 1 1 0 8 0 zombiepl 144 45168 0 45168 1 0 1 1 0 8 1 processpl 1080 45203 0 45168 3 0 3 3 0 8 0 procpl 672 104790 0 104745 65 60 5 5 0 8 1 sosppl 168 5 0 5 1 1 0 1 0 8 0 sockpl 480 47850 0 47830 76 72 4 5 0 8 1 mcl64k 65536 26 0 0 3 0 3 3 0 8 0 mcl16k 16384 35 0 0 4 2 2 3 0 8 0 mcl12k 12288 73 0 0 2 0 2 2 0 8 0 mcl9k 9216 33 0 0 2 0 2 2 0 8 0 mcl8k 8192 33 0 0 3 0 3 3 0 8 0 mcl4k 4096 34 0 0 4 1 3 3 0 8 0 mcl2k2 2112 10 0 0 1 0 1 1 0 8 0 mcl2k 2048 166 0 0 12 1 11 12 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 2081 0 0 17 3 14 15 0 8 0 bufpl 280 48876 0 42610 448 0 448 448 0 8 0 anonpl 24 11738089 0 11731201 93 48 45 45 0 186 1 amapchunkpl 152 1298173 0 1297783 77 60 17 17 0 158 1 amappl16 200 91194 0 91024 21 12 9 12 0 8 0 amappl15 192 62 0 55 1 0 1 1 0 8 0 amappl14 184 22270 0 22264 2 1 1 1 0 8 0 amappl13 176 22713 0 22709 1 0 1 1 0 8 0 amappl12 168 36 0 29 1 0 1 1 0 8 0 amappl11 160 55 0 44 1 0 1 1 0 8 0 amappl10 152 23 0 17 1 0 1 1 0 8 0 amappl9 144 299 0 298 1 0 1 1 0 8 0 amappl8 136 962 0 859 5 1 4 4 0 8 0 amappl7 128 57 0 46 1 0 1 1 0 8 0 amappl6 120 118 0 104 1 0 1 1 0 8 0 amappl5 112 23765 0 23753 1 0 1 1 0 8 0 amappl4 104 23095 0 23069 1 0 1 1 0 8 0 amappl3 96 25440 0 25434 1 0 1 1 0 8 0 amappl2 88 24920 0 24872 3 1 2 2 0 8 0 amappl1 80 753302 0 752873 13 3 10 12 0 8 0 amappl 88 545997 0 545873 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 130 0 0 3 0 3 3 0 8 0 uaddrrnd 24 45171 0 45154 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 45171 0 45154 1 0 1 1 0 8 0 vmmpekpl 168 214322 0 214292 2 0 2 2 0 8 0 vmmpepl 168 4975409 0 4973850 122 53 69 70 0 357 0 vmsppl 368 45170 0 45154 2 0 2 2 0 8 0 rwobjpl 56 872774 0 871858 40 26 14 14 0 8 0 pdppl 4096 90349 0 90308 58 17 41 45 0 8 0 pvpl 32 19749942 0 19739579 380 293 87 128 0 265 1 pmappl 232 45170 0 45154 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 324 0 38 10 1 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(ffffffff82726ff0) 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(ffffffff8282c4d8) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8282c4d8) 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 end of kernel end trace frame: 0x7f7ffffbb230, count: -6 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(fffffd806908b5f8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806908b5e8,1) at rw_enter+0xd4 rrw_enter(fffffd806908b5e8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806ed9e8c8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806ed9e8c8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806ed9e8c8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff80002126a540,fffffd806ed9e8c8,fffffd807f7d89c0,ffff8000232e9100,ffff8000232e90e0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff80002126a540,ffffffff823bae47,ffff8000232e91e8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff80002126a540,ffffffff823bae47,ffff8000232e91e8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff80002126a540,ffff8000232e9258,ffff8000232e92a0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000232e9320) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232e9320) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x872bc608850, count: -12