HomeFreeBSD

pf: bound DIOCGETSTATESV2 memory use

Description

pf: bound DIOCGETSTATESV2 memory use

Rather than allocating however much memory userspace asks for we only
allocate enough for a handful of states, and copy to userspace for each
completed row.
We start out with enough space for 16 states (per row), but grow that as
required. In most configurations we expect at most a handful of states
per row (more than that would have other negative effects on packet
processing performance).

Reviewed by: mjg
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31111

Details

Provenance
kpAuthored on Jul 8 2021, 1:01 PM
Reviewer
mjg
Differential Revision
D31111: pf: bound DIOCGETSTATESV2 memory use
Parents
rGbe70c7a50d32: libpfctl: migrate to DIOCGETSTATESV2
Branches
Unknown
Tags
Unknown