aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-11-01 15:01:10 +0800
committerBen Hutchings <ben@decadent.org.uk>2014-01-03 04:33:35 +0000
commitf7d537dc8714abf422238419d057376a772be9fd (patch)
tree0e224975582f2c6a5b4c0ac96d33c8f112ae64ef /net/core/dev.c
parentcc5285f4c67a48e5775d633267f8e284626a990a (diff)
downloadkernel_samsung_smdk4412-f7d537dc8714abf422238419d057376a772be9fd.zip
kernel_samsung_smdk4412-f7d537dc8714abf422238419d057376a772be9fd.tar.gz
kernel_samsung_smdk4412-f7d537dc8714abf422238419d057376a772be9fd.tar.bz2
net: flow_dissector: fail on evil iph->ihl
commit 6f092343855a71e03b8d209815d8c45bf3a27fcd upstream. We don't validate iph->ihl which may lead a dead loop if we meet a IPIP skb whose iph->ihl is zero. Fix this by failing immediately when iph->ihl is evil (less than 5). This issue were introduced by commit ec5efe7946280d1e84603389a1030ccec0a767ae (rps: support IPIP encapsulation). Cc: Eric Dumazet <edumazet@google.com> Cc: Petr Matousek <pmatouse@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> [bwh: Backported to 3.2: the affected code is in __skb_get_rxhash()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ecf5ea2..7bcf37d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2609,6 +2609,8 @@ ip:
goto done;
ip = (const struct iphdr *) (skb->data + nhoff);
+ if (ip->ihl < 5)
+ goto done;
if (ip_is_fragment(ip))
ip_proto = 0;
else