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
F175851790: D56501.id175906.diff
Tue, Oct 13, 9:39 PM
F175796309: D56501.id175832.diff
Tue, Oct 13, 10:33 AM
Unknown Object (File)
Mon, Oct 12, 9:59 AM
Unknown Object (File)
Mon, Oct 12, 9:57 AM
Unknown Object (File)
Sun, Oct 11, 9:21 AM
Unknown Object (File)
Sun, Oct 11, 7:51 AM
Unknown Object (File)
Fri, Oct 9, 3:14 AM
Unknown Object (File)
Fri, Oct 9, 3:14 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 72371
Build 69254: 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.