]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Cope with overly large net.pf.states_hashsize
authorKristof Provost <kp@FreeBSD.org>
Sun, 25 Feb 2018 08:56:44 +0000 (08:56 +0000)
committerKristof Provost <kp@FreeBSD.org>
Sun, 25 Feb 2018 08:56:44 +0000 (08:56 +0000)
commitbf56a3fe47ef43441c098ef11d553fb5ce78673a
treed42a097c12869eb405601bff568b4741bd2a0c1f
parent22ae8ae1f47f1aefa5e15213eedf159a5e697560
pf: Cope with overly large net.pf.states_hashsize

If the user configures a states_hashsize or source_nodes_hashsize value we may
not have enough memory to allocate this. This used to lock up pf, because these
allocations used M_WAITOK.

Cope with this by attempting the allocation with M_NOWAIT and falling back to
the default sizes (with M_WAITOK) if these fail.

PR: 209475
Submitted by: Fehmi Noyan Isi <fnoyanisi AT yahoo.com>
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D14367
sys/net/pfvar.h
sys/netpfil/pf/pf.c