From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Ralf Lici <ralf@mandelbit.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
netdev@vger.kernel.org, ipsec@lists.linux.dev,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH ipsec v2 1/2] xfrm: advance the route generation when policies are removed
Date: Mon, 30 Nov 2026 11:08:21 +0100 [thread overview]
Message-ID: <2027ff78-c342-4ab2-a289-c343f0c4a457@6wind.com> (raw)
In-Reply-To: <3c91d1fc49e074fea1e87a7fdb8d4157fc42b342.1795797791.git.ralf@mandelbit.com>
Le 27/11/2026 à 17:48, Ralf Lici a écrit :> Only xfrm_policy_insert and
xfrm_set_default advance the IPv4 and IPv6
> route generations. Deleting, flushing or expiring a policy does not, so
> a route that a socket cached while an allow policy without templates
> matched its flow keeps validating after that policy is removed, and the
> socket keeps sending in plaintext although a policy requiring IPsec now
> matches. xfrm_policy_insert also advances the generation before
> unlinking the policy that the new one replaces, which can still be
> matched until then, since the new policy can be linked behind it.
>
> Advance the generation once a policy is unlinked by a delete or by its
> expiry, once after all policies are unlinked by a flush, and after the
> replaced policy is unlinked by an insert. Socket policies only apply to
> their own socket and are left out.
>
> Fixes: ee8372dd1989 ("xfrm: invalidate dst on policy insertion/deletion")
> Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
next prev parent reply other threads:[~2026-11-30 10:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 16:48 [PATCH ipsec v2 0/2] xfrm: advance the route generation when policies are removed Ralf Lici
2026-11-27 16:48 ` [PATCH ipsec v2 1/2] " Ralf Lici
2026-11-30 10:08 ` Nicolas Dichtel [this message]
2026-11-27 16:48 ` [PATCH ipsec v2 2/2] selftests: net: add a test for xfrm policy removal Ralf Lici
2026-11-30 10:14 ` Nicolas Dichtel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2027ff78-c342-4ab2-a289-c343f0c4a457@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=ipsec@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ralf@mandelbit.com \
--cc=shuah@kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox