summaryrefslogtreecommitdiff
path: root/net/ipv4/ipcomp.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2025-07-14 08:59:48 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2025-07-14 08:59:48 +0200
commit28712d6ed32028b0f2e0defe6681411496971ca3 (patch)
tree840afec7451b11d9d799e83f4992943f4fac2a8d /net/ipv4/ipcomp.c
parenta90b2a1aaacbcf0f91d7e4868ad6c51c5dee814b (diff)
parent2a198bbec6913ae1c90ec963750003c6213668c7 (diff)
Merge branch 'ipsec: fix splat due to ipcomp fallback tunnel'
Sabrina Dubroca says: ==================== 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. ==================== Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4/ipcomp.c')
-rw-r--r--net/ipv4/ipcomp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 5a4fb2539b08..9a45aed508d1 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -54,6 +54,7 @@ static int ipcomp4_err(struct sk_buff *skb, u32 info)
}
/* We always hold one tunnel user reference to indicate a tunnel */
+static struct lock_class_key xfrm_state_lock_key;
static struct xfrm_state *ipcomp_tunnel_create(struct xfrm_state *x)
{
struct net *net = xs_net(x);
@@ -62,6 +63,7 @@ static struct xfrm_state *ipcomp_tunnel_create(struct xfrm_state *x)
t = xfrm_state_alloc(net);
if (!t)
goto out;
+ lockdep_set_class(&t->lock, &xfrm_state_lock_key);
t->id.proto = IPPROTO_IPIP;
t->id.spi = x->props.saddr.a4;