Re: CURRENT: kernel panic in IPFW while stopping jails

From: Alastair Hogge <agh_at_riseup.net>
Date: Wed, 31 Dec 2025 03:06:38 UTC
On 2025-12-31 01:02, Gleb Smirnoff wrote:
> Hi,

Hi Gleb,

> I have found the problem, thanks to Alastair for a core file.
> 
> The problem affects rules with automatic rule numbers and logging.
> 
> The attached patch should fix the problem, but it is not a final version.

Is there a special patch incantation I should be aware of? I have tried
the patch against both 8e951583936980909d34a6104ace781541fb62b1[1], and
4fecc8e3fe9408621429777b1028c9afb83c3925[2], and observed the following:

$ patch -C -E --posix < /exports/fafnir/var/tmp/ipfw-log.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/sys/netpfil/ipfw/ip_fw_bpf.c
b/sys/netpfil/ipfw/ip_fw_bpf.c
|index d9897f700d57..2a9f8d889f43 100644
|--- a/sys/netpfil/ipfw/ip_fw_bpf.c
|+++ b/sys/netpfil/ipfw/ip_fw_bpf.c
--------------------------
Patching file sys/netpfil/ipfw/ip_fw_bpf.c using Plan A...
Hunk #1 failed at 81.
Hunk #2 failed at 108.
2 out of 2 hunks failed while patching sys/netpfil/ipfw/ip_fw_bpf.c
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c
b/sys/netpfil/ipfw/ip_fw_sockopt.c
|index a91fb2e84da9..38e134a21141 100644
|--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
|+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
--------------------------
Patching file sys/netpfil/ipfw/ip_fw_sockopt.c using Plan A...
Hunk #1 failed at 210.
Hunk #2 failed at 552.
Hunk #3 failed at 2515.
3 out of 3 hunks failed while patching sys/netpfil/ipfw/ip_fw_sockopt.c
done

> Dan & Alastair, if any of you can confirm that the patch heals your setup - I
> will appreciate.

I manually patched in your work, and was able to boot a sync'd
-CURRENT[2], with logging counters re-enabled, there has been no panics
for ~20 minutes now.

> Again very sorry for this breakage.

Thanks for your prompt response, and efforts during the Holiday period.

Happy Holidays, and good health to you and your friends/families.

1:
https://codeberg.org/FreeBSD/freebsd-src/commit/8e951583936980909d34a6104ace781541fb62b1
2:
https://codeberg.org/FreeBSD/freebsd-src/commit/4fecc8e3fe9408621429777b1028c9afb83c3925