panic: rw_enter: solock locking against myself Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *448201 66603 32767 0x10 0x4000000 0K syz-executor.2 187010 25089 32767 0x10 0 1 syz-executor.4 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825e7bc8) at panic+0x177 sys/kern/subr_prf.c:202 rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 rw_enter_diag sys/kern/kern_rwlock.c:183 [inline] rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 sys/kern/kern_rwlock.c:274 soisconnected(fffffd806963cd70) at soisconnected+0x23f solock sys/kern/uipc_socket2.c:352 [inline] soisconnected(fffffd806963cd70) at soisconnected+0x23f sys/kern/uipc_socket2.c:112 unp_connect2(fffffd806963c9a0,fffffd806963cd70) at unp_connect2+0xc6 unp_connect(fffffd806963c9a0,fffffd807ae9f100,ffff800022d89a48) at unp_connect+0x46d sys/kern/uipc_usrreq.c:836 uipc_usrreq(fffffd806963c9a0,4,0,fffffd807ae9f100,0,ffff800022d89a48) at uipc_usrreq+0x49e sys_connect(ffff800022d89a48,ffff800022d86888,ffff800022d868d0) at sys_connect+0x203 sys/kern/uipc_syscalls.c:422 syscall(ffff800022d86950) at syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff800022d86950) at syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9f23793d3f0, count: 5 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: rw_enter: solock locking against myself ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825e7bc8) at panic+0x177 sys/kern/subr_prf.c:202 rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 rw_enter_diag sys/kern/kern_rwlock.c:183 [inline] rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 sys/kern/kern_rwlock.c:274 soisconnected(fffffd806963cd70) at soisconnected+0x23f solock sys/kern/uipc_socket2.c:352 [inline] soisconnected(fffffd806963cd70) at soisconnected+0x23f sys/kern/uipc_socket2.c:112 unp_connect2(fffffd806963c9a0,fffffd806963cd70) at unp_connect2+0xc6 unp_connect(fffffd806963c9a0,fffffd807ae9f100,ffff800022d89a48) at unp_connect+0x46d sys/kern/uipc_usrreq.c:836 uipc_usrreq(fffffd806963c9a0,4,0,fffffd807ae9f100,0,ffff800022d89a48) at uipc_usrreq+0x49e sys_connect(ffff800022d89a48,ffff800022d86888,ffff800022d868d0) at sys_connect+0x203 sys/kern/uipc_syscalls.c:422 syscall(ffff800022d86950) at syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff800022d86950) at syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9f23793d3f0, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800022d86410 rbx 0xffffffff82965b97 cpu_info_full_primary+0x2b97 rdx 0 rcx 0 rax 0xffff800022d89a48 r8 0x101010101010101 r9 0x8080808080808080 r10 0x4edccd35dafa14e5 r11 0x2fabd01de5481a13 r12 0xffffffff82965998 cpu_info_full_primary+0x2998 r13 0 r14 0 r15 0x1 rip 0xffffffff82414888 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022d86400 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.2) pid=448201 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff800022d897a8,0xffff800022d89518 process=0xffff800027bd4440 user=0xffff800022d81000, vmspace=0xfffffd807ce888b8 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 66603 108329 7326 32767 2 0x10 syz-executor.2 66603 76691 7326 32767 3 0x4000090 fsleep syz-executor.2 *66603 448201 7326 32767 7 0x4000010 syz-executor.2 66603 432460 7326 32767 3 0x4000090 fsleep syz-executor.2 25089 187010 64801 32767 7 0x10 syz-executor.4 25089 71757 64801 32767 3 0x4000090 fsleep syz-executor.4 25089 230001 64801 32767 3 0x4000090 fsleep syz-executor.4 25089 127145 64801 32767 2 0x4000010 syz-executor.4 43552 138560 46670 32767 3 0x90 nanoslp syz-executor.5 43552 269170 46670 32767 3 0x4000090 ttyout syz-executor.5 43552 363570 46670 32767 3 0x4000090 ttyretype syz-executor.5 43552 338563 46670 32767 3 0x4000090 fsleep syz-executor.5 57289 266516 68845 32767 3 0x90 piperd syz-executor.3 68845 345281 72691 0 3 0x82 wait syz-executor.3 18742 491460 73151 32767 3 0x90 piperd syz-executor.6 73151 364218 72691 0 3 0x82 wait syz-executor.6 49375 181276 68753 32767 3 0x90 piperd syz-executor.7 68753 79482 72691 0 3 0x82 wait syz-executor.7 89493 259052 0 0 3 0x14200 bored sosplice 46670 118330 13727 32767 3 0x90 nanoslp syz-executor.5 13727 196451 72691 0 3 0x82 wait syz-executor.5 64801 322976 60860 32767 2 0x10 syz-executor.4 7326 286284 81742 32767 3 0x90 nanoslp syz-executor.2 64710 347745 33267 32767 3 0x90 piperd syz-executor.0 60860 255914 72691 0 3 0x82 wait syz-executor.4 81742 403530 72691 0 3 0x82 wait syz-executor.2 33267 175545 72691 0 3 0x82 wait syz-executor.0 72691 325907 29826 0 3 0x82 wait syz-fuzzer 72691 38449 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 503821 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 221781 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 193287 29826 0 3 0x4000082 kqread syz-fuzzer 72691 85147 29826 0 3 0x4000082 wait syz-fuzzer 72691 516048 29826 0 3 0x4000082 wait syz-fuzzer 72691 475435 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 411069 29826 0 3 0x4000082 wait syz-fuzzer 72691 505600 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 315624 29826 0 3 0x4000082 wait syz-fuzzer 72691 130378 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 379817 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 178750 29826 0 3 0x4000082 wait syz-fuzzer 72691 70134 29826 0 3 0x4000082 thrsleep syz-fuzzer 72691 96672 29826 0 3 0x4000082 wait syz-fuzzer 29826 252783 12732 0 3 0x10008a sigsusp ksh 12732 356305 50683 0 3 0x9a kqread sshd 39956 299423 1 0 3 0x100083 ttyin getty 50683 293839 1 0 3 0x88 kqread sshd 37795 130884 84515 73 3 0x1100090 kqread syslogd 84515 200746 1 0 3 0x100082 netio syslogd 26455 518773 1 0 3 0x100080 kqread resolvd 62560 301256 22198 77 3 0x100092 kqread dhcpleased 20336 413008 22198 77 3 0x100092 kqread dhcpleased 22198 64636 1 0 3 0x80 kqread dhcpleased 2555 79282 0 0 3 0x14200 bored smr 68908 129458 0 0 2 0x14200 zerothread 35141 164306 0 0 3 0x14200 aiodoned aiodoned 71853 452072 0 0 3 0x14200 syncer update 31605 66340 0 0 3 0x14200 cleaner cleaner 19411 137965 0 0 3 0x14200 reaper reaper 70368 56724 0 0 3 0x14200 pgdaemon pagedaemon 1624 261925 0 0 3 0x14200 bored viomb 49864 479385 0 0 3 0x40014200 acpi0 acpi0 4343 78429 0 0 3 0x40014200 idle1 76651 92546 0 0 3 0x14200 bored softnet 52593 244523 0 0 3 0x14200 bored softnet 94412 125381 0 0 3 0x14200 bored softnet 46821 200963 0 0 3 0x14200 bored softnet 40792 104756 0 0 3 0x14200 bored systqmp 6471 447082 0 0 3 0x14200 bored systq 51748 129270 0 0 3 0x40014200 bored softclock 33823 260936 0 0 3 0x40014200 idle0 1 384596 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 66603 (syz-executor.2) thread 0xffff800022d89a48 (448201) exclusive rwlock solock r = 0 (0xfffffd806963c9b8) #0 witness_lock+0x44d #1 solock_pair+0x9b solock sys/kern/uipc_socket2.c:352 [inline] #1 solock_pair+0x9b sys/kern/uipc_socket2.c:384 #2 unp_connect+0x390 sys/kern/uipc_usrreq.c:808 #3 uipc_usrreq+0x49e #4 sys_connect+0x203 sys/kern/uipc_syscalls.c:422 #5 syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] #5 syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 #6 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80697c46f8) #0 witness_lock+0x44d #1 rw_enter+0x3e1 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:465 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:518 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:567 #5 vget+0x1d3 sys/kern/vfs_subr.c:678 #6 ufs_ihashget+0x121 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x7c sys/ufs/ffs/ffs_vfsops.c:1318 #8 ufs_lookup+0x122c sys/ufs/ufs/ufs_lookup.c:582 #9 VOP_LOOKUP+0x58 sys/kern/vfs_vops.c:85 #10 vfs_lookup+0x6e5 sys/kern/vfs_lookup.c:561 #11 namei+0x36a sys/kern/vfs_lookup.c:245 #12 unp_connect+0x1c3 sys/kern/uipc_usrreq.c:769 #13 uipc_usrreq+0x49e #14 sys_connect+0x203 sys/kern/uipc_syscalls.c:422 #15 syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] #15 syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 #16 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82a2b0a8) #0 witness_lock+0x44d #1 unp_connect+0x1bb sys/kern/uipc_usrreq.c:769 #2 uipc_usrreq+0x49e #3 sys_connect+0x203 sys/kern/uipc_syscalls.c:422 #4 syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] #4 syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 #5 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10189 6407K 6419K 78643K 11298 0 pcb 13 8K 8K 78643K 13 0 rtable 212 6K 6K 78643K 527 0 ifaddr 75 16K 17K 78643K 121 0 sysctl 1 1K 1K 78643K 1 0 counters 54 35K 35K 78643K 66 0 ioctlops 0 0K 2K 78643K 41 0 iov 0 0K 16K 78643K 290 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1270 79K 79K 78643K 1671 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 26 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 360 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 19 69K 121K 78643K 1797 0 sigio 0 0K 0K 78643K 58 0 proc 56 78K 127K 78643K 704 0 subproc 91 5K 6K 78643K 169 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 435 0 in_multi 88 5K 6K 78643K 175 0 ether_multi 1 0K 0K 78643K 9 0 mrt 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 133 599K 599K 78643K 133 0 exec 0 0K 2K 78643K 871 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 8 62K 62K 78643K 8 0 UVM amap 266 76K 96K 78643K 12414 0 UVM aobj 31 2K 2K 78643K 31 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 29 0 NDP 10 0K 2K 78643K 42 0 temp 116 4725K 4790K 78643K 7713 0 kqueue 12 18K 24K 78643K 163 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 22 0 0 1 0 1 1 0 8 0 rtpcb 120 278 0 275 5 4 1 4 0 8 0 rtentry 112 169 0 70 4 0 4 4 0 8 0 unpcb 144 3965 0 3948 17 11 6 9 0 8 5 syncache 296 20 0 20 3 2 1 1 0 8 1 tcpqe 32 10 0 10 2 1 1 1 0 8 1 tcpcb 736 420 0 408 14 8 6 8 0 8 4 arp 120 28 0 12 1 0 1 1 0 8 0 ipq 40 1 0 1 1 1 0 1 0 8 0 ipqe 40 36 0 36 1 1 0 1 0 8 0 inpcb 320 1340 0 1326 13 8 5 7 0 8 3 nd6 48 42 0 21 1 0 1 1 0 8 0 kcovpl 48 13 0 6 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 687 0 276 29 0 29 29 0 8 1 art_table 32 688 0 276 4 0 4 4 0 8 0 art_node 16 168 0 78 1 0 1 1 0 8 0 sysvmsgpl 40 3 0 3 1 1 0 1 0 8 0 semapl 112 355 0 345 1 0 1 1 0 8 0 shmpl 112 28 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3665 0 2229 91 0 91 91 0 8 0 ffsino 272 3665 0 2229 97 0 97 97 0 8 0 nchpl 144 6108 0 4482 63 0 63 63 0 8 0 uvmvnodes 80 3843 0 0 79 0 79 79 0 8 0 vnodes 216 3843 0 0 214 0 214 214 0 8 0 namei 1024 21287 0 21287 2 1 1 2 0 8 1 percpumem 16 45 0 6 1 0 1 1 0 8 0 kstatmem 264 32 0 12 2 0 2 2 0 8 0 scxspl 216 19072 0 19072 13 11 2 8 0 8 2 plimitpl 152 671 0 650 1 0 1 1 0 8 0 sigapl 424 2064 0 2016 7 0 7 7 0 8 0 futexpl 64 14453 0 14448 1 0 1 1 0 8 0 knotepl 120 486 0 0 14 0 14 14 0 8 0 kqueuepl 216 348 0 340 5 0 5 5 0 8 4 pipepl 320 499 0 474 11 7 4 8 0 8 1 fdescpl 496 2046 0 2016 7 2 5 6 0 8 0 filepl 152 14228 0 14007 29 11 18 19 0 8 8 lockfpl 104 559 0 557 1 0 1 1 0 8 0 lockfspl 48 89 0 87 1 0 1 1 0 8 0 sessionpl 144 28 0 13 1 0 1 1 0 8 0 pgrppl 48 376 0 361 1 0 1 1 0 8 0 ucredpl 104 2569 0 2552 1 0 1 1 0 8 0 zombiepl 144 2016 0 2016 1 0 1 1 0 8 1 processpl 1064 2064 0 2016 5 1 4 5 0 8 0 procpl 672 5408 0 5336 8 0 8 8 0 8 1 sosppl 168 29 0 29 3 2 1 1 0 8 1 sockpl 488 5659 0 5625 105 92 13 30 0 8 8 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl16k 16384 13 0 0 2 0 2 2 0 8 0 mcl12k 12288 13 0 0 2 0 2 2 0 8 0 mcl9k 9216 10 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 361 0 0 46 0 46 46 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 400 0 0 25 0 25 25 0 8 0 bufpl 288 6039 0 128 423 0 423 423 0 8 0 anonpl 24 383954 0 373453 115 25 90 101 0 186 8 amapchunkpl 152 35160 0 34551 45 17 28 39 0 158 2 amappl16 200 4927 0 4540 41 18 23 33 0 8 0 amappl15 192 309 0 301 1 0 1 1 0 8 0 amappl14 184 47 0 41 1 0 1 1 0 8 0 amappl13 176 328 0 324 1 0 1 1 0 8 0 amappl12 168 134 0 131 1 0 1 1 0 8 0 amappl11 160 445 0 429 1 0 1 1 0 8 0 amappl10 152 230 0 225 1 0 1 1 0 8 0 amappl9 144 671 0 668 1 0 1 1 0 8 0 amappl8 136 1004 0 929 3 0 3 3 0 8 0 amappl7 128 478 0 454 1 0 1 1 0 8 0 amappl6 120 398 0 384 2 1 1 2 0 8 0 amappl5 112 1591 0 1571 1 0 1 1 0 8 0 amappl4 104 1310 0 1285 2 1 1 2 0 8 0 amappl3 96 5999 0 5941 2 0 2 2 0 8 0 amappl2 88 845 0 808 2 1 1 2 0 8 0 amappl1 80 52196 0 51534 21 4 17 19 0 8 0 amappl 88 11809 0 11643 6 1 5 5 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 72 30 0 0 1 0 1 1 0 8 0 uaddrrnd 24 2047 0 2017 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2047 0 2017 1 0 1 1 0 8 0 vmmpekpl 168 20749 0 20668 4 0 4 4 0 8 0 vmmpepl 168 203131 0 200716 141 11 130 138 0 357 8 vmsppl 368 2046 0 2017 4 0 4 4 0 8 0 rwobjpl 56 54751 0 49528 76 1 75 75 0 8 0 pdppl 4096 4101 0 4034 149 70 79 93 0 8 12 pvpl 32 834261 0 819195 258 67 191 256 0 265 43 pmappl 248 2046 0 2017 4 1 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 896 0 81 24 0 24 24 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:437 panic(ffffffff825e7bc8) at panic+0x177 sys/kern/subr_prf.c:202 rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 rw_enter_diag sys/kern/kern_rwlock.c:183 [inline] rw_enter(fffffd806963c9a8,1) at rw_enter+0x482 sys/kern/kern_rwlock.c:274 soisconnected(fffffd806963cd70) at soisconnected+0x23f solock sys/kern/uipc_socket2.c:352 [inline] soisconnected(fffffd806963cd70) at soisconnected+0x23f sys/kern/uipc_socket2.c:112 unp_connect2(fffffd806963c9a0,fffffd806963cd70) at unp_connect2+0xc6 unp_connect(fffffd806963c9a0,fffffd807ae9f100,ffff800022d89a48) at unp_connect+0x46d sys/kern/uipc_usrreq.c:836 uipc_usrreq(fffffd806963c9a0,4,0,fffffd807ae9f100,0,ffff800022d89a48) at uipc_usrreq+0x49e sys_connect(ffff800022d89a48,ffff800022d86888,ffff800022d868d0) at sys_connect+0x203 sys/kern/uipc_syscalls.c:422 syscall(ffff800022d86950) at syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff800022d86950) at syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9f23793d3f0, count: -10 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 end of kernel end trace frame: 0x7f7fffffa190, count: 12 ddb{1}> trace x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 end of kernel end trace frame: 0x7f7fffffa190, count: -3