From: Steffen Klassert <steffen.klassert@secunet.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: Kyuwon Cho <kyuwoncho18@gmail.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>, Florian Westphal <fw@strlen.de>,
Hui Peng <benquike@gmail.com>, <netdev@vger.kernel.org>,
<ipsec@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH ipsec] xfrm: allow route optimization mode only for DSTOPTS and ROUTING states
Date: Tue, 24 Nov 2026 11:18:52 +0100 [thread overview]
Message-ID: <awVkjNfRV9ywdmGH@gauss4> (raw)
In-Reply-To: <awVjQipfDmyOZZtw@krikkit>
On Tue, Nov 24, 2026 at 11:13:22AM +0100, Sabrina Dubroca wrote:
> 2026-11-24, 16:08:56 +0900, Kyuwon Cho wrote:
> > verify_newsa_info() accepts XFRM_MODE_ROUTEOPTIMIZATION with any
> > protocol. esp6_init_state() treats a mode it does not know as
> > transport, so an ESP state in that mode is created, and the first
>
> nit: I'd say it doesn't really "treat" it as transport, it accepts
> everything and doesn't adjust header_len.
>
> > packet through it hits the WARN_ON_ONCE()s in xfrm_state_mtu() and
> > xfrm_inner_mode_input(), which assume that route optimization never
> > comes with ESP:
>
> Looking at the list of available modes (include/uapi/linux/xfrm.h),
> what about XFRM_MODE_IN_TRIGGER?
>
> > WARNING: net/xfrm/xfrm_state.c:3264 at xfrm_state_mtu+0x239/0x3d0
> > RIP: 0010:xfrm_state_mtu (net/xfrm/xfrm_state.c:3264)
> > Call Trace:
> > <TASK>
> > xfrm_bundle_create (net/xfrm/xfrm_policy.c:3992 net/xfrm/xfrm_policy.c:2785)
> > xfrm_resolve_and_create_bundle (net/xfrm/xfrm_policy.c:2885)
> > xfrm_lookup_with_ifid (net/xfrm/xfrm_policy.c:3114 net/xfrm/xfrm_policy.c:3245)
> > xfrm_lookup_route (net/xfrm/xfrm_policy.c:3344 net/xfrm/xfrm_policy.c:3355)
> > ip6_dst_lookup_flow (net/ipv6/ip6_output.c:1299)
> > udpv6_sendmsg (net/ipv6/udp.c:1699)
> >
> > WARNING: net/xfrm/xfrm_input.c:449 at xfrm_input+0x2176/0x5f50
> > RIP: 0010:xfrm_input (net/xfrm/xfrm_input.c:449 net/xfrm/xfrm_input.c:705)
> > Call Trace:
> > <IRQ>
> > xfrm6_esp_rcv (net/ipv6/xfrm6_protocol.c:119)
> > ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479)
> >
> > Accept the mode only for the Mobile IPv6 protocols, as IP-TFS mode is
> > already limited to ESP.
>
> This is reasonable, but I think we should instead (or maybe "also")
> add mode filtering to each ->init_state.
I suggested to do it this way, but we also can do it on both sides.
prev parent reply other threads:[~2026-11-24 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 7:08 [PATCH ipsec] xfrm: allow route optimization mode only for DSTOPTS and ROUTING states Kyuwon Cho
2026-11-24 10:13 ` Sabrina Dubroca
2026-11-24 10:18 ` Steffen Klassert [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=awVkjNfRV9ywdmGH@gauss4 \
--to=steffen.klassert@secunet.com \
--cc=benquike@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=ipsec@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=kyuwoncho18@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.