xfrm: Reset encapsulation field of the skb before transformation
authorSteffen Klassert <steffen.klassert@secunet.com>
Mon, 22 Feb 2016 09:56:45 +0000 (10:56 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 17 Mar 2016 09:28:44 +0000 (10:28 +0100)
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>
net/xfrm/xfrm_output.c

index ff4a91f..637387b 100644 (file)
@@ -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;