netfilter: nfnetlink_acct: validate NFACCT_QUOTA parameter
[ Upstream commit eda3fc50daa93b08774a18d51883c5a5d8d85e15 ] If a quota bit is set in NFACCT_FLAGS but the NFACCT_QUOTA parameter is missing then a NULL pointer dereference is triggered. 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ebb9ffd10a
commit
68e3b4e85a
1 changed files with 2 additions and 0 deletions
|
@ -97,6 +97,8 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
|
|||
return -EINVAL;
|
||||
if (flags & NFACCT_F_OVERQUOTA)
|
||||
return -EINVAL;
|
||||
if ((flags & NFACCT_F_QUOTA) && !tb[NFACCT_QUOTA])
|
||||
return -EINVAL;
|
||||
|
||||
size += sizeof(u64);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue