panic: rw_enter: netlock locking against myself Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 31525 28500 0 0 0x4000000 1 syz-executor.1 *410218 28500 0 0 0x4000000 0K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822277f7) at panic+0x15c sys/kern/subr_prf.c:207 rw_enter(ffffffff825310b8,1) at rw_enter+0x518 sys/kern/kern_rwlock.c:173 solock(fffffd80644e57e8) at solock+0x5a sys/kern/uipc_socket2.c:282 soclose(fffffd80644e57e8,0) at soclose+0x2f sys/kern/uipc_socket.c:290 soo_close(fffffd806785fe58,ffff800020ec64f8) at soo_close+0x40 fdrop(fffffd806785fe58,ffff800020ec64f8) at fdrop+0xc2 sys/kern/kern_descrip.c:1276 sosplice(fffffd80644e54c8,3,0,0) at sosplice+0x475 sosetopt(fffffd80644e54c8,ffff,1023,fffffd806437f100) at sosetopt+0x830 sys_setsockopt(ffff800020ec64f8,ffff800021f9d848,ffff800021f9d890) at sys_setsockopt+0x215 sys/kern/uipc_syscalls.c:965 syscall(ffff800021f9d910) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021f9d910) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa257d7e3ab0, count: 3 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 rw_enter: netlock locking against myself ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822277f7) at panic+0x15c sys/kern/subr_prf.c:207 rw_enter(ffffffff825310b8,1) at rw_enter+0x518 sys/kern/kern_rwlock.c:173 solock(fffffd80644e57e8) at solock+0x5a sys/kern/uipc_socket2.c:282 soclose(fffffd80644e57e8,0) at soclose+0x2f sys/kern/uipc_socket.c:290 soo_close(fffffd806785fe58,ffff800020ec64f8) at soo_close+0x40 fdrop(fffffd806785fe58,ffff800020ec64f8) at fdrop+0xc2 sys/kern/kern_descrip.c:1276 sosplice(fffffd80644e54c8,3,0,0) at sosplice+0x475 sosetopt(fffffd80644e54c8,ffff,1023,fffffd806437f100) at sosetopt+0x830 sys_setsockopt(ffff800020ec64f8,ffff800021f9d848,ffff800021f9d890) at sys_setsockopt+0x215 sys/kern/uipc_syscalls.c:965 syscall(ffff800021f9d910) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021f9d910) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa257d7e3ab0, count: -12 ddb{0}> show registers rdi 0xffffffff819f29d7 db_enter+0x17 rsi 0x16f5 __ALIGN_SIZE+0x6f5 rbp 0xffff800021f9d450 rbx 0xffff800021f9d500 rdx 0x16f6 __ALIGN_SIZE+0x6f6 rcx 0xffff800023390000 rax 0xffff800023390000 r8 0xffffffff8178384f kprintf+0x16f r9 0x1 r10 0x25 r11 0x88b9b8338f52e6a7 r12 0x3000000008 r13 0xffff800021f9d460 r14 0x100 r15 0x1 rip 0xffffffff819f29d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021f9d440 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=410218 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ec6eb8,0xffffffff8263d2f0 process=0xffff800020e923f8 user=0xffff800021f98000, vmspace=0xfffffd8063f785d0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 17620 485335 62296 0 2 0 syz-executor.0 28500 474963 13669 0 2 0 syz-executor.1 28500 31525 13669 0 7 0x4000000 syz-executor.1 *28500 410218 13669 0 7 0x4000000 syz-executor.1 79958 193459 0 0 3 0x14200 bored sosplice 13669 361929 94771 0 3 0x82 nanosleep syz-executor.1 62296 522591 94771 0 3 0x82 nanosleep syz-executor.0 94771 333313 462 0 3 0x82 kqread syz-fuzzer 94771 453800 462 0 3 0x4000082 nanosleep syz-fuzzer 94771 162045 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 254329 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 65358 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 249493 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 477705 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 447955 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 451828 462 0 3 0x4000082 thrsleep syz-fuzzer 94771 119539 462 0 3 0x4000082 nanosleep syz-fuzzer 462 120374 42392 0 3 0x10008a pause ksh 42392 284564 22632 0 3 0x92 select sshd 45463 234041 1 0 3 0x100083 ttyin getty 22632 405753 1 0 3 0x80 select sshd 91166 509575 50108 74 3 0x100092 bpf pflogd 50108 209592 1 0 3 0x80 netio pflogd 91954 420101 28858 73 3 0x100090 kqread syslogd 28858 194537 1 0 3 0x100082 netio syslogd 2934 231216 1 77 3 0x100090 poll dhclient 78525 318863 1 0 3 0x80 poll dhclient 8743 357301 0 0 3 0x14200 bored smr 45190 155953 0 0 2 0x14200 zerothread 84322 324201 0 0 3 0x14200 aiodoned aiodoned 54602 269062 0 0 3 0x14200 syncer update 34433 443057 0 0 3 0x14200 cleaner cleaner 7702 252500 0 0 3 0x14200 reaper reaper 22574 460128 0 0 3 0x14200 pgdaemon pagedaemon 29708 249809 0 0 3 0x14200 bored crynlk 42589 372274 0 0 3 0x14200 bored crypto 86250 448272 0 0 3 0x40014200 acpi0 acpi0 5085 476041 0 0 3 0x40014200 idle1 53768 174524 0 0 3 0x14200 bored softnet 26015 185336 0 0 3 0x14200 bored systqmp 48689 184752 0 0 3 0x14200 bored systq 74568 243029 0 0 3 0x40014200 bored softclock 99135 15383 0 0 3 0x40014200 idle0 1 165060 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 28500 (syz-executor.1) thread 0xffff800020ec64f8 (410218) exclusive rwlock netlock r = 0 (0xffffffff825310c8) #0 witness_lock+0x4c5 sys/kern/subr_witness.c:1164 #1 solock+0x5a sys/kern/uipc_socket2.c:282 #2 sys_setsockopt+0x1fa sys/kern/uipc_syscalls.c:964 #3 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #4 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff826739f0) #0 witness_lock+0x4c5 sys/kern/subr_witness.c:1164 #1 syscall+0x400 mi_syscall sys/sys/syscall_mi.h:93 [inline] #1 syscall+0x400 sys/arch/amd64/amd64/trap.c:570 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9519 6542K 6800K 78643K 11129 0 pcb 13 8K 8K 78643K 104 0 rtable 115 12K 12K 78643K 305 0 ifaddr 73 15K 15K 78643K 109 0 counters 43 33K 34K 78643K 59 0 ioctlops 0 0K 4K 78643K 1492 0 iov 0 0K 28K 78643K 53 0 mount 1 1K 1K 78643K 1 0 vnodes 1221 77K 77K 78643K 1372 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 11 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 44 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 6 17K 25K 78643K 320 0 sigio 0 0K 0K 78643K 6 0 proc 61 63K 95K 78643K 488 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 67 0 in_multi 59 3K 3K 78643K 106 0 ether_multi 1 0K 0K 78643K 20 0 mrt 0 0K 0K 78643K 13 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 1K 78643K 224 0 pfkey data 0 0K 1K 78643K 2 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 116 86K 103K 78643K 2007 0 UVM aobj 16 4K 4K 78643K 26 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 75 0 NDP 11 0K 0K 78643K 23 0 temp 107 3045K 3109K 78643K 4847 0 kqueue 3 4K 8K 78643K 20 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 arp 64 7 0 1 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 33 0 31 1 0 1 1 0 8 0 rtentry 112 54 0 8 2 0 2 2 0 8 0 unpcb 120 157 0 147 1 0 1 1 0 8 0 syncache 264 7 0 7 2 2 0 1 0 8 0 tcpqe 32 382 0 382 1 1 0 1 0 8 0 tcpcb 544 200 0 195 1 0 1 1 0 8 0 inpcb 280 1203 0 1191 2 0 2 2 0 8 1 rttmr 72 4 0 4 1 1 0 1 0 8 0 nd6 48 8 0 0 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 ppxss 1128 1 0 1 1 0 1 1 0 8 1 pffrag 232 1 0 1 1 0 1 1 0 482 1 pffrnode 88 1 0 1 1 0 1 1 0 8 1 pffrent 40 45 0 45 1 0 1 1 0 8 1 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 39 0 6 1 0 1 1 0 8 0 pfstkey 112 39 0 6 1 0 1 1 0 8 0 pfstate 328 39 0 6 3 0 3 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 212 0 2 14 0 14 14 0 8 0 art_table 32 213 0 2 2 0 2 2 0 8 0 art_node 16 53 0 11 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 4 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 42 0 32 1 0 1 1 0 8 0 shmpl 112 24 0 10 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1833 0 426 46 0 46 46 0 8 0 ffsino 272 1833 0 426 94 0 94 94 0 8 0 nchpl 144 2493 0 874 61 0 61 61 0 8 0 uvmvnodes 72 1991 0 0 37 0 37 37 0 8 0 vnodes 208 1991 0 0 105 0 105 105 0 8 0 namei 1024 6819 0 6819 1 0 1 1 0 8 1 percpumem 16 40 0 8 1 0 1 1 0 8 0 vcpupl 1984 8 0 0 1 0 1 1 0 8 0 vmpool 560 12 0 4 1 0 1 1 0 8 0 scxspl 192 7862 0 7862 8 7 1 7 0 8 1 plimitpl 152 53 0 45 1 0 1 1 0 8 0 sigapl 424 536 0 503 4 0 4 4 0 8 0 futexpl 56 5775 0 5775 1 0 1 1 0 8 1 knotepl 112 75 0 56 1 0 1 1 0 8 0 kqueuepl 144 51 0 49 1 0 1 1 0 8 0 pipelkpl 48 120 0 110 1 0 1 1 0 8 0 pipepl 120 240 0 221 1 0 1 1 0 8 0 fdescpl 496 520 0 503 3 0 3 3 0 8 0 filepl 152 3605 0 3501 5 0 5 5 0 8 1 lockfpl 104 108 0 107 1 0 1 1 0 8 0 lockfspl 48 42 0 41 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 268 0 259 1 0 1 1 0 8 0 zombiepl 144 503 0 503 1 0 1 1 0 8 1 processpl 984 536 0 503 5 0 5 5 0 8 0 procpl 624 1222 0 1178 4 0 4 4 0 8 0 sosppl 128 202 0 200 1 0 1 1 0 8 0 sockpl 400 1404 0 1381 4 0 4 4 0 8 1 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 211 0 0 26 0 26 26 0 8 0 mtagpl 80 35 0 0 1 0 1 1 0 8 0 mbufpl 256 331 0 0 19 0 19 19 0 8 0 bufpl 280 4887 0 174 337 0 337 337 0 8 0 anonpl 16 67598 0 53141 79 4 75 75 0 124 14 amapchunkpl 152 3489 0 3352 19 10 9 19 0 158 3 amappl16 192 2698 0 1878 58 8 50 54 0 8 8 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 2 0 2 2 2 0 1 0 8 0 amappl13 168 26 0 25 1 0 1 1 0 8 0 amappl12 160 150 0 146 2 1 1 1 0 8 0 amappl11 152 221 0 200 2 1 1 2 0 8 0 amappl10 144 15 0 10 1 0 1 1 0 8 0 amappl9 136 391 0 387 1 0 1 1 0 8 0 amappl8 128 297 0 283 1 0 1 1 0 8 0 amappl7 120 118 0 108 1 0 1 1 0 8 0 amappl6 112 172 0 168 1 0 1 1 0 8 0 amappl5 104 420 0 402 1 0 1 1 0 8 0 amappl4 96 506 0 472 2 1 1 2 0 8 0 amappl3 88 116 0 110 1 0 1 1 0 8 0 amappl2 80 3402 0 3325 3 1 2 3 0 8 0 amappl1 72 21249 0 20789 25 15 10 20 0 8 0 amappl 80 1482 0 1432 2 0 2 2 0 84 0 dma4096 4096 1 0 1 1 1 0 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 25 0 10 1 0 1 1 0 8 0 uaddrrnd 24 532 0 507 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 532 0 507 1 0 1 1 0 8 0 vmmpekpl 168 7676 0 7642 2 0 2 2 0 8 0 vmmpepl 168 70564 0 68505 111 9 102 102 0 357 11 vmsppl 368 531 0 507 3 0 3 3 0 8 0 pdppl 4096 1072 0 1022 8 1 7 7 0 8 0 pvpl 32 209625 0 192488 180 4 176 178 0 265 34 pmappl 232 531 0 507 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 186 0 4 6 0 6 6 0 8 0