Skip to content

ipsec: fix splat due to ipcomp fallback tunnel

Sabrina Dubroca netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xfrm: delete x->tunnel as we delete xinclude/net/xfrm.h net/ipv4/ipcomp.c net/ipv6/ipcomp6.c +3 more+13 -140 replies
2/2Revert "xfrm: destroy xfrm_state synchronously on net exit path"include/net/xfrm.h net/ipv6/xfrm6_tunnel.c net/key/af_key.c +2 more+15 -260 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH ipsec 0/2] ipsec: fix splat due to ipcomp fallback tunnel

IPcomp tunnel states have an associated fallback tunnel, a keep a reference on the corresponding xfrm_state, to allow deleting that extra state when it's not needed anymore. These states cause issues during netns deletion.

Commit f75a2804da39 ("xfrm: destroy xfrm_state synchronously on net exit path") tried to address these problems but doesn't fully solve them, and slowed down netns deletion by adding one synchronize_rcu per deleted state.

The first patch solves the problem by moving the fallback state deletion earlier (when we delete the user state, rather than at destruction), then we can revert the previous fix.

Sabrina Dubroca (2):
xfrm: delete x->tunnel as we delete x
Revert "xfrm: destroy xfrm_state synchronously on net exit path"

 include/net/xfrm.h      | 13 +++----------
 net/ipv4/ipcomp.c       |  2 ++
 net/ipv6/ipcomp6.c      |  2 ++
 net/ipv6/xfrm6_tunnel.c |  2 +-
 net/key/af_key.c        |  2 +-
 net/xfrm/xfrm_ipcomp.c  |  1 -
 net/xfrm/xfrm_state.c   | 40 ++++++++++++++++------------------------
 net/xfrm/xfrm_user.c    |  2 +-
 8 files changed, 26 insertions(+), 38 deletions(-)
Signature · 1 line
2.50.0