projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ca3f5e
)
netfilter: nfnetlink: validate nfnetlink header from batch
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Sun, 4 Jan 2015 14:20:29 +0000
(15:20 +0100)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Tue, 6 Jan 2015 21:27:46 +0000
(22:27 +0100)
Make sure there is enough room for the nfnetlink header in the
netlink messages that are part of the batch. There is a similar
check in netlink_rcv_skb().
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nfnetlink.c
b/net/netfilter/nfnetlink.c
index
13c2e17
..
c6619d4
100644
(file)
--- a/
net/netfilter/nfnetlink.c
+++ b/
net/netfilter/nfnetlink.c
@@
-321,7
+321,8
@@
replay:
nlh = nlmsg_hdr(skb);
err = 0;
- if (nlh->nlmsg_len < NLMSG_HDRLEN) {
+ if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) ||
+ skb->len < nlh->nlmsg_len) {
err = -EINVAL;
goto ack;
}