提交 eda3fc50 编写于 作者: P Phil Turnbull 提交者: Pablo Neira Ayuso

netfilter: nfnetlink_acct: validate NFACCT_QUOTA parameter

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: NPhil Turnbull <phil.turnbull@oracle.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 cec5913c
...@@ -96,6 +96,8 @@ static int nfnl_acct_new(struct net *net, struct sock *nfnl, ...@@ -96,6 +96,8 @@ static int nfnl_acct_new(struct net *net, struct sock *nfnl,
return -EINVAL; return -EINVAL;
if (flags & NFACCT_F_OVERQUOTA) if (flags & NFACCT_F_OVERQUOTA)
return -EINVAL; return -EINVAL;
if ((flags & NFACCT_F_QUOTA) && !tb[NFACCT_QUOTA])
return -EINVAL;
size += sizeof(u64); size += sizeof(u64);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册