Skip to content

Commit 7e9e920

Browse files
ilantayariklassert
authored andcommitted
xfrm: Clear RX SKB secpath xfrm_offload
If an incoming packet undergoes XFRM crypto-offload, its secpath is filled with xfrm_offload struct denoting offload information. If the SKB is then forwarded to a device which supports crypto- offload, the stack wrongfully attempts to offload it (even though the output SA may not exist on the device) due to the leftover secpath xo. Clear the ingress xo by zeroizing secpath->olen just before delivering the decapsulated packet to the network stack. Fixes: d77e38e ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Ilan Tayari <ilant@mellanox.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent ffdb521 commit 7e9e920

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/xfrm/xfrm_input.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
424424
nf_reset(skb);
425425

426426
if (decaps) {
427+
skb->sp->olen = 0;
427428
skb_dst_drop(skb);
428429
gro_cells_receive(&gro_cells, skb);
429430
return 0;
@@ -434,6 +435,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
434435

435436
err = x->inner_mode->afinfo->transport_finish(skb, xfrm_gro || async);
436437
if (xfrm_gro) {
438+
skb->sp->olen = 0;
437439
skb_dst_drop(skb);
438440
gro_cells_receive(&gro_cells, skb);
439441
return err;

0 commit comments

Comments
 (0)