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-Tag: v4.14-rc1~3321^2~20^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=215276c0147ef49bc07692ca68bae35a30a64b9a;p=platform%2Fkernel%2Flinux-rpi.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 ff4a91f..637387b 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;