Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2018 09:46:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-pf@FreeBSD.org
Subject:   [Bug 209475] pf didn't check if enough free RAM for net.pf.states_hashsize
Message-ID:  <bug-209475-17777-jk2TGFkvg6@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209475-17777@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209475-17777@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209475

--- Comment #13 from Kristof Provost <kp@freebsd.org> ---
(In reply to fehmi noyan isi from comment #12)
Yes, that's probably one of them.

There are a couple of allocations in pf_initialize() and they all use M_WAITOK.

I do see why, because it's non-trivial to cope with allocation failures in that
part of the code. It gets called from a VNET_SYSINIT(), so it doesn't have a
reasonable way of aborting the initialisation.

As an aside, the allocations should probably be changed to use mallocarray()
too, because the multiplication they do (pf_hashsize * sizeof(pf_idhash) for
example) might overflow. pf_hashsize can be set by the user (although only
root, because it's a sysctl, fortunately), so we must verify it won't overflow
before trying to allocate it.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209475-17777-jk2TGFkvg6>