net: flow_dissector: fail on evil iph->ihl
Subsystems (2)
PATCH 1/1 net: flow_dissector: fail on evil iph->ihl
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).
---
This patch is needed for stable.
--- net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/flow_dissector.c +1 -1
@@ -40,7 +40,7 @@ again:struct iphdr _iph; ip: iph =skb_header_pointer (skb, nhoff,sizeof (_iph), &_iph); -if (!iph) +if (!iph || iph->ihl <5 )return false;if (ip_is_fragment (iph))
Signature · 1 line
1.8.1.2
Quoted 7 lines · Jason Wang
We don't validate
iph->ihlwhich may lead a dead loop if we meet a IPIP skb whoseiph->ihlis zero. Fix this by failing immediately wheniph->ihlis evil (less than 5).This issue were introduced by commit
ec5efe7946280d1e84603389a1030ccec0a767ae(rps: support IPIP encapsulation).
Quoted 8 lines
Cc Eric Dumazet <[email protected]>Cc Petr Matousek <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Jason Wang <[email protected]>---
This patch is needed for stable.
---
Thanks Jason !
Quoted 6 lines · Jason Wang
We don't validate
iph->ihlwhich may lead a dead loop if we meet a IPIP skb whoseiph->ihlis zero. Fix this by failing immediately wheniph->ihlis evil (less than 5).This issue were introduced by commit
ec5efe7946280d1e84603389a1030ccec0a767ae(rps: support IPIP encapsulation).
It would be helpful to include the CVE ID here:
CVE-2013-4348
Ben.
Quoted 24 lines
Cc Eric Dumazet <[email protected]>Cc Petr Matousek <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Jason Wang <[email protected]>---
This patch is needed for stable.--- net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/flow_dissector.c +1
-1@@ -40,7 +40,7 @@ again:struct iphdr _iph; ip: iph =skb_header_pointer (skb, nhoff,sizeof (_iph), &_iph); -if (!iph) +if (!iph || iph->ihl <5 )return false;if (ip_is_fragment (iph))
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerFrom: Jason Wang <[email protected]>
Date: Fri, 1 Nov 2013 15:01:10 +0800
Quoted 4 lines
We don't validate
iph->ihlwhich may lead a dead loop if we meet a IPIP skb whoseiph->ihlis zero. Fix this by failing immediately wheniph->ihlis evil (less than 5).
Quoted 8 lines
This issue were introduced by commit
ec5efe7946280d1e84603389a1030ccec0a767ae(rps: support IPIP encapsulation).Cc Eric Dumazet <[email protected]>Cc Petr Matousek <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Jason Wang <[email protected]>
Applied and queued up for -stable, thanks Jason.
Quoted 4 lines · Jason Wang
We don't validate
iph->ihlwhich may lead a dead loop if we meet a IPIP skb whoseiph->ihlis zero. Fix this by failing immediately wheniph->ihlis evil (less than 5).
Quoted 8 lines
This issue were introduced by commit
ec5efe7946280d1e84603389a1030ccec0a767ae(rps: support IPIP encapsulation).Cc Eric Dumazet <[email protected]>Cc Petr Matousek <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Jason Wang <[email protected]>
Quoted 21 lines
---
This patch is needed for stable.--- net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/flow_dissector.c +1
-1@@ -40,7 +40,7 @@ again:struct iphdr _iph; ip: iph =skb_header_pointer (skb, nhoff,sizeof (_iph), &_iph); -if (!iph) +if (!iph || iph->ihl <5 )return false;if (ip_is_fragment (iph))Signature · 1 line
1.8.1.2
Quoted 4 lines · Jason Wang
We don't validate
iph->ihlwhich may lead a dead loop if we meet a IPIP skb whoseiph->ihlis zero. Fix this by failing immediately wheniph->ihlis evil (less than 5).
Quoted 8 lines
This issue were introduced by commit
ec5efe7946280d1e84603389a1030ccec0a767ae(rps: support IPIP encapsulation).Cc Eric Dumazet <[email protected]>Cc Petr Matousek <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Jason Wang <[email protected]>
Sorry, a bit late as I was offline last 4 days, but fwiw: