HomeFreeBSD

pf: fix another endpoint-independent crash

Description

pf: fix another endpoint-independent crash

In c12013f5bb38 we fixed udp_mapping cleanup issues in pf_get_sport(), but
missed the static-port case (i.e. low == 0 && high == 0). We could still exit
pf_get_sport() without either inserting the udp_mapping or freeing it.

Address this and add a test case to provoke the problem.

Reviewed by: thj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D53856

Details

Provenance
kpAuthored on Nov 21 2025, 9:03 AM
Reviewer
thj
Differential Revision
D53856: pf: fix another endpoint-independent crash
Parents
rGd8bfcacd12ab: vm_fault: add a verifier that the PG_ZERO page is indeed zeroed
Branches
Unknown
Tags
Unknown