🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21689

Re: [PATCH ipsec] xfrm: allow route optimization mode only for DSTOPTS and ROUTING states

#21689
From: Steffen Klassert
Date: Tue, 24 Nov 2026 10:18
42 lines
11315 bytes
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.
Technical Details
Message-ID: <awVkjNfRV9ywdmGH@gauss4>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370217-linux-kernel-netdev=dewy.ru
References: <179550330841.535592.4607028415857424638@gmail.com> <awVjQipfDmyOZZtw@krikkit>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370217-linux-kernel-netdev=dewy.ru
From: steffen.klassert@secunet.com (Steffen Klassert)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH ipsec] xfrm: allow route optimization mode only for
 DSTOPTS and ROUTING states
Date: Tue, 24 Nov 2026 11:18:52 +0100
Organization: Usenet Network
Message-ID: <awVkjNfRV9ywdmGH@gauss4>
References: <179550330841.535592.4607028415857424638@gmail.com>
 <awVjQipfDmyOZZtw@krikkit>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Injection-Info: usenet.network;
	logging-data="4110130"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cpaDZyC5CW4Y3Mw9ySK3aQYtVQQ= sha256:bzC7ie8dblFw+xbDz+CrEny4yTAWLY9qOME4CMax8gY=
	sha1:f6p+tJ3blyEWKwaSicWJrduYyaw= sha256:lfDdbScuMn6KfsNdilct7/Dzyxr1vk4J5zbYTx1ndAY=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B8800125DF1; Tue, 24 Nov 2026 13:19:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=secunet.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9f2rkowVWgUn;
	Tue, 24 Nov 2026 13:19:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370217-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=secunet.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 35758125DF0; Tue, 24 Nov 2026 13:19:08 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 9E4283A8B4; Tue, 24 Nov 2026 10:19:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795515545;
	b=IJzGRpUwg/AwQ1OG4xr6NAfmidAY2amVjkfJCTVuMfAqyIEehQ1Eqk6VrPGMpJtjTHiO
	 k8KfBxkK1ch+usYFwA89Y3EYe66OsE8RftrPadKSm7D6YOgJVA3P0LjQttzjh+01HrFIN
	 fovjJpzJiFh67KVSRrdSktwD0vAfN8hD0+JxnZeqznqcS/F/sGSnLYiF9XVquRIjBXy9P
	 K+uZgcPKviSAxgU+hcBDe+kgkytsxmhqw+vym9wg6mqiGV5YLTi4pw9WtRMe9+2n9HSRf
	 FIs1PPbU8XAQnq07AVp/g6Cz/ZMzrB+GWSHPe2WHPq1xNViTYw4Ptlv/vaKZxqAJwhg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795515545;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned:
	 Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:Date:
	 From:To:CC:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:
	 X-ClientProxiedBy;
	bh=vfv4q0//GszER/ZnpatsxtYNRtVSogmhUjUu6NcShzY=;
	b=AXluxkktc/c/SDVz8enubOkrotE19Fc5dG9ln4c6Oxx01fP0xD8VK0i6ApvjVKMKVZCg
	 dMSB05v4NQGPAh8qqxF+XfGYhkyWLaxhYS+nF+1GOm7FU02aznDDoAfnA7NDzaJHgheW2
	 T2aVtvOTNp7wH8hP197EXq8cBDDvgMPkdWhHMFTKOGVydmRY82v+A9D2w5kvSBc8j+At8
	 f9q0A+LMD5+FcBYz4lpTKEPmDcyHFCjyu8Zp8PQFB+e5shLnqfV3zSlG3FItqVf7Typvg
	 aci7dA5fwrZZaBXn3F55GqomdzCN8wbF2Xk/jjafuj3+NLLKpBVqb6BkavIt/ObQ9Vg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=bW5WUsXI;
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 75162606A327;
	Tue, 24 Nov 2026 10:19:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=bW5WUsXI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795515539;
	b=CP4YN1cTLEoulswlRYAz2AUFp1s2sY6m7nydt7AfY7fcpEmscBhZ9MD1go+GWoM2TrGn
	 wPXNmrYFobr5Xt08l3CNlAVtjUEL+W2pQMZ30hS+d829bpLC9xFDlfOEhVW6lkvReXJDy
	 Ba6HfbT4kC3yHNG94bKTdvZOkrVg/1g0YohVs5OlLCVCDkN3rzTEz/R0C3pRBujZOJty+
	 3Dx4hrCoo+q2qW0ebY/GQ8j/YwRjnaUSaDTUM0cI7keAvySfXFIV6y+rh+jMoQZVon1Qn
	 5P0RXr3qzAFyd1mG92n0hu2ai9ddYWQD422l4cwkJiepBLnnxj/buMa+fe+4jpcFgeA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795515539;
	h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter:
	 DKIM-Signature:Received:Received:Date:From:To:CC:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:
	 X-ClientProxiedBy;
	bh=vfv4q0//GszER/ZnpatsxtYNRtVSogmhUjUu6NcShzY=;
	b=RsMHrbD695Knu7+xHUhyIcdqT4jDcro59b6Io8Sp0AWHf4lt9+jCDZ3CG5SaekxtA67K
	 I9OXtPlNubkfN8fUbTXJqvyEhpRa/9cJMccyJjjF6OSTBUZCMbABMNRbPqdPxwaMTlMrJ
	 xYml4SKvvrgEk3iCXvDad08slSOZucONNTLRz58WJCexKA9sD1da8DaTdTgraoovqY3xs
	 JIg0yKL2pijuSB2+bDf9JNBCOrzmvyldyL8tCShvAxH1kr6TuoSMFid7EtJSMEww1tr8g
	 4Lu6aXqFxE2fojYHFWYYRFVyzJw550Umt/yPurIHdt/xhH8BqFoTnvIa7JiANUfnv8Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=bW5WUsXI;
	arc=none smtp.remote-ip=62.96.220.36
X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C44D606A321;
	Tue, 24 Nov 2026 10:18:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C44D606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com
X-Received: from localhost (localhost [127.0.0.1])
	by mx1.secunet.com (Postfix) with ESMTP id 2AAE520704;
	Tue, 24 Nov 2026 11:18:56 +0100 (CET)
X-Virus-Scanned: by secunet
X-Received: from mx1.secunet.com ([127.0.0.1])
 by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id CMbiIDYVN85C; Tue, 24 Nov 2026 11:18:55 +0100 (CET)
X-Received: from EXCH-01.secunet.de (rl1.secunet.de [10.32.0.231])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.secunet.com (Postfix) with ESMTPS id 841A6201E5;
	Tue, 24 Nov 2026 11:18:55 +0100 (CET)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 841A6201E5
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com;
	s=202301; t=1795515535;
	bh=vfv4q0//GszER/ZnpatsxtYNRtVSogmhUjUu6NcShzY=;
	h=Date:From:To:CC:Subject:References:In-Reply-To:From;
	b=bW5WUsXIadFR9+sYne1FwD6UIG7UhVv2WK8vEFzgoNZKrRKQz/Trgy4tsk08bfn6Q
	 XPx9IQbJ2PA8jZvquxqfv6Al3TS+BDKoWPlGjz/9VMqzCYtSZOsGvQatutAANeK9QP
	 diAx9C/+8EM+o/Ce+eAcHHRoNmDjTSTSlaxOPB5mCw8pXXjKAWQzIz7gYeJzHLYiic
	 JFbTTy5007q8U6TUYRjHJ1ytxjFudsY1Qg9LIStCI7QDmozFBLg2iUiovzyIf1Mnhw
	 C1uEBdOYvNmvTVf3jatJJQtnTUpNxCdkLFBA92eFRVBVSvgaecCVEQjPLUxULDfJen
	 7m/3M5Qy4UMuw==
X-Received: from gauss4 (10.182.7.102) by EXCH-01.secunet.de (10.32.0.171) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 24 Nov
 2026 11:18:53 +0100
X-Received: (nullmailer pid 3475634 invoked by uid 1000);
	Tue, 24 Nov 2026 10:18:52 -0000
X-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>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <awVjQipfDmyOZZtw@krikkit>
X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de
 (10.32.0.171)