aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ah6.c
diff options
context:
space:
mode:
authorNick Bowler <nbowler@elliptictech.com>2011-11-08 07:12:45 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-09 15:55:53 -0500
commitb7ea81a58adc123a4e980cb0eff9eb5c144b5dc7 (patch)
tree4f4b2aeef8f66763cc48dccb7aef505f96601047 /net/ipv6/ah6.c
parent069294e813ed5f27f82613b027609bcda5f1b914 (diff)
ah: Read nexthdr value before overwriting it in ahash input callback.
The AH4/6 ahash input callbacks read out the nexthdr field from the AH header *after* they overwrite that header. This is obviously not going to end well. Fix it up. Signed-off-by: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ah6.c')
-rw-r--r--net/ipv6/ah6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index ede4d9d6cc2b..7a33aaa00227 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -464,12 +464,12 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
464 if (err) 464 if (err)
465 goto out; 465 goto out;
466 466
467 err = ah->nexthdr;
468
467 skb->network_header += ah_hlen; 469 skb->network_header += ah_hlen;
468 memcpy(skb_network_header(skb), work_iph, hdr_len); 470 memcpy(skb_network_header(skb), work_iph, hdr_len);
469 __skb_pull(skb, ah_hlen + hdr_len); 471 __skb_pull(skb, ah_hlen + hdr_len);
470 skb_set_transport_header(skb, -hdr_len); 472 skb_set_transport_header(skb, -hdr_len);
471
472 err = ah->nexthdr;
473out: 473out:
474 kfree(AH_SKB_CB(skb)->tmp); 474 kfree(AH_SKB_CB(skb)->tmp);
475 xfrm_input_resume(skb, err); 475 xfrm_input_resume(skb, err);