From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796217149; b=igD7PPcOjEqJoyuyr8OH0GjXYcJn3nwZ3ONUvupdPCK8oa4cd3Y7e+wPxMI9HyaTV1A7 MR3fwMyoWFGOJAb7m8XnhWOYJHXFLxy7f8EphV3KTM3XnZVerCnJswoBvFvoNGkD0KjfC G1NgiX40fCTG9CrqFeEzM9o11ududjYFBVisbtzTrPQ+C74SOxKfJaqyMyOAKesbu0G8P 1iwiJYWsSSyXFrSgHzZaRFeGoOEjAELxcsdJPSqPyWPouBPLcUjQRZHSL8+d8YTNIsWbr SCHhlG8FtX+6DtmhAYy5r7Z1l8ybyHVfZG2p8yA9ECoWlkLOzZfrgtgMVVsu4Mb9dhQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796217149; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=nDXvDsECoCsmsAaoyiRJXQtlbIiWQ7v1dlE5YNWKhEg=; b=t2xo1waMNObJLMkMh01DDsDPfqvp2xy8GG7g29ShbukKRBv4p8p3EbpobSZu/F06lflB MSUM9cQhDL4g+jK5G2fPlJegtVG4cxE8UhD+4uugaUZnfNRgk646XIQ5nweXVRaveg4tL rXJvjX5P2Xo1CRYnqnPG/0WfSQt1nSDOnmM/K2m/HwZFcbRJPDRFyYLsqyniZAkCbGCoc jetmTqmBYx/ajDct5qXOnchggNBhMTdmxquNH3KESXxEh9bkY5OFW6ivp5FO8Gn6D24iM AevRFpGDB5M054FCSltSgSIUqeueV0HsftM3MkUj0LAsZ4/bhz6vL9/3cQrRWx2CakQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GKRSUug0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEC77606A322 for ; Wed, 2 Dec 2026 13:12:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GKRSUug0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32AA71F00893; Wed, 2 Dec 2026 13:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796217149; bh=nDXvDsECoCsmsAaoyiRJXQtlbIiWQ7v1dlE5YNWKhEg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GKRSUug0Y+LYYSRHcWD5KV/y23btu0GMxF3KCEPJ1a2hE5pACRpd91sWz+2FOmROw 4LV0w0NQCvDEX/ISYI6LWcRTKVgTRrTfVZvHzSK/X0cNH5o7iJCMRkkMpY6otJIQKm fv6b9N6GYsipxGY7H+d8Qn/PjkSPE524p8Drl0Mh1UcN1UWi2nLLfEw6xGd+MIXpVV rr6kjwvsOFMPsZbT2QOOJATPkPov0MR985IVdWEW4NMjTqkGHeabYmYwk47vFV6Je6 lwQxS39HEVbo5hJXf+3HeSSRYwAQkmChXEIEP2qsuyE7hdO8C5TtcjfUsF9PpOOBVY 6HGtGYdoxaarw== Subject: Re: [PATCH 10/22] xfrm: fix IPv6 first-fragment protocol decode From: netdev-bot+sashiko@kernel.org To: steffen.klassert@secunet.com Cc: davem@davemloft.net, kuba@kernel.org, herbert@gondor.apana.org.au, netdev@vger.kernel.org Date: Wed, 02 Dec 2026 13:12:28 +0000 Message-ID: <179621714878.3146.17309683097656909324@kernel.org> In-Reply-To: <20261201124252.1163254-11-steffen.klassert@secunet.com> References: <20261201124252.1163254-11-steffen.klassert@secunet.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit message describes the bug and the fix only for inbound policy lookup of IPv6 atomic fragments. -- xfrm: fix IPv6 first-fragment protocol decode This patch sets FLOW_DISSECTOR_F_PARSE_1ST_FRAG for IPv6 in __xfrm_decode_session(). With that flag, the flow dissector walks past the Fragment header of a first fragment to reach the real upper-layer protocol. It also stops decode_session6() from filling the port, ICMPv6 and GRE selector fields when the packet is a fragment. > diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c > index 6edf60242a80f..6baff3f797f8c 100644 > --- a/net/xfrm/xfrm_policy.c > +++ b/net/xfrm/xfrm_policy.c [ ... ] > @@ -3511,10 +3517,13 @@ int __xfrm_decode_session(struct net *net, struct sk_buff *skb, struct flowi *fl > unsigned int family, int reverse) > { > struct xfrm_flow_keys flkeys; > + unsigned int flags = FLOW_DISSECTOR_F_STOP_AT_ENCAP; > > memset(&flkeys, 0, sizeof(flkeys)); > + if (family == AF_INET6) > + flags |= FLOW_DISSECTOR_F_PARSE_1ST_FRAG; [Severity: Low] This isn't a bug, but should the commit message describe the full impact of this change? The message says: For an atomic fragment followed by extension headers, inbound policy lookup can therefore see the header after Fragment instead of the actual upper-layer protocol and miss protocol selectors. Every AF_INET6 caller of __xfrm_decode_session() now gets the new flag, not only the inbound path. In __skb_flow_dissect(), the NEXTHDR_FRAGMENT case continues for any first fragment and does not check the M bit: net/core/flow_dissector.c:__skb_flow_dissect() { ... if (!(fh->frag_off & htons(IP6_OFFSET))) { key_control->flags |= FLOW_DIS_FIRST_FRAG; if (flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG) { fdret = FLOW_DISSECT_RET_IPPROTO_AGAIN; ... } Consider a router without conntrack defrag that forwards a non-atomic first fragment (offset 0, M=1) with a Destination Options header after the Fragment header. That packet now reaches both policy lookups through this decoder: ip6_forward() xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb) __xfrm_decode_session() xfrm6_route_forward(skb) __xfrm_decode_session() Before this patch, ip_proto came out as the Fragment header's nexthdr (60 for DSTOPTS), so FWD or OUT policies with a protocol selector did not match. After this patch they see the real upper-layer protocol. Since this is Cc: stable, could the message also say that FWD and outbound IPsec policy selection for forwarded non-atomic first fragments changes too? > __skb_flow_dissect(net, skb, &xfrm_session_dissector, &flkeys, > - NULL, 0, 0, 0, FLOW_DISSECTOR_F_STOP_AT_ENCAP); > + NULL, 0, 0, 0, flags); > > switch (family) { > case AF_INET: -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201124252.1163254-2-steffen.klassert%40secunet.com