aboutsummaryrefslogtreecommitdiff
path: root/include/grp.h
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2022-01-10 16:49:26 +0000
committerKristof Provost <kp@FreeBSD.org>2022-01-14 09:30:33 +0000
commit5f5e32f1b3945087a687c5962071d3f46e34e1ff (patch)
treea637ca69325b1723cf6a422738f4fa4efcc53395 /include/grp.h
parentaa108bc7c5c172b2aee140ce8b12f38194ab468e (diff)
downloadsrc-5f5e32f1b3945087a687c5962071d3f46e34e1ff.tar.gz
src-5f5e32f1b3945087a687c5962071d3f46e34e1ff.zip
pf: protect the rpool from races
The roundrobin pool stores its state in the rule, which could potentially lead to invalid addresses being returned. For example, thread A just executed PF_AINC(&rpool->counter) and immediately afterwards thread B executes PF_ACPY(naddr, &rpool->counter) (i.e. after the pf_match_addr() check of rpool->counter). Lock the rpool with its own mutex to prevent these races. The performance impact of this is expected to be low, as each rule has its own lock, and the lock is also only relevant when state is being created (so only for the initial packets of a connection, not for all traffic). See also: https://redmine.pfsense.org/issues/12660 Reviewed by: glebius MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33874
Diffstat (limited to 'include/grp.h')
0 files changed, 0 insertions, 0 deletions