Page MenuHomeFreeBSD

pf :Use counter(9) in pf tables.
ClosedPublic

Authored by kp on Mar 12 2019, 12:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 5:16 AM
Unknown Object (File)
Sun, Dec 8, 4:31 AM
Unknown Object (File)
Nov 19 2024, 7:38 AM
Unknown Object (File)
Nov 14 2024, 4:11 PM
Unknown Object (File)
Oct 10 2024, 8:57 PM
Unknown Object (File)
Oct 2 2024, 2:34 PM
Unknown Object (File)
Sep 30 2024, 3:01 AM
Unknown Object (File)
Sep 21 2024, 4:27 PM

Details

Summary

The counters of pf tables are updated outside the rule lock. That means state
updates might overwrite each other. Furthermore allocation and
freeing of counters happens outside the lock as well.

Use counter(9) for the counters, and always allocate the counter table
element, so that the race condition cannot happen any more.

Submitted by: Kajetan Staszkiewicz <vegeta@tuxpowered.net>
PR: 230619

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp edited the summary of this revision. (Show Details)
glebius added a subscriber: glebius.
glebius added inline comments.
sys/netpfil/pf/pf_table.c
794 ↗(On Diff #54970)

Let's put a comment that previous allocation isn't leaked, since any failure of ​pfr_create_kentry_counter() is followed by pfr_destroy_kentry(ke).

This revision is now accepted and ready to land.Mar 12 2019, 9:35 PM
This revision now requires review to proceed.Mar 13 2019, 4:17 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 15 2019, 11:09 AM
Closed by commit rS345177: pf :Use counter(9) in pf tables. (authored by kp). · Explain Why
This revision was automatically updated to reflect the committed changes.