panic: kernel diagnostic assertion "(p->pfik_flagrefs == 0) || (p->pfik_flagrefs == 1)" failed: file "/syzkaller/managers/main/kernel/sys/net/pf_if.c", line 907 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *373730 54377 -1 0x10 0x4000000 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83488bc6) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c613b,ffffffff834b34ea,38b,ffffffff8343f6e4) at __assert+0x29 sys/kern/subr_prf.c:-1 pfi_clear_flags(ffff80002a7a51d0,0) at pfi_clear_flags+0x41d sys/net/pf_if.c:893 pfioctl(24900,c028445a,ffff80002a7a51d0,2,ffff80002f0b1a08) at pfioctl+0xf6a sys/net/pf_ioctl.c:3910 VOP_IOCTL(fffff9005fa01040,c028445a,ffff80002a7a51d0,2,fffff90007ffd680,ffff80002f0b1a08) at VOP_IOCTL+0xa3 sys/kern/vfs_vops.c:264 vn_ioctl(fffff90079d69008,c028445a,ffff80002a7a51d0,ffff80002f0b1a08) at vn_ioctl+0xea sys/kern/vfs_vnops.c:537 sys_ioctl(ffff80002f0b1a08,ffff80002a7a53a0,ffff80002a7a52f0) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a7a53a0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a53a0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b044f51e30, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic *cpu0: kernel diagnostic assertion "(p->pfik_flagrefs == 0) || (p->pfik_flagrefs == 1)" failed: file "/syzkaller/managers/main/kernel/sys/net/pf_if.c", line 907 ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83488bc6) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c613b,ffffffff834b34ea,38b,ffffffff8343f6e4) at __assert+0x29 sys/kern/subr_prf.c:-1 pfi_clear_flags(ffff80002a7a51d0,0) at pfi_clear_flags+0x41d sys/net/pf_if.c:893 pfioctl(24900,c028445a,ffff80002a7a51d0,2,ffff80002f0b1a08) at pfioctl+0xf6a sys/net/pf_ioctl.c:3910 VOP_IOCTL(fffff9005fa01040,c028445a,ffff80002a7a51d0,2,fffff90007ffd680,ffff80002f0b1a08) at VOP_IOCTL+0xa3 sys/kern/vfs_vops.c:264 vn_ioctl(fffff90079d69008,c028445a,ffff80002a7a51d0,ffff80002f0b1a08) at vn_ioctl+0xea sys/kern/vfs_vnops.c:537 sys_ioctl(ffff80002f0b1a08,ffff80002a7a53a0,ffff80002a7a52f0) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a7a53a0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a53a0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b044f51e30, count: -10 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a7a4d80 rbx 0xffff80000040cd00 rdx 0xffff8000015e5d80 rcx 0 rax 0xffff80002f0b1a08 r8 0x101010101010101 r9 0x8080808080808080 r10 0x3a2d42a18fcb2d84 r11 0x1f829272f676eb10 r12 0 r13 0x2 r14 0 r15 0x1 rip 0xffffffff82edcfd5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a7a4d70 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syz-executor) tid=373730 pid=54377 tcnt=2 stat=onproc flags process=10 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002f0b07e0,0xffffffff83a60b18 process=0xffff800045ff9218 user=0xffff80002a7a0000, vmspace=0xfffff9007f231a10 estcpu=24, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 54377 396003 45635 -1 2 0x10 syz-executor *54377 373730 45635 -1 7 0x4000010 syz-executor 39840 473466 29250 0 2 0x1 syz-executor 39840 30251 29250 0 3 0x4000081 kqsel syz-executor 84730 123716 65972 0 2 0 syz-executor 84730 355066 65972 0 3 0x4000080 sbwait syz-executor 41036 81532 9469 60929 2 0x10 syz-executor 41036 363652 9469 60929 2 0x4000010 syz-executor 82766 288264 90558 0 2 0 syz-executor 82766 337789 90558 0 3 0x4000080 fsleep syz-executor 80188 69780 56870 0 2 0 syz-executor 80188 263985 56870 0 3 0x4000080 nanoslp syz-executor 92113 63967 1 0 3 0x82 nanoslp getty 29250 107974 70029 0 3 0x82 nanoslp syz-executor 45635 448647 70029 0 3 0x82 nanoslp syz-executor 90558 366530 70029 0 3 0x82 nanoslp syz-executor 33698 154976 70029 0 2 0x2 syz-executor 9469 149590 70029 0 3 0x82 nanoslp syz-executor 56870 144103 70029 0 2 0xc82 syz-executor 65972 149223 70029 0 2 0xc82 syz-executor 2548 312084 70029 0 2 0xc82 syz-executor 70029 182811 1 0 3 0x82 kqread syz-executor 60927 98078 0 0 3 0x14200 bored smr 40618 15992 0 0 2 0x14200 zerothread 65693 397569 0 0 3 0x14200 aiodoned aiodoned 93955 437547 0 0 3 0x14200 syncer update 80767 64183 0 0 3 0x14200 cleaner cleaner 56750 141912 0 0 3 0x14200 reaper reaper 58221 327987 0 0 3 0x14200 pgdaemon pagedaemon 70621 256995 0 0 3 0x14200 bored viomb 82966 311455 0 0 3 0x40014200 acpi0 acpi0 21021 365254 0 0 3 0x14200 bored softnet0 26522 482854 0 0 3 0x14200 bored systqmp 26830 448627 0 0 3 0x14200 bored systq 38907 295317 0 0 3 0x40014200 tmoslp softclock 58329 516413 0 0 3 0x40014200 idle0 1 491873 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 11032 12102K 12230K 166960K 12161 0 pcb 17 12K 12K 166960K 28 0 rtable 237 6K 6K 166960K 356 0 pf 35 14K 14K 166960K 35 0 ifaddr 43 7K 7K 166960K 45 0 ifgroup 55 2K 2K 166960K 55 0 sysctl 1 1K 9K 166960K 6 0 counters 34 17K 17K 166960K 34 0 ioctlops 0 0K 2K 166960K 47 0 iov 0 0K 12K 166960K 6 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1328 84K 84K 166960K 1433 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 1K 166960K 2 0 VM map 2 1K 1K 166960K 2 0 sem 2 0K 0K 166960K 2 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 16 61K 93K 166960K 181 0 sigio 0 0K 0K 166960K 2 0 proc 19 25K 116K 166960K 506 0 subproc 72 4K 4K 166960K 72 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 11 0 in_multi 99 7K 7K 166960K 101 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 73 334K 334K 166960K 73 0 exec 0 0K 1K 166960K 370 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 136 92K 159K 166960K 3269 0 UVM aobj 4 2K 2K 166960K 4 0 pinsyscall 19 38K 94K 166960K 1285 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 1 0 NDP 14 0K 2K 166960K 28 0 temp 36 9110K 9170K 166960K 3768 0 kqueue 2 4K 22K 166960K 33 0 SYN cache 2 16K 16K 166960K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 38 0 38 2 1 1 1 0 8 1 rtentry 136 111 0 1 4 0 4 4 0 8 0 unpcb 144 62 0 58 1 0 1 1 0 8 0 syncache 336 5 0 5 2 1 1 1 0 8 1 tcpcb 736 17 0 16 1 0 1 1 0 8 0 arp 96 18 0 0 1 0 1 1 0 8 0 inpcb 328 91 0 89 2 1 1 2 0 8 0 ip6q 72 1 0 1 1 0 1 1 0 8 1 ip6af 40 2 0 2 1 0 1 1 0 8 1 nd6 112 24 0 0 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 pfstscr 40 2 0 2 1 0 1 1 0 8 1 pfstkey 128 2 0 2 1 0 1 1 0 8 1 pfstate 384 1 0 1 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 453 0 0 29 0 29 29 0 8 0 art_table 40 454 0 0 5 0 5 5 0 8 0 art_node 32 111 0 11 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1645 0 182 92 0 92 92 0 8 0 ffsino 256 1645 0 182 92 0 92 92 0 8 0 nchpl 144 1908 0 207 64 0 64 64 0 8 0 vnodes 216 1792 0 0 100 0 100 100 0 8 0 namei 1024 5648 0 5647 2 1 1 2 0 8 0 kstatmem 264 25 0 0 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 6225 0 6225 5 4 1 5 1 8 1 plimitpl 152 37 0 26 1 0 1 1 0 8 0 sigapl 424 477 0 445 6 1 5 6 0 8 0 knotepl 120 5070 0 4870 13 6 7 8 0 8 0 kqueuepl 184 32 0 28 1 0 1 1 0 8 0 pipepl 304 125 0 98 3 0 3 3 0 8 0 fdescpl 448 464 0 445 5 1 4 5 0 8 0 filepl 120 1732 0 1558 8 1 7 8 0 8 0 lockfpl 104 29 0 28 2 1 1 1 0 8 0 lockfspl 48 14 0 13 2 1 1 1 0 8 0 sessionpl 144 27 0 24 1 0 1 1 0 8 0 pgrppl 48 36 0 25 1 0 1 1 0 8 0 ucredpl 104 141 0 136 1 0 1 1 0 8 0 zombiepl 144 446 0 445 2 1 1 1 0 8 0 processpl 1152 477 0 445 4 0 4 4 0 8 0 procpl 664 534 0 496 5 0 5 5 0 8 0 sosppl 176 2 0 2 1 1 0 1 0 8 0 sockpl 552 196 0 190 3 1 2 3 0 8 1 mcl64k 65536 25 0 24 2 1 1 1 0 8 0 mcl16k 16384 5 0 5 2 1 1 1 0 8 1 mcl12k 12288 3 0 3 2 1 1 1 0 8 1 mcl9k128 9344 1 0 1 1 1 0 1 0 8 0 mcl8k 8192 13 0 13 2 1 1 1 0 8 1 mcl4k 4096 2584 0 2532 13 5 8 13 0 8 1 mcl2k 2048 134 0 132 2 1 1 1 0 8 0 mtagpl 96 4 0 4 1 1 0 1 0 8 0 mbufpl 256 4723 0 4580 10 0 10 10 0 8 0 bufpl 272 2316 0 102 148 0 148 148 0 8 0 anonpl 24 89217 0 84562 39 4 35 35 0 187 0 amapchunkpl 152 9158 0 8618 27 1 26 26 0 158 3 amappl16 200 1292 0 1270 4 2 2 4 0 8 0 amappl15 192 92 0 92 1 1 0 1 0 8 0 amappl14 184 409 0 409 1 1 0 1 0 8 0 amappl13 176 117 0 116 1 0 1 1 0 8 0 amappl12 168 703 0 685 2 0 2 2 0 8 0 amappl11 160 5 0 5 1 1 0 1 0 8 0 amappl10 152 129 0 129 1 1 0 1 0 8 0 amappl9 144 271 0 271 1 1 0 1 0 8 0 amappl8 136 92 0 92 1 1 0 1 0 8 0 amappl7 128 142 0 140 1 0 1 1 0 8 0 amappl6 120 149 0 149 1 1 0 1 0 8 0 amappl5 112 94 0 94 1 1 0 1 0 8 0 amappl4 104 266 0 264 1 0 1 1 0 8 0 amappl3 96 1674 0 1594 3 0 3 3 0 8 0 amappl2 88 520 0 509 2 0 2 2 0 8 0 amappl1 80 10371 0 10254 13 5 8 13 0 8 1 amappl 88 2566 0 2447 4 0 4 4 0 92 0 uvmvnodes 80 97 0 0 2 0 2 2 0 8 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 464 0 445 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 464 0 445 1 0 1 1 0 8 0 vmmpekpl 168 5644 0 5611 2 0 2 2 0 8 0 vmmpepl 168 38630 0 37776 80 38 42 80 0 357 2 vmsppl 368 463 0 445 4 1 3 4 0 8 0 rwobjpl 40 14079 0 13666 11 1 10 11 0 8 0 pdppl 4096 934 0 890 96 50 46 80 0 8 2 pvpl 32 229510 0 219540 132 33 99 99 0 265 11 pmappl 216 463 0 445 3 0 3 3 0 8 0 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 509 0 65 14 0 14 14 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83488bc6) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c613b,ffffffff834b34ea,38b,ffffffff8343f6e4) at __assert+0x29 sys/kern/subr_prf.c:-1 pfi_clear_flags(ffff80002a7a51d0,0) at pfi_clear_flags+0x41d sys/net/pf_if.c:893 pfioctl(24900,c028445a,ffff80002a7a51d0,2,ffff80002f0b1a08) at pfioctl+0xf6a sys/net/pf_ioctl.c:3910 VOP_IOCTL(fffff9005fa01040,c028445a,ffff80002a7a51d0,2,fffff90007ffd680,ffff80002f0b1a08) at VOP_IOCTL+0xa3 sys/kern/vfs_vops.c:264 vn_ioctl(fffff90079d69008,c028445a,ffff80002a7a51d0,ffff80002f0b1a08) at vn_ioctl+0xea sys/kern/vfs_vnops.c:537 sys_ioctl(ffff80002f0b1a08,ffff80002a7a53a0,ffff80002a7a52f0) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a7a53a0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a53a0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b044f51e30, count: -10 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83488bc6) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c613b,ffffffff834b34ea,38b,ffffffff8343f6e4) at __assert+0x29 sys/kern/subr_prf.c:-1 pfi_clear_flags(ffff80002a7a51d0,0) at pfi_clear_flags+0x41d sys/net/pf_if.c:893 pfioctl(24900,c028445a,ffff80002a7a51d0,2,ffff80002f0b1a08) at pfioctl+0xf6a sys/net/pf_ioctl.c:3910 VOP_IOCTL(fffff9005fa01040,c028445a,ffff80002a7a51d0,2,fffff90007ffd680,ffff80002f0b1a08) at VOP_IOCTL+0xa3 sys/kern/vfs_vops.c:264 vn_ioctl(fffff90079d69008,c028445a,ffff80002a7a51d0,ffff80002f0b1a08) at vn_ioctl+0xea sys/kern/vfs_vnops.c:537 sys_ioctl(ffff80002f0b1a08,ffff80002a7a53a0,ffff80002a7a52f0) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a7a53a0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a53a0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1b044f51e30, count: -10 ddb>