projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cec5913
)
netfilter: nfnetlink_acct: validate NFACCT_QUOTA parameter
author
Phil Turnbull
<
[email protected]
>
Tue, 3 May 2016 20:39:19 +0000
(16:39 -0400)
committer
Pablo Neira Ayuso
<
[email protected]
>
Thu, 5 May 2016 14:47:08 +0000
(16:47 +0200)
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 <
[email protected]
>
Signed-off-by: Pablo Neira Ayuso <
[email protected]
>
net/netfilter/nfnetlink_acct.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nfnetlink_acct.c
b/net/netfilter/nfnetlink_acct.c
index 4c2b4c0c4d5fa4ac209ab85020e97e14ed716ab9..dbd0803b18273bbf3b37e7f0f5bfae87d5acfc2d 100644
(file)
--- a/
net/netfilter/nfnetlink_acct.c
+++ b/
net/netfilter/nfnetlink_acct.c
@@
-96,6
+96,8
@@
static int nfnl_acct_new(struct net *net, struct sock *nfnl,
return -EINVAL;
if (flags & NFACCT_F_OVERQUOTA)
return -EINVAL;
+ if ((flags & NFACCT_F_QUOTA) && !tb[NFACCT_QUOTA])
+ return -EINVAL;
size += sizeof(u64);
}