Page MenuHomeFreeBSD

pf: Fix table entry counter toggling
ClosedPublic

Authored by markj on Dec 1 2020, 6:39 PM.
Tags
None
Referenced Files
F111876564: D27440.id80230.diff
Sun, Mar 9, 4:50 PM
F111846610: D27440.diff
Sun, Mar 9, 5:45 AM
Unknown Object (File)
Feb 4 2025, 3:35 AM
Unknown Object (File)
Jan 21 2025, 1:46 AM
Unknown Object (File)
Jan 17 2025, 1:51 PM
Unknown Object (File)
Jan 17 2025, 1:32 PM
Unknown Object (File)
Jan 17 2025, 6:06 AM
Unknown Object (File)
Dec 10 2024, 5:03 AM

Details

Summary

When updating a table, pf will keep table entry structures corresponding
to addresses that are in both of the old and new tables. However, the
update may also enable or disable per-entry counters which are allocated
separately. Thus when toggling PFR_TFLAG_COUNTERS, the entries may be
missing counters or may have unused counters allocated.

Fix the problem by modifying pfr_ina_commit() to transfer counters
from or to the shadow table.

Reported by: sigsys@gmail.com

Test Plan

Regression tests pass. I will write a test case for this if the code change seems ok.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35145
Build 32098: arc lint + arc unit