netfilter: nfnetlink_acct: validate NFACCT_FILTER parameters
Subsystems (2)
PATCH 1/1 netfilter: nfnetlink_acct: validate NFACCT_FILTER parameters
nfacct_filter_alloc doesn't validate the NFACCT_FILTER_MASK and NFACCT_FILTER_VALUE parameters which can trigger a NULL pointer dereference. CAP_NET_ADMIN is required to trigger the bug.
Signed-off-by Phil Turnbull <[email protected]>
--- net/netfilter/nfnetlink_acct.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nfnetlink_acct.c +3 -0
@@ -242,6 +242,9 @@ nfacct_filter_alloc(const struct nlattr * const attr)if (err <0 )return ERR_PTR (err); +if (!tb[NFACCT_FILTER_MASK ] || !tb[NFACCT_FILTER_VALUE ]) +return ERR_PTR (-EINVAL ); + filter =kzalloc (sizeof (struct nfacct_filter ),GFP_KERNEL );if (!filter)return ERR_PTR (-ENOMEM );
Signature · 1 line
1.9.1
Quoted 3 lines · Phil Turnbull
nfacct_filter_allocdoesn't validate theNFACCT_FILTER_MASKandNFACCT_FILTER_VALUEparameters which can trigger a NULL pointer dereference.CAP_NET_ADMINis required to trigger the bug.
Applied, thanks.
I have enqueued this to -stable: 3.18, 4.1 and 4.4