All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Kyuwon Cho <kyuwoncho18@gmail.com>
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>, 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:13:22 +0100	[thread overview]
Message-ID: <awVjQipfDmyOZZtw@krikkit> (raw)
In-Reply-To: <179550330841.535592.4607028415857424638@gmail.com>

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. Most already do it
(interestingly, ah6_init_state does but not ah_init_state, can AH4
also land in the same WARNs?), I think it's just ah4 and esp{4,6}
missing those.

-- 
Sabrina

  reply	other threads:[~2026-11-24 10:13 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 [this message]
2026-11-24 10:18   ` Steffen Klassert

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=awVjQipfDmyOZZtw@krikkit \
    --to=sd@queasysnail.net \
    --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=steffen.klassert@secunet.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 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.