Page MenuHomeFreeBSD

pf: Fix table entry counter toggling
ClosedPublic

Authored by markj on Dec 1 2020, 6:39 PM.
Tags
None
Referenced Files
F173534077: D27440.diff
Sat, Sep 26, 4:20 PM
Unknown Object (File)
Thu, Sep 17, 8:50 AM
Unknown Object (File)
Sun, Sep 6, 8:21 PM
Unknown Object (File)
Thu, Sep 3, 12:59 PM
Unknown Object (File)
Aug 27 2026, 6:45 PM
Unknown Object (File)
Aug 25 2026, 11:18 AM
Unknown Object (File)
Aug 25 2026, 11:12 AM
Unknown Object (File)
Aug 14 2026, 11:29 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 Not Applicable
Unit
Tests Not Applicable