Skip to content

Commit 215276c

Browse files
committed
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 <[email protected]>
1 parent 6ad3122 commit 215276c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/xfrm/xfrm_output.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
9999

100100
skb_dst_force(skb);
101101

102+
/* Inner headers are invalid now. */
103+
skb->encapsulation = 0;
104+
102105
err = x->type->output(x, skb);
103106
if (err == -EINPROGRESS)
104107
goto out;

0 commit comments

Comments
 (0)