Kernel panic when enabling pfctl in Rpi2 armv7 13.2-STABLE

Hello,

I'm running FreeBSD-13.2 armv7 on a raspberry pi v2 featuring 1GB RAM.

When enabling pfctl the system crashes and then reboots. Here is the basic kgdb output:

Code:
GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD]
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv7-portbld-freebsd13.2".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:
Fatal kernel mode data abort: 'Alignment Fault' on read
trapframe: 0xdcd267c8
FSR=00000001, FAR=c31ce22c, spsr=60000013
r0 =e5cffe49, r1 =80383f2d, r2 =c31ce22c, r3 =00000001
r4 =dd2b6300, r5 =d6c0f400, r6 =dcd268e0, r7 =80383fad
r8 =c094c9ac, r9 =dcd26a54, r10=00000002, r11=dcd26870
r12=dd49c7f4, ssp=dcd26858, slr=dd450c2c, pc =dd487788

panic: Fatal abort
cpuid = 2
time = 1698872287
KDB: stack backtrace:
#0 0xc035786c at kdb_backtrace+0x48
#1 0xc02fdd20 at vpanic+0x140
#2 0xc02fdbe0 at vpanic+0
#3 0xc06304ac at abort_align+0
#4 0xc063052c at abort_align+0x80
#5 0xc063017c at abort_handler+0x480
#6 0xc060f480 at exception_exit+0
#7 0xdd487788 at pf_syncookie_validate+0x40
#8 0xdd450c2c at $a.108+0x20
#9 0xdd472e70 at pf_check_out+0x30
#10 0xc0445ac8 at pfil_run_hooks+0xa0
#11 0xc0477bf4 at ip_output+0xc30
#12 0xc048de6c at tcp_output+0x2134
#13 0xc04a4578 at tcp_usr_send+0x24c
#14 0xc03b09c8 at sosend_generic+0x5a0
#15 0xc03b108c at sosend+0x50
#16 0xc03874d4 at soo_write+0x54
#17 0xc037cab0 at dofilewrite+0x7c
Uptime: 13h3m7s
Physical memory: 933 MB
Dumping 82 MB:..5%..15%..25%..34%..44%..54%..63%..73%..83%..92%

savectx () at /usr/src/sys/arm/arm/swtch.S:103
warning: Source file is more recent than executable.
103        tst    r2, #(VFPEXC_EN)    /* the current thread has */

(kgdb) list pf_syncookie_validate
warning: Source file is more recent than executable.
325        return (true);
326    }
327
328    uint8_t
329    pf_syncookie_validate(struct pf_pdesc *pd)
330    {
331        uint32_t         ack;
332        union pf_syncookie     cookie;
333
334        if (! pf_syncookie_check(pd))
(kgdb)

I am unfamiliar with kgdb and unsure of next steps. Any suggestions would be appreciated. I can upload the dump and can manage without pfctl running on this device.

Kind regards,

P.
 
Hi,

That's a bug with PF, in my case the least traffic could make RPI2 crash and reboot.
At first I tried to remove the dongle(wifi) which let the RPI2 boot correctly but as soon as something came through PF it made the system crashed instantly.
I guessed PF couldn't stand any type of traffic, not even a ping. I didn't find any solution other than switch from PF to IPFW.


This thread is about the same issue but with QEMU image, there is a patch that fix the problem but I think is more specific to QEMU so I am not sure it can work with other images (I might be wrong because it's beyond my knowledge).


TBO I am not sure if this bug is even a priority because:
1) RPI2 is Tier 2.
2) RPI2 is not wildly use anymore in 2023 ... and RPI5 just came out, hopefully I am wrong.
 
We’ll see. When I get the time I might test against FreeBSD 14.

Ps. There is another thread in bugtraq with a proposed code snippet. I wanted to try that but time is hard to find.
 
Back
Top