panic: rw_enter: pf_state_lock locking against myself Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *114161 27965 0 0 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823e4940) at panic+0x15e sys/kern/subr_prf.c:218 rw_enter(ffffffff826fc3e0,1) at rw_enter+0x36f sys/kern/kern_rwlock.c:174 pf_state_insert(ffff800000af7700,ffff800021703358,ffff800021703360,fffffd806cdcddc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b37800,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b37800,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80790eebe0,c1084425,ffff800000b37800,3,fffffd807f7b7b40,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80783f7258,c1084425,ffff800000b37800,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800021703808,ffff800021703850) at sys_ioctl+0x4ac syscall(ffff8000217038d0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xff334d58b20, count: 4 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic rw_enter: pf_state_lock locking against myself ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823e4940) at panic+0x15e sys/kern/subr_prf.c:218 rw_enter(ffffffff826fc3e0,1) at rw_enter+0x36f sys/kern/kern_rwlock.c:174 pf_state_insert(ffff800000af7700,ffff800021703358,ffff800021703360,fffffd806cdcddc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b37800,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b37800,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80790eebe0,c1084425,ffff800000b37800,3,fffffd807f7b7b40,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80783f7258,c1084425,ffff800000b37800,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800021703808,ffff800021703850) at sys_ioctl+0x4ac syscall(ffff8000217038d0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xff334d58b20, count: -11 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff800021703180 rbx 0xffff800021703190 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81034bd5 kprintf+0x155 r9 0x1 r10 0xb9ebebe8347d65bf r11 0x9eb3ded00f00c74d r12 0x3000000008 r13 0xffff800021703230 r14 0x100 r15 0x1 rip 0xffffffff81116418 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021703170 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=114161 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800021670540,0xffffffff827feb10 process=0xffff80002165e3e8 user=0xffff8000216fe000, vmspace=0xfffffd807ad12ab0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 27965 483282 83950 0 2 0 syz-executor.1 *27965 114161 83950 0 7 0x4000000 syz-executor.1 19894 361502 22658 0 3 0x82 nanoslp syz-executor.0 83950 286321 22658 0 3 0x82 nanoslp syz-executor.1 42780 7186 0 0 3 0x14200 bored sosplice 22658 247355 53214 0 3 0x82 thrsleep syz-fuzzer 22658 88066 53214 0 3 0x4000082 nanoslp syz-fuzzer 22658 140731 53214 0 3 0x4000082 kqread syz-fuzzer 22658 139594 53214 0 3 0x4000082 thrsleep syz-fuzzer 22658 78523 53214 0 3 0x4000082 thrsleep syz-fuzzer 22658 511857 53214 0 3 0x4000082 thrsleep syz-fuzzer 22658 37445 53214 0 3 0x4000082 thrsleep syz-fuzzer 53214 66440 59272 0 3 0x10008a sigsusp ksh 59272 194586 44112 0 3 0x92 select sshd 19416 152020 1 0 3 0x100083 ttyin getty 44112 427877 1 0 3 0x80 select sshd 15009 330196 80487 73 3 0x100090 kqread syslogd 80487 149405 1 0 3 0x100082 netio syslogd 72737 160479 1 77 3 0x100090 poll dhclient 74726 21600 1 0 3 0x80 poll dhclient 83620 407272 0 0 3 0x14200 bored smr 55594 110914 0 0 2 0x14200 zerothread 43560 168135 0 0 3 0x14200 aiodoned aiodoned 36597 159279 0 0 3 0x14200 syncer update 91925 492588 0 0 3 0x14200 cleaner cleaner 7314 299320 0 0 3 0x14200 reaper reaper 90189 102027 0 0 3 0x14200 pgdaemon pagedaemon 77606 319615 0 0 3 0x14200 bored crynlk 69996 383895 0 0 3 0x14200 bored crypto 78668 374354 0 0 3 0x14200 bored viomb 69025 233476 0 0 3 0x40014200 acpi0 acpi0 63190 61151 0 0 3 0x14200 bored softnet 2587 328468 0 0 3 0x14200 bored systqmp 72903 162724 0 0 3 0x14200 bored systq 30880 408354 0 0 3 0x40014200 bored softclock 91390 280292 0 0 3 0x40014200 idle0 1 229886 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9547 6687K 6991K 78643K 14170 0 pcb 13 8K 8K 78643K 178 0 rtable 104 14K 15K 78643K 554 0 ifaddr 74 14K 14K 78643K 166 0 counters 21 16K 16K 78643K 33 0 ioctlops 1 0K 4K 78643K 118 0 iov 0 0K 16K 78643K 60 0 mount 1 1K 1K 78643K 1 0 vnodes 1229 77K 77K 78643K 2252 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 16 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 255 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 3443 0 sigio 0 0K 0K 78643K 27 0 proc 50 38K 63K 78643K 579 0 subproc 32 2K 2K 78643K 85 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 210 0 in_multi 22 1K 2K 78643K 206 0 ether_multi 1 0K 0K 78643K 53 0 mrt 0 0K 0K 78643K 4 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 447 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 137 42K 42K 78643K 7935 0 UVM aobj 48 2K 2K 78643K 48 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 147 0 NDP 13 0K 0K 78643K 35 0 temp 137 3976K 4040K 78643K 17848 0 kqueue 3 4K 20K 78643K 92 0 SYN cache 2 16K 16K 78643K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 12 0 8 1 0 1 1 0 8 0 rtpcb 120 100 0 98 1 0 1 1 0 8 0 rtentry 112 83 0 50 2 1 1 2 0 8 0 unpcb 120 598 0 590 1 0 1 1 0 8 0 syncache 296 14 0 14 5 4 1 1 0 8 1 tcpqe 32 849 0 849 5 4 1 1 0 8 1 tcpcb 736 530 0 525 11 8 3 4 0 8 1 ipq 40 10 0 10 2 2 0 1 0 8 0 ipqe 40 455 0 455 2 2 0 1 0 8 0 inpcb 304 1146 0 1137 10 8 2 2 0 8 1 nd6 48 15 0 12 1 0 1 1 0 8 0 pkpcb 40 22 0 22 3 3 0 1 0 8 0 kcovpl 48 5 0 3 1 0 1 1 0 8 0 pfstscr 40 1 0 0 1 0 1 1 0 8 0 pfosfp 40 5 0 1 1 0 1 1 0 8 0 pfosfpen 112 5 0 0 1 0 1 1 0 8 0 pfrktable 1344 32 0 27 1 0 1 1 0 8 0 pftag 88 8 0 5 1 0 1 1 0 8 0 pfqueue 264 16 0 9 1 0 1 1 0 8 0 pfstkey 112 2 0 0 1 0 1 1 0 8 0 pfstate 320 1 0 0 1 0 1 1 0 8 0 pfrule 1360 9 0 5 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 330 0 183 12 2 10 12 0 8 0 art_table 32 331 0 183 2 0 2 2 0 8 0 art_node 16 77 0 47 1 0 1 1 0 8 0 sysvmsgpl 40 60 0 55 1 0 1 1 0 8 0 semupl 112 10 0 10 1 1 0 1 0 8 0 semapl 112 233 0 223 1 0 1 1 0 8 0 shmpl 112 45 0 0 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5404 0 4006 88 0 88 88 0 8 0 ffsino 240 5404 0 4006 83 0 83 83 0 8 0 nchpl 144 9389 0 7803 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 22649 0 22649 3 2 1 1 0 8 1 vcpupl 1984 2 0 0 1 0 1 1 0 8 0 vmpool 528 2 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 9 0 5 1 0 1 1 0 8 0 scxspl 216 27427 0 27427 2 1 1 1 0 8 1 plimitpl 152 45 0 38 1 0 1 1 0 8 0 sigapl 424 3623 0 3593 4 0 4 4 0 8 0 futexpl 56 25713 0 25713 2 1 1 1 0 8 1 knotepl 112 203 0 183 1 0 1 1 0 8 0 kqueuepl 168 2052 0 2050 1 0 1 1 0 8 0 pipepl 304 179 0 168 6 4 2 2 0 8 0 fdescpl 432 3606 0 3592 2 0 2 2 0 8 0 filepl 120 10952 0 10853 4 0 4 4 0 8 1 lockfpl 104 454 0 453 1 0 1 1 0 8 0 lockfspl 48 169 0 168 1 0 1 1 0 8 0 sessionpl 144 20 0 10 1 0 1 1 0 8 0 pgrppl 48 22 0 12 1 0 1 1 0 8 0 ucredpl 96 753 0 746 1 0 1 1 0 8 0 zombiepl 144 3593 0 3592 2 1 1 1 0 8 0 processpl 1016 3623 0 3592 6 2 4 5 0 8 0 procpl 672 7177 0 7139 4 0 4 4 0 8 0 sosppl 168 9 0 9 2 2 0 1 0 8 0 sockpl 432 1866 0 1847 5 2 3 4 0 8 0 mcl64k 65536 83 0 83 9 8 1 1 0 8 1 mcl16k 16384 9 0 9 4 3 1 1 0 8 1 mcl12k 12288 46 0 46 4 3 1 1 0 8 1 mcl9k 9216 15 0 15 5 4 1 1 0 8 1 mcl8k 8192 40 0 40 4 4 0 1 0 8 0 mcl4k 4096 117 0 117 6 5 1 1 0 8 1 mcl2k2 2112 15 0 15 2 2 0 1 0 8 0 mcl2k 2048 163749 0 163685 36 24 12 18 0 8 3 mtagpl 96 388 0 341 8 5 3 7 0 8 0 mbufpl 256 268500 0 268317 55 32 23 44 0 8 6 bufpl 280 7272 0 953 452 0 452 452 0 8 0 anonpl 24 247375 0 229796 116 6 110 113 0 188 0 amapchunkpl 152 12075 0 11739 15 1 14 14 0 158 0 amappl16 200 11821 0 11017 44 1 43 44 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 22 0 18 1 0 1 1 0 8 0 amappl13 176 1670 0 1669 1 0 1 1 0 8 0 amappl12 168 396 0 392 1 0 1 1 0 8 0 amappl11 160 56 0 45 1 0 1 1 0 8 0 amappl10 152 9 0 1 1 0 1 1 0 8 0 amappl9 144 17 0 16 1 0 1 1 0 8 0 amappl8 136 196 0 148 2 0 2 2 0 8 0 amappl7 128 253 0 244 1 0 1 1 0 8 0 amappl6 120 74 0 63 1 0 1 1 0 8 0 amappl5 112 4225 0 4210 1 0 1 1 0 8 0 amappl4 104 651 0 626 1 0 1 1 0 8 0 amappl3 96 1866 0 1859 1 0 1 1 0 8 0 amappl2 88 27921 0 27854 3 1 2 3 0 8 0 amappl1 80 102306 0 101870 27 16 11 20 0 8 0 amappl 88 7456 0 7389 2 0 2 2 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 47 0 0 1 0 1 1 0 8 0 uaddrrnd 24 3608 0 3592 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3608 0 3592 1 0 1 1 0 8 0 vmmpekpl 168 20139 0 20114 2 0 2 2 0 8 0 vmmpepl 168 446455 0 444509 169 56 113 117 0 357 27 vmsppl 272 3607 0 3592 3 1 2 2 0 8 0 rwobjpl 24 88762 0 87305 16 6 10 10 0 8 1 pdppl 4096 7222 0 7186 62 24 38 40 0 8 2 pvpl 32 1240328 0 1219813 205 32 173 181 0 265 2 pmappl 200 3607 0 3592 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 390 0 117 9 0 9 9 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823e4940) at panic+0x15e sys/kern/subr_prf.c:218 rw_enter(ffffffff826fc3e0,1) at rw_enter+0x36f sys/kern/kern_rwlock.c:174 pf_state_insert(ffff800000af7700,ffff800021703358,ffff800021703360,fffffd806cdcddc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b37800,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b37800,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80790eebe0,c1084425,ffff800000b37800,3,fffffd807f7b7b40,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80783f7258,c1084425,ffff800000b37800,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800021703808,ffff800021703850) at sys_ioctl+0x4ac syscall(ffff8000217038d0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xff334d58b20, count: -11 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff823e4940) at panic+0x15e sys/kern/subr_prf.c:218 rw_enter(ffffffff826fc3e0,1) at rw_enter+0x36f sys/kern/kern_rwlock.c:174 pf_state_insert(ffff800000af7700,ffff800021703358,ffff800021703360,fffffd806cdcddc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b37800,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b37800,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80790eebe0,c1084425,ffff800000b37800,3,fffffd807f7b7b40,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80783f7258,c1084425,ffff800000b37800,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800021703808,ffff800021703850) at sys_ioctl+0x4ac syscall(ffff8000217038d0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xff334d58b20, count: -11