Skip to content

Commit

Permalink
xfrm: Reset encapsulation field of the skb before transformation
Browse files Browse the repository at this point in the history
The inner headers are invalid after a xfrm transformation.
So reset the skb encapsulation field to ensure nobody tries
to access the inner headers.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
Steffen Klassert committed Mar 17, 2016
1 parent 6ad3122 commit 215276c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/xfrm/xfrm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)

skb_dst_force(skb);

/* Inner headers are invalid now. */
skb->encapsulation = 0;

err = x->type->output(x, skb);
if (err == -EINPROGRESS)
goto out;
Expand Down

0 comments on commit 215276c

Please sign in to comment.