Skip to content

Commit

Permalink
ah: Correctly pass error codes in ahash output callback.
Browse files Browse the repository at this point in the history
The AH4/6 ahash output callbacks pass nexthdr to xfrm_output_resume
instead of the error code.  This appears to be a copy+paste error from
the input case, where nexthdr is expected.  This causes the driver to
continuously add AH headers to the datagram until either an allocation
fails and the packet is dropped or the ahash driver hits a synchronous
fallback and the resulting monstrosity is transmitted.

Correct this issue by simply passing the error code unadulterated.

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nick Bowler authored and David S. Miller committed Nov 9, 2011
1 parent fecc735 commit 069294e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions net/ipv4/ah4.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ static void ah_output_done(struct crypto_async_request *base, int err)
memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
}

err = ah->nexthdr;

kfree(AH_SKB_CB(skb)->tmp);
xfrm_output_resume(skb, err);
}
Expand Down
2 changes: 0 additions & 2 deletions net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ static void ah6_output_done(struct crypto_async_request *base, int err)
#endif
}

err = ah->nexthdr;

kfree(AH_SKB_CB(skb)->tmp);
xfrm_output_resume(skb, err);
}
Expand Down

0 comments on commit 069294e

Please sign in to comment.