Page MenuHomeFreeBSD

pf: Use MTX_DUPOK to initialize hash chain mutexes
ClosedPublic

Authored by markj on Apr 18 2026, 12:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 15, 1:16 AM
Unknown Object (File)
Thu, Jun 4, 5:00 PM
Unknown Object (File)
Thu, Jun 4, 4:32 PM
Unknown Object (File)
Wed, Jun 3, 10:23 PM
Unknown Object (File)
Thu, May 21, 11:23 AM
Unknown Object (File)
May 18 2026, 6:12 PM
Unknown Object (File)
May 18 2026, 11:32 AM
Unknown Object (File)
May 18 2026, 11:25 AM

Details

Summary

pf_udp_mapping_insert() may lock more than one row at a time.

Fixes: cd5ff4e841fb ("pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

glebius requested changes to this revision.Apr 18 2026, 6:58 PM

I screwed up, but not on this hash. Looking at cd5ff4e841fb I see that I lost MTX_DUPOK on UDP endpoint hash.

This revision now requires changes to proceed.Apr 18 2026, 6:58 PM
sys/netpfil/pf/pf.c
1499–1500

Should be here!

I did see a warning about that recently but didn't investigate too much. This (with Gleb's remark) makes sense.

sys/netpfil/pf/pf.c
1500

That wants to be 'lopts', not 'lops'.

markj marked an inline comment as done.

Typo

This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2026, 4:50 PM
This revision was automatically updated to reflect the committed changes.