ipv6: udp: fix the wrong headroom check
Subsystems (3)
PATCH 1/1 ipv6: udp: fix the wrong headroom check
At this point, skb->data points to skb_transport_header. So, headroom check is wrong.
For some case:bridge(UFO is on) + eth device(UFO is off), there is no enough headroom for IPv6 frag head. But headroom check is always false.
This will bring about data be moved to there prior to skb->head, when adding IPv6 frag header to skb.
--- net/ipv6/udp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv6/udp.c +1 -1
@@ -1335,7 +1335,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features) skb->ip_summed =CHECKSUM_NONE ;/* Check if there is enough headroom to insert fragment header. */ -if ((skb_headroom (skb) < frag_hdr_sz) && +if ((skb_mac_header (skb) < skb->head + frag_hdr_sz) &&pskb_expand_head (skb, frag_hdr_sz,0 ,GFP_ATOMIC )) goto out;
Signature · 1 line
1.6.3.3
Quoted 11 lines · Shan Wei
At this point,
skb->datapoints toskb_transport_header. So, headroom check is wrong.For some case:bridge(UFO is on) + eth device(UFO is off), there is no enough headroom for IPv6 frag head. But headroom check is always false.
This will bring about data be moved to there prior to
skb->head, when adding IPv6 frag header to skb.Signed-off-by Shan Wei <[email protected]>
Ouch.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
From: Herbert Xu <[email protected]>
Date: Wed, 20 Apr 2011 18:50:07 +0800
Quoted 8 lines · Shan Wei
Quoted 7 lines
At this point,
skb->datapoints toskb_transport_header. So, headroom check is wrong.For some case:bridge(UFO is on) + eth device(UFO is off), there is no enough headroom for IPv6 frag head. But headroom check is always false.
Quoted 8 lines
Quoted 4 lines
This will bring about data be moved to there prior to
skb->head, when adding IPv6 frag header to skb.Signed-off-by Shan Wei <[email protected]>Ouch.
Acked-by Herbert Xu <[email protected]>
Applied, thanks.