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
F163957524: D56501.id175916.diff
Mon, Jul 27, 11:27 AM
F163885995: D56501.id175906.diff
Sun, Jul 26, 9:50 PM
Unknown Object (File)
Sat, Jul 25, 4:42 PM
Unknown Object (File)
Fri, Jul 24, 10:41 PM
Unknown Object (File)
Thu, Jul 23, 3:22 AM
Unknown Object (File)
Wed, Jul 15, 7:18 AM
Unknown Object (File)
Wed, Jul 15, 7:18 AM
Unknown Object (File)
Jun 26 2026, 3:47 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 72369
Build 69252: arc lint + arc unit

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.