From: Steffen Klassert Date: Mon, 22 Feb 2016 09:56:45 +0000 (+0100) Subject: xfrm: Reset encapsulation field of the skb before transformation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=215276c0147ef49bc07692ca68bae35a30a64b9a;p=deliverable%2Flinux.git xfrm: Reset encapsulation field of the skb before transformation 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 --- diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index ff4a91fcab9f..637387bbaaea 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c @@ -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;