panic: rw_enter: pf_state_lock locking against myself Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *439200 56395 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(ffff800000b10f00,ffff8000239376b8,ffff8000239376c0,fffffd8066367a00) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000bf1400,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000bf1400,3,ffff800021670a80) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd806eb04940,c1084425,ffff800000bf1400,3,fffffd807f7b7ae0,ffff800021670a80) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806cdec270,c1084425,ffff800000bf1400,ffff800021670a80) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021670a80,ffff800023937b68,ffff800023937bb0) at sys_ioctl+0x4ac syscall(ffff800023937c30) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe4f4ac72ab0, 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(ffff800000b10f00,ffff8000239376b8,ffff8000239376c0,fffffd8066367a00) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000bf1400,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000bf1400,3,ffff800021670a80) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd806eb04940,c1084425,ffff800000bf1400,3,fffffd807f7b7ae0,ffff800021670a80) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806cdec270,c1084425,ffff800000bf1400,ffff800021670a80) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021670a80,ffff800023937b68,ffff800023937bb0) at sys_ioctl+0x4ac syscall(ffff800023937c30) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe4f4ac72ab0, count: -11 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000239374e0 rbx 0xffff8000239374f0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81034bd5 kprintf+0x155 r9 0x1 r10 0x1bb97954130dbf21 r11 0xced9dd4fe8caadbc r12 0x3000000008 r13 0xffff800023937590 r14 0x100 r15 0x1 rip 0xffffffff81116418 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000239374d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=439200 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=75, nice=20 forw=0xffffffffffffffff, list=0xffff800021670000,0xffffffff827feb10 process=0xffff80002165dbf8 user=0xffff800023932000, vmspace=0xfffffd807effdcc0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 56395 29003 72904 0 2 0 syz-executor.0 *56395 439200 72904 0 7 0x4000000 syz-executor.0 47250 1806 0 0 3 0x14200 acct acct 11391 183905 0 0 3 0x14200 bored sosplice 60719 309701 71374 0 2 0x2 syz-executor.1 72904 190175 71374 0 3 0x82 nanoslp syz-executor.0 71374 299005 39251 0 3 0x82 thrsleep syz-fuzzer 71374 8261 39251 0 3 0x4000082 nanoslp syz-fuzzer 71374 182270 39251 0 3 0x4000082 thrsleep syz-fuzzer 71374 181188 39251 0 3 0x4000082 thrsleep syz-fuzzer 71374 294621 39251 0 3 0x4000082 thrsleep syz-fuzzer 71374 8577 39251 0 3 0x4000082 thrsleep syz-fuzzer 71374 338189 39251 0 3 0x4000082 kqread syz-fuzzer 39251 442612 98469 0 3 0x10008a sigsusp ksh 98469 406326 58715 0 3 0x92 select sshd 87265 342313 1 0 3 0x100083 ttyin getty 58715 255507 1 0 3 0x80 select sshd 53774 231614 52403 73 3 0x100090 kqread syslogd 52403 13871 1 0 3 0x100082 netio syslogd 11445 171037 1 77 3 0x100090 poll dhclient 29446 424084 1 0 3 0x80 poll dhclient 35725 18793 0 0 3 0x14200 bored smr 45644 83658 0 0 2 0x14200 zerothread 31345 201668 0 0 3 0x14200 aiodoned aiodoned 7597 102570 0 0 3 0x14200 syncer update 33752 225307 0 0 3 0x14200 cleaner cleaner 93029 73815 0 0 3 0x14200 reaper reaper 79524 277975 0 0 3 0x14200 pgdaemon pagedaemon 19675 73436 0 0 3 0x14200 bored crynlk 3870 490277 0 0 3 0x14200 bored crypto 32967 446695 0 0 3 0x14200 bored viomb 25268 430650 0 0 3 0x40014200 acpi0 acpi0 87673 48481 0 0 3 0x14200 bored softnet 96972 225107 0 0 3 0x14200 bored systqmp 26962 35263 0 0 3 0x14200 bored systq 80128 167472 0 0 3 0x40014200 bored softclock 76867 139725 0 0 3 0x40014200 idle0 1 444861 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 9487 6353K 7384K 78643K 12568 0 pcb 13 8K 8K 78643K 101 0 rtable 107 3K 3K 78643K 327 0 ifaddr 49 11K 11K 78643K 127 0 counters 21 16K 16K 78643K 38 0 ioctlops 1 0K 2K 78643K 90 0 iov 0 0K 12K 78643K 44 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1952 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 22 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 0K 78643K 226 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 2368 0 sigio 0 0K 0K 78643K 5 0 proc 50 38K 63K 78643K 384 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 154 0 in_multi 33 2K 2K 78643K 113 0 ether_multi 1 0K 0K 78643K 27 0 mrt 0 0K 0K 78643K 17 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 73 334K 334K 78643K 73 0 exec 0 0K 2K 78643K 386 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 115 22K 22K 78643K 5688 0 UVM aobj 25 2K 2K 78643K 25 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 102 0 NDP 7 0K 0K 78643K 28 0 temp 81 3958K 4022K 78643K 14209 0 kqueue 3 4K 8K 78643K 113 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 46 0 44 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 687 0 670 1 0 1 1 0 8 0 syncache 296 23 0 23 3 3 0 1 0 8 0 tcpqe 32 33 0 33 3 3 0 1 0 8 0 tcpcb 736 334 0 330 9 7 2 4 0 8 1 inpcb 304 833 0 826 4 3 1 2 0 8 0 nd6 48 7 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 ppxss 1128 4 0 4 1 1 0 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 190 0 0 12 0 12 12 0 8 0 art_table 32 191 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 semapl 112 224 0 214 1 0 1 1 0 8 0 shmpl 112 22 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4475 0 3073 88 0 88 88 0 8 0 ffsino 240 4475 0 3073 83 0 83 83 0 8 0 nchpl 144 7330 0 5731 60 0 60 60 0 8 0 uvmvnodes 72 4912 0 0 90 0 90 90 0 8 0 vnodes 224 4912 0 0 289 0 289 289 0 8 0 namei 1024 17393 0 17392 1 0 1 1 0 8 0 scxspl 216 20778 0 20778 1 0 1 1 0 8 1 plimitpl 152 38 0 31 1 0 1 1 0 8 0 sigapl 424 2557 0 2526 4 0 4 4 0 8 0 futexpl 56 18299 0 18299 1 0 1 1 0 8 1 knotepl 112 190 0 170 1 0 1 1 0 8 0 kqueuepl 168 1283 0 1281 1 0 1 1 0 8 0 pipepl 304 218 0 207 5 3 2 2 0 8 1 fdescpl 432 2540 0 2526 2 0 2 2 0 8 0 filepl 120 8463 0 8364 5 1 4 5 0 8 0 lockfpl 104 343 0 342 1 0 1 1 0 8 0 lockfspl 48 109 0 108 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 28 0 18 1 0 1 1 0 8 0 ucredpl 96 1277 0 1268 1 0 1 1 0 8 0 zombiepl 144 2526 0 2526 1 0 1 1 0 8 1 processpl 1016 2557 0 2526 6 1 5 5 0 8 1 procpl 672 5061 0 5023 4 0 4 4 0 8 0 sosppl 168 41 0 41 4 3 1 1 0 8 1 sockpl 432 1567 0 1541 5 1 4 5 0 8 0 mcl64k 65536 24 0 24 3 3 0 1 0 8 0 mcl16k 16384 1 0 1 1 0 1 1 0 8 1 mcl12k 12288 29 0 29 4 3 1 1 0 8 1 mcl9k 9216 19 0 19 3 3 0 1 0 8 0 mcl8k 8192 52 0 52 5 4 1 1 0 8 1 mcl4k 4096 128 0 128 5 4 1 1 0 8 1 mcl2k 2048 20358 0 20317 19 9 10 11 0 8 4 mtagpl 96 236 0 48 6 1 5 5 0 8 0 mbufpl 256 73378 0 72949 47 13 34 34 0 8 3 bufpl 280 6375 0 169 444 0 444 444 0 8 0 anonpl 24 174357 0 169117 44 10 34 34 0 188 0 amapchunkpl 152 8433 0 8249 10 2 8 8 0 158 0 amappl16 200 8357 0 8186 15 5 10 12 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 24 0 19 1 0 1 1 0 8 0 amappl13 176 68 0 66 1 0 1 1 0 8 0 amappl12 168 4 0 2 1 0 1 1 0 8 0 amappl11 160 46 0 35 1 0 1 1 0 8 0 amappl10 152 9 0 3 1 0 1 1 0 8 0 amappl9 144 1159 0 1158 1 0 1 1 0 8 0 amappl8 136 188 0 140 2 0 2 2 0 8 0 amappl7 128 1362 0 1358 1 0 1 1 0 8 0 amappl6 120 62 0 52 1 0 1 1 0 8 0 amappl5 112 3208 0 3194 1 0 1 1 0 8 0 amappl4 104 267 0 243 1 0 1 1 0 8 0 amappl3 96 186 0 178 1 0 1 1 0 8 0 amappl2 88 19603 0 19538 3 1 2 3 0 8 0 amappl1 80 73214 0 72773 27 16 11 20 0 8 0 amappl 88 5311 0 5264 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 24 0 0 1 0 1 1 0 8 0 uaddrrnd 24 2540 0 2526 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2540 0 2526 1 0 1 1 0 8 0 vmmpekpl 168 15944 0 15922 2 0 2 2 0 8 0 vmmpepl 168 311050 0 309749 89 26 63 73 0 357 2 vmsppl 272 2539 0 2526 2 1 1 2 0 8 0 rwobjpl 24 63570 0 62760 12 6 6 8 0 8 0 pdppl 4096 5086 0 5052 50 14 36 40 0 8 2 pvpl 32 811884 0 803749 134 62 72 115 0 265 3 pmappl 200 2539 0 2526 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 338 0 58 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(ffff800000b10f00,ffff8000239376b8,ffff8000239376c0,fffffd8066367a00) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000bf1400,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000bf1400,3,ffff800021670a80) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd806eb04940,c1084425,ffff800000bf1400,3,fffffd807f7b7ae0,ffff800021670a80) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806cdec270,c1084425,ffff800000bf1400,ffff800021670a80) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021670a80,ffff800023937b68,ffff800023937bb0) at sys_ioctl+0x4ac syscall(ffff800023937c30) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe4f4ac72ab0, 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(ffff800000b10f00,ffff8000239376b8,ffff8000239376c0,fffffd8066367a00) at pf_state_insert+0xa0 sys/net/pf.c:951 pfsync_state_import(ffff800000bf1400,1) at pfsync_state_import+0xcbe sys/net/if_pfsync.c:699 pfioctl(4900,c1084425,ffff800000bf1400,3,ffff800021670a80) at pfioctl+0x50ac sys/net/pf_ioctl.c:1729 VOP_IOCTL(fffffd806eb04940,c1084425,ffff800000bf1400,3,fffffd807f7b7ae0,ffff800021670a80) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806cdec270,c1084425,ffff800000bf1400,ffff800021670a80) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021670a80,ffff800023937b68,ffff800023937bb0) at sys_ioctl+0x4ac syscall(ffff800023937c30) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe4f4ac72ab0, count: -11