Netdev List
 help / color / mirror / Atom feed
From: Ralf Lici <ralf@mandelbit.com>
To: netdev-bot+sinfo@kernel.org
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH ipsec] xfrm: advance the route generation when policies are removed
Date: Thu, 26 Nov 2026 12:32:16 +0100	[thread overview]
Message-ID: <20261126113216.337964-1-ralf@mandelbit.com> (raw)
In-Reply-To: <179569192472.3294.16207945676550617931@kernel.org>

On Thu, 26 Nov 2026 11:18:44 +0000, netdev-bot+sinfo@kernel.org wrote:
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
>  - Whether the issue was actually triggered, or is only theoretical
>    (e.g. found by LLM and not proven at runtime). If it was triggered
>    please include the symptoms, like the stack trace or kernel messages.
>

Yes, the policy removal cases were triggered at runtime, in a VM test
setup (not observed in production AFAIK).

There is no kernel message, the symptom is plaintext on the wire. A
connected UDP socket keeps sending unencrypted datagrams after the allow
policy that exempted its flow is removed, although the ESP policy below
it now matches.

This is roughly the setup, in a netns with a veth pair (IPv4 is the
same):

  ip xfrm state add src fd00::1 dst fd01::2 proto esp spi 0x1001 \
  	reqid 1 mode transport aead 'rfc4106(gcm(aes))' <key> 128
  ip xfrm policy add src fd00::1 dst fd01::2 dir out priority 100 \
	tmpl src fd00::1 dst fd01::2 proto esp reqid 1 mode transport
  ip xfrm policy add src fd00::1 dst fd01::2 proto udp dport 5002 \
	dir out priority 10 action allow

A UDP socket connected to [fd01::2]:5002 sends one datagram, the allow
policy is removed, then the socket sends 10 more, captured on the veth:

  removal               net-next             ipsec + this patch
  delete by selector    10 plain, 0 ESP      0 plain, 10 ESP
  delete by index       10 plain, 0 ESP      0 plain, 10 ESP
  hard time expiry      10 plain, 0 ESP      0 plain, 10 ESP
  flush                 10 plain             nothing sent

The flush case replaces the ESP policy with "ip xfrm policy setdefault
out block", so that nothing may be sent once the policies are flushed.

The xfrm_policy_insert ordering is a race between the insert and a
concurrent lookup, found by code reading. That I did not reproduce at
runtime.

I can share the reproducer script if useful.

Thanks,

-- 
Ralf Lici
Mandelbit Srl

      reply	other threads:[~2026-11-26 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 11:14 [PATCH ipsec] xfrm: advance the route generation when policies are removed Ralf Lici
2026-11-26 11:18 ` netdev-bot+sinfo
2026-11-26 11:32   ` Ralf Lici [this message]

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=20261126113216.337964-1-ralf@mandelbit.com \
    --to=ralf@mandelbit.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sinfo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --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