summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2016-02-22 10:56:45 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2016-03-17 10:28:44 +0100
commit215276c0147ef49bc07692ca68bae35a30a64b9a (patch)
tree9076597df2a33a6bbd324953429c20819fd5d591
parentflowcache: Avoid OOM condition under preasure (diff)
downloadlinux-215276c0147ef49bc07692ca68bae35a30a64b9a.tar.xz
linux-215276c0147ef49bc07692ca68bae35a30a64b9a.zip
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 <steffen.klassert@secunet.com>
-rw-r--r--net/xfrm/xfrm_output.c3
1 files changed, 3 insertions, 0 deletions
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;