Page MenuHomeFreeBSD

ipfw: add protected rule for orphaned dynamic states
ClosedPublic

Authored by ae on Jul 22 2025, 8:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 1:07 PM
Unknown Object (File)
Sat, Oct 11, 7:26 AM
Unknown Object (File)
Sat, Oct 11, 7:26 AM
Unknown Object (File)
Sat, Oct 11, 7:26 AM
Unknown Object (File)
Sat, Oct 11, 12:09 AM
Unknown Object (File)
Fri, Oct 3, 1:21 PM
Unknown Object (File)
Fri, Oct 3, 5:10 AM
Unknown Object (File)
Fri, Oct 3, 1:37 AM

Details

Summary

When we have enabled V_dyn_keep_states, states that become ORPHANED
will keep pointer to original rule. Then this rule pointer is used
to apply rule action after ipfw_dyn_lookup_state().
Some rule actions use IPFW_INC_RULE_COUNTER() directly to this rule
pointer, but other actions use chain->map[f_pos] instead. The last
case leads to incrementing counters on the wrong rule, because
ORPHANED states have not parent rule in chain->map[].
To solve this we add protected rule, that will be matched only by
packets that are handled by ORPHANED states.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 65613
Build 62496: arc lint + arc unit

Event Timeline

ae held this revision as a draft.
ae published this revision for review.Jul 22 2025, 8:21 AM
ae added reviewers: glebius, melifaro, zlei.
This revision was not accepted when it landed; it landed in state Needs Review.Aug 3 2025, 10:08 AM
This revision was automatically updated to reflect the committed changes.