mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
netfilter: nfnetlink_acct: validate NFACCT_FILTER parameters
commit 017b1b6d28 upstream.
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 <phil.turnbull@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c92b434e70
commit
a55ea87f70
@@ -243,6 +243,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);
|
||||
|
||||
Reference in New Issue
Block a user