projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.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
|
blame
|
history
diff --git
a/net/netfilter/nfnetlink.c
b/net/netfilter/nfnetlink.c
index 13c2e17bbe279e6660a0a04fc804a6e1dd0a7707..c6619d4bcc32c7a5d8a3a1034ebfadb3cc7aa85c 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;
}