<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/netpfil, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-07-23T11:27:36Z</updated>
<entry>
<title>pf(4) fix NULL pointer dereference in outbound packet path.</title>
<updated>2026-07-23T11:27:36Z</updated>
<author>
<name>Kristof Provost</name>
<email>kp@FreeBSD.org</email>
</author>
<published>2026-07-23T09:06:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=145541d4ed7923dc87e7e1a2e6864d123f81f4d2'/>
<id>urn:sha1:145541d4ed7923dc87e7e1a2e6864d123f81f4d2</id>
<content type='text'>
Outbound packet which matches rule with source limiter attached,
for example:

    source limiter "crash" id 1 entries 10000 limit 1000
    pass out from any to any source limiter "crash" keep state

triggers a NULL pointer dereference.

The issue was kindly reported and initial version of fix
submitted by SecBuddyF, Tencent KeenLab.

The submitted diff fixed the issue for failing look up by destination
address in outbound packet. dlg@ also pointed out the change should
be further improved so NULL pointer dereference is avoided when rule
uses nat-to/rdr-to option.

OK dlg@

Obtained from:	OpenBSD, sashan &lt;sashan@openbsd.org&gt;, f0f215c11e
Sponsored by:	Rubicon Communications, LLC ("Netgate")
</content>
</entry>
<entry>
<title>pf: include direction in fragment key</title>
<updated>2026-07-23T11:27:30Z</updated>
<author>
<name>Kristof Provost</name>
<email>kp@FreeBSD.org</email>
</author>
<published>2026-07-22T15:13:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=850041b025486614243fb2d481b3adb0382b02e7'/>
<id>urn:sha1:850041b025486614243fb2d481b3adb0382b02e7</id>
<content type='text'>
pf(4) currently ignores fragment direction (in vs. out)
in pf_frnode_compare() function.

Issue noticed and reported by Frank Denis

OK @bluhm

Obtained from:	OpenBSD, sashan &lt;sashan@openbsd.org&gt;, eaa2c80721
Sponsored by:	Rubicon Communications, LLC ("Netgate")
</content>
</entry>
<entry>
<title>pf: fix a crash on sendfile()</title>
<updated>2026-07-08T07:23:17Z</updated>
<author>
<name>KUROSAWA Takahiro</name>
<email>takahiro.kurosawa@gmail.com</email>
</author>
<published>2026-07-07T19:43:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8a14fcd23a201944f3eb5086403d10cfe1fc128f'/>
<id>urn:sha1:8a14fcd23a201944f3eb5086403d10cfe1fc128f</id>
<content type='text'>
The network layer must not pass unmapped (M_EXTPG) mbufs to if_output()
of network interfaces without IFCAP_MEXTPG. pf should convert these
mbufs by mb_unmapped_to_ext() for such interfaces but it didn't.
The problem had occurred on sendfile because sendfile system call
uses unmapped mbufs for the file data.

Reported by:	feld
Reviewed by:	kp, glebius
Differential Revision:	https://reviews.freebsd.org/D58021
</content>
</entry>
<entry>
<title>pf: revert netlink commands back to enum</title>
<updated>2026-07-06T19:41:25Z</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2026-07-06T19:41:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f01c509568f25c8003bf2b0c5f6fa008e5f8f810'/>
<id>urn:sha1:f01c509568f25c8003bf2b0c5f6fa008e5f8f810</id>
<content type='text'>
Revert pf_nl.h part of 017690e50913 and use new libsysdecode build glue
that parses enums.

Reviewed by:	kp, glebius
Differential Revision:	https://reviews.freebsd.org/D57866
</content>
</entry>
<entry>
<title>pflog: run VNET_SYSUNINIT in SI_SUB_PROTO_FIREWALL</title>
<updated>2026-06-30T13:57:41Z</updated>
<author>
<name>Kristof Provost</name>
<email>kp@FreeBSD.org</email>
</author>
<published>2026-06-29T14:05:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b8c6f5811b2a948a265a4bd90d33a18efb2a6f1e'/>
<id>urn:sha1:b8c6f5811b2a948a265a4bd90d33a18efb2a6f1e</id>
<content type='text'>
Suggested by:	pouria, glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
</content>
</entry>
<entry>
<title>pflog: create bpf tapping points without ifnet(9)</title>
<updated>2026-06-28T13:59:35Z</updated>
<author>
<name>Kristof Provost</name>
<email>kp@FreeBSD.org</email>
</author>
<published>2026-06-24T10:21:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e4f3ab161a9e149fd2f657f6d8af2ba3c618255f'/>
<id>urn:sha1:e4f3ab161a9e149fd2f657f6d8af2ba3c618255f</id>
<content type='text'>
Just as was done for ipfw's log device stop creating entire struct
ifnet's for pflog devices. Create only a bpf_t.

This does mean we lose the create/destroy infrastructure provided by the
clone interface. Rather than implement this ourselves we allow users to
configure the number of pflog interfaces using the net.pflog.if_count
sysctl. We default to 8 devices, but allow up to 256.

The /etc/rc.d/pflog script will create extra devices as required.

While it was possible to rename pflog devices pfctl expected the pflogX
name, so it's safe to assume users never did this.

Requested by:	glebius
Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D57851
</content>
</entry>
<entry>
<title>pflog: remove unused argument from pflogattach()</title>
<updated>2026-06-25T19:34:05Z</updated>
<author>
<name>Kristof Provost</name>
<email>kp@FreeBSD.org</email>
</author>
<published>2026-06-21T16:19:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=efcc183f9b0dad94b7e954556e6e2515ec0f85be'/>
<id>urn:sha1:efcc183f9b0dad94b7e954556e6e2515ec0f85be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ipfw/nat64: Fix type confusion panic when using wrong NAT64 instance type</title>
<updated>2026-06-22T22:15:36Z</updated>
<author>
<name>Teddy Engel</name>
<email>engel.teddy@gmail.com</email>
</author>
<published>2026-06-02T16:24:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2e6b22abf44d99b84abf17fe25ca2e8f89716c04'/>
<id>urn:sha1:2e6b22abf44d99b84abf17fe25ca2e8f89716c04</id>
<content type='text'>
Add etlv type validation to ipfw_nat64clat() and ipfw_nat64stl() to
verify that the retrieved instance is actually a nat64clat instance
before use.

All NAT64 instance types share the same srvstate[] array but have
different struct layouts.
Without type validation, using the wrong instance type with
a handler causes type confusion and kernel panic.

Signed-off-by:	Teddy Engel &lt;engel.teddy@gmail.com&gt;
PR:		292023
Reviewed by:	pouria
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2259
</content>
</entry>
<entry>
<title>pf: free match rules after exiting critical section</title>
<updated>2026-06-10T21:50:27Z</updated>
<author>
<name>Siva Mahadevan</name>
<email>siva@FreeBSD.org</email>
</author>
<published>2026-06-07T01:26:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=432ac5c07c6b1fb960f2e7d8e8cfb1306ce351ff'/>
<id>urn:sha1:432ac5c07c6b1fb960f2e7d8e8cfb1306ce351ff</id>
<content type='text'>
This fixes a panic reported on armv7:

sys/netpfil/pf/counters:match_block  -&gt;  panic: free: called with spinlock or critical section held
[...]
vpanic() at vpanic
	 pc = 0xc0321b5c  lr = 0xc02f7b5c (free+0x140)
	 sp = 0xc8c858bc  fp = 0xc8c858e0
	 r4 = 0xe2fad648  r5 = 0xe402ce78
	 r6 = 0xc8c859e8  r7 = 0x0000001c
	 r8 = 0xc8c858b4  r9 = 0xc0321b5c
	r10 = 0xc8c858bc
free() at free+0x140
	 pc = 0xc02f7b5c  lr = 0xe2f4f920 ($a+0x5f8)
	 sp = 0xc8c858e8  fp = 0xc8c85930
	 r4 = 0xe402ce68  r5 = 0xc8c8599c
	 r6 = 0xffffffff r10 = 0x0000001c
[...]
KDB: enter: panic

Consequently, this fixes armv7 CI:
https://ci.freebsd.org/job/FreeBSD-main-armv7-test/2287/consoleText

Fixes:	6353f5d9a5c6f194bb014b8785a57f5314e8c652
Reviewed by:	kp
MFC after:	3 days
</content>
</entry>
<entry>
<title>ipfw nat: Add assertion that mbuf is not a chain</title>
<updated>2026-06-08T20:47:24Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2026-06-05T21:00:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b16c731b0191d6c47de46a3c6057b0c5ec0dd420'/>
<id>urn:sha1:b16c731b0191d6c47de46a3c6057b0c5ec0dd420</id>
<content type='text'>
Discarding m_free's return value will result in an mbuf leak if the mbuf
was in a chain.

In general we should use m_freem if the mbuf may be in a chain, or
assert that the return was NULL.  There will not be a chain here due to
m_megapullup, so add an assert.

Reviewed by:	ae
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57479
</content>
</entry>
</feed>
