panic: rw_enter: pf_state_lock locking against myself Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 64156 66986 0 0 0x4000000 0 syz-executor.0 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(ffff800000b3ee00,ffff800022747368,ffff800022747370,fffffd80670f0dc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b50e00,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b50e00,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80728b3cc0,c1084425,ffff800000b50e00,3,fffffd807f7b7ae0,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806b6b8d38,c1084425,ffff800000b50e00,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800022747818,ffff800022747860) at sys_ioctl+0x4ac syscall(ffff8000227478e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x960f7fae0a0, 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(ffff800000b3ee00,ffff800022747368,ffff800022747370,fffffd80670f0dc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b50e00,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b50e00,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80728b3cc0,c1084425,ffff800000b50e00,3,fffffd807f7b7ae0,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806b6b8d38,c1084425,ffff800000b50e00,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800022747818,ffff800022747860) at sys_ioctl+0x4ac syscall(ffff8000227478e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x960f7fae0a0, count: -11 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff800022747190 rbx 0xffff8000227471a0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81034bd5 kprintf+0x155 r9 0x1 r10 0x8c53c91f9c4208f0 r11 0x3d98c789784f3da8 r12 0x3000000008 r13 0xffff800022747240 r14 0x100 r15 0x1 rip 0xffffffff81116418 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022747180 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=64156 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000216707e0,0xffffffff827feb10 process=0xffff80002165d800 user=0xffff800022742000, vmspace=0xfffffd807effddd0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 66986 161650 92475 0 2 0 syz-executor.0 *66986 64156 92475 0 7 0x4000000 syz-executor.0 57719 97784 0 0 3 0x14200 bored sosplice 89511 86187 56742 0 3 0x82 nanoslp syz-executor.1 92475 149726 56742 0 3 0x82 nanoslp syz-executor.0 56742 218899 91365 0 3 0x82 thrsleep syz-fuzzer 56742 29776 91365 0 3 0x4000082 nanoslp syz-fuzzer 56742 471411 91365 0 3 0x4000082 thrsleep syz-fuzzer 56742 193518 91365 0 3 0x4000082 kqread syz-fuzzer 56742 56234 91365 0 3 0x4000082 thrsleep syz-fuzzer 56742 416303 91365 0 3 0x4000082 thrsleep syz-fuzzer 91365 332184 77676 0 3 0x10008a sigsusp ksh 77676 457347 84229 0 3 0x92 select sshd 63648 244995 1 0 3 0x100083 ttyin getty 84229 503050 1 0 3 0x80 select sshd 44265 61790 16940 73 3 0x100090 kqread syslogd 16940 89353 1 0 3 0x100082 netio syslogd 1902 492464 1 77 3 0x100090 poll dhclient 99763 127186 1 0 3 0x80 poll dhclient 18108 11407 0 0 3 0x14200 bored smr 76093 223800 0 0 2 0x14200 zerothread 79123 49693 0 0 3 0x14200 aiodoned aiodoned 97456 42238 0 0 3 0x14200 syncer update 92541 459237 0 0 3 0x14200 cleaner cleaner 85695 462241 0 0 3 0x14200 reaper reaper 244 472506 0 0 3 0x14200 pgdaemon pagedaemon 72062 481239 0 0 3 0x14200 bored crynlk 2741 189464 0 0 3 0x14200 bored crypto 63141 166390 0 0 3 0x14200 bored viomb 22310 463312 0 0 3 0x40014200 acpi0 acpi0 70019 468146 0 0 3 0x14200 bored softnet 16370 223371 0 0 3 0x14200 bored systqmp 12213 94812 0 0 3 0x14200 bored systq 48041 465319 0 0 3 0x40014200 bored softclock 33987 205077 0 0 3 0x40014200 idle0 1 16774 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 9474 6346K 7257K 78643K 11844 0 pcb 13 8K 8K 78643K 81 0 rtable 105 3K 3K 78643K 212 0 ifaddr 45 10K 10K 78643K 45 0 counters 21 16K 16K 78643K 21 0 ioctlops 1 0K 2K 78643K 49 0 iov 0 0K 2K 78643K 37 0 mount 1 1K 1K 78643K 1 0 vnodes 1217 77K 77K 78643K 1549 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 0K 0K 78643K 2 0 sem 12 1K 1K 78643K 59 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 1041 0 proc 49 38K 62K 78643K 477 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 107 0 in_multi 33 2K 2K 78643K 38 0 ether_multi 1 0K 0K 78643K 3 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 2K 78643K 317 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 93 21K 21K 78643K 2839 0 UVM aobj 11 2K 2K 78643K 11 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 54 0 NDP 6 0K 0K 78643K 10 0 temp 105 3965K 4029K 78643K 4269 0 kqueue 3 4K 12K 78643K 43 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 6 0 0 1 0 1 1 0 8 0 rtpcb 120 34 0 32 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 323 0 315 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpcb 736 229 0 219 5 1 4 5 0 8 3 inpcb 304 541 0 534 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pfstscr 40 1 0 0 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 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 semupl 112 9 0 9 1 1 0 1 0 8 0 semapl 112 57 0 47 1 0 1 1 0 8 0 shmpl 112 8 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2647 0 1253 88 0 88 88 0 8 0 ffsino 240 2647 0 1253 83 0 83 83 0 8 0 nchpl 144 4146 0 2548 60 0 60 60 0 8 0 uvmvnodes 72 2957 0 0 54 0 54 54 0 8 0 vnodes 224 2957 0 0 174 0 174 174 0 8 0 namei 1024 9688 0 9688 1 0 1 1 0 8 1 scxspl 216 11597 0 11597 1 0 1 1 0 8 1 plimitpl 152 25 0 18 1 0 1 1 0 8 0 sigapl 424 1229 0 1199 4 0 4 4 0 8 0 futexpl 56 8836 0 8836 1 0 1 1 0 8 1 knotepl 112 108 0 88 1 0 1 1 0 8 0 kqueuepl 168 565 0 563 1 0 1 1 0 8 0 pipepl 304 83 0 72 2 0 2 2 0 8 1 fdescpl 432 1213 0 1199 2 0 2 2 0 8 0 filepl 120 4174 0 4074 4 0 4 4 0 8 0 lockfpl 104 55 0 54 1 0 1 1 0 8 0 lockfspl 48 28 0 27 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 363 0 356 1 0 1 1 0 8 0 zombiepl 144 1199 0 1198 1 0 1 1 0 8 0 processpl 1016 1229 0 1198 5 1 4 5 0 8 0 procpl 672 2315 0 2278 4 0 4 4 0 8 0 sosppl 168 19 0 19 1 1 0 1 0 8 0 sockpl 432 898 0 881 3 0 3 3 0 8 1 mcl64k 65536 33 0 33 1 1 0 1 0 8 0 mcl9k 9216 11 0 11 1 1 0 1 0 8 0 mcl8k 8192 4 0 4 1 1 0 1 0 8 0 mcl4k 4096 33 0 32 3 2 1 1 0 8 0 mcl2k 2048 12625 0 12592 12 4 8 10 0 8 3 mtagpl 96 155 0 2 5 1 4 4 0 8 0 mbufpl 256 42075 0 41701 45 10 35 39 0 8 8 bufpl 280 4446 0 181 305 0 305 305 0 8 0 anonpl 24 85719 0 81787 27 2 25 25 0 188 0 amapchunkpl 152 4274 0 4131 7 0 7 7 0 158 1 amappl16 200 3126 0 3002 7 0 7 7 0 8 0 amappl15 192 3 0 0 1 0 1 1 0 8 0 amappl14 184 524 0 515 1 0 1 1 0 8 0 amappl13 176 23 0 22 1 0 1 1 0 8 0 amappl12 168 1 0 0 1 0 1 1 0 8 0 amappl11 160 45 0 34 1 0 1 1 0 8 0 amappl10 152 7 0 2 1 0 1 1 0 8 0 amappl9 144 539 0 537 1 0 1 1 0 8 0 amappl8 136 140 0 103 2 0 2 2 0 8 0 amappl7 128 733 0 727 1 0 1 1 0 8 0 amappl6 120 61 0 52 1 0 1 1 0 8 0 amappl5 112 1391 0 1378 1 0 1 1 0 8 0 amappl4 104 729 0 704 1 0 1 1 0 8 0 amappl3 96 131 0 122 1 0 1 1 0 8 0 amappl2 88 9428 0 9362 3 1 2 3 0 8 0 amappl1 80 39495 0 39056 26 15 11 20 0 8 0 amappl 88 2548 0 2504 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 10 0 0 1 0 1 1 0 8 0 uaddrrnd 24 1213 0 1199 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1213 0 1199 1 0 1 1 0 8 0 vmmpekpl 168 9542 0 9521 1 0 1 1 0 8 0 vmmpepl 168 152040 0 150806 77 17 60 72 0 357 4 vmsppl 272 1212 0 1199 2 1 1 2 0 8 0 rwobjpl 24 32288 0 31535 10 5 5 8 0 8 0 pdppl 4096 2432 0 2398 50 14 36 40 0 8 2 pvpl 32 388707 0 381893 115 18 97 115 0 265 39 pmappl 200 1212 0 1199 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 315 0 37 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(ffff800000b3ee00,ffff800022747368,ffff800022747370,fffffd80670f0dc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b50e00,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b50e00,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80728b3cc0,c1084425,ffff800000b50e00,3,fffffd807f7b7ae0,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806b6b8d38,c1084425,ffff800000b50e00,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800022747818,ffff800022747860) at sys_ioctl+0x4ac syscall(ffff8000227478e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x960f7fae0a0, 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(ffff800000b3ee00,ffff800022747368,ffff800022747370,fffffd80670f0dc0) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000b50e00,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000b50e00,3,ffff8000216702a0) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd80728b3cc0,c1084425,ffff800000b50e00,3,fffffd807f7b7ae0,ffff8000216702a0) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806b6b8d38,c1084425,ffff800000b50e00,ffff8000216702a0) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000216702a0,ffff800022747818,ffff800022747860) at sys_ioctl+0x4ac syscall(ffff8000227478e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x960f7fae0a0, count: -11