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=1795910222; b=qlDNdu3g+dwh3DkFdrfuQBx8/dIBut4L5Qdcg6eil8wk63vImu4veHVlBJJrBzJN+xHI Y1FO33RUS22JjYnmalJGTXkrQfcSPhBMvyMROcO88Vkk//1GghrWNkGKIlS9Wupahyy5E azrLefPVvC9aLsvUxg9H30TwEdHUU91jASGfhcVX+jfb3/fV2MSBrG9ssq8us4GAG8Wkr RcXOLlXWZLp89cw/lQPjSMoTRzcLDK1VeJxoYMG+Mgvu0lAqNQggf8JnBPx0ASXwCwZjO D4zBKfGMVlzA7AVNG8oGI5BSTjET6noBxVJppxQ8Ty5GwNhlWyshBgFHQB6mzmsUvGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795910222; 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=8aaeBQp0/hPjhQAy/1Hp7rBN4MN9WESHeXU1oFId7cI=; b=e5C6dK+/y/s+lIlQn8itIV1k75fklDTN+/NoI0TvAsgh+AAJV4PHYeuvJGYQE8Uwy6tS Lj9XFmtdkXRQMBAcsGUZIVhj/pGcgH1+6ux4IXp/if7k2b8xZalWv59obi8knB5z6gWbe QeUhsqIz+vr3Yso2r10ePNeH+JrGoAuVDOh9QoSoSsn3iKV6nXjtY+zCKiW2hFQ1Hdefk noYajbi3lqhGvgATmfr0FJh3vme8kTX9DItdiqv6jJL2J7EYlgyWtH3oXG+dZN1vCzpXR mnpDSMc191Oyxe2tnr60pIN2RJ/E5wbth+/AcAwILyl8MzKNOd33jyvgiL2OSkzxZlQ== 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=Mz9kjnCo; 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 3A2FF606A31C; Sat, 28 Nov 2026 23:57:02 +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=Mz9kjnCo Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1F791F000C1; Sat, 28 Nov 2026 23:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795910221; bh=8aaeBQp0/hPjhQAy/1Hp7rBN4MN9WESHeXU1oFId7cI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Mz9kjnCoefGR1QRA8bojRFQcXlx+2dU+u9slbcRzH6E1Hf9CyXSyhXePNmBQBAltn Z+sjPCMb1hR2vnR8l7w8PzS/2WyM042r7Udc+vABqmzqWBIL2oqXiAHQ5GoOiXm0LK NCcrlMxWwLhlmzkrV5aWWTJDNy/53m1Ed9pIebjkbTGvpGs/JPcBVk9EE3XL9IYDYS sFs5A4FfVqejbojgkYtN14a7KivQCldChMygqRI4l+kkPQxBw++gHToMEGK/OKsqQe cl17fy/5kcX32TcYYVX1301Ixwf6mWWue9LLyuyTO4EGgreXyA4NV5IZoNOFNazje/ 9HdoPaD05hGoA== Subject: Re: [PATCH net-next v3 05/12] net: add METADATA_PSP dst to carry a psp association on an skb From: netdev-bot+sashiko@kernel.org To: toddfreed@meta.com Cc: netdev@vger.kernel.org, davem@davemloft.net, andrew+netdev@lunn.ch, bjorn@kernel.org, borisp@nvidia.com, cratiu@nvidia.com, daniel.zahka@gmail.com, donald.hunter@gmail.com, dtatulea@nvidia.com, edumazet@kernel.org, kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us, leon@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, pabeni@redhat.com, pctammela@mojatatu.com, saeedm@nvidia.com, horms@kernel.org, tariqt@nvidia.com, weiwan@google.com, willemdebruijn.kernel@gmail.com, kuniyu@google.com, bpf@vger.kernel.org, ast@fiberby.net, qingfang.deng@linux.dev, toke@redhat.com, shuah@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, matttbe@kernel.org, dsahern@kernel.org, j.koeppeler@tu-berlin.de, hangbin.liu@linux.dev Date: Sat, 28 Nov 2026 23:56:59 +0000 Message-ID: <179591021919.3135.12606485020589214608@kernel.org> In-Reply-To: <20261124221758.3230929-6-toddfreed@meta.com> References: <20261124221758.3230929-6-toddfreed@meta.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] Concern: in this commit nothing sets skb->decrypted on socket- less METADATA_PSP packets, and the psp_md_alloc() kerneldoc does not… -- net: add METADATA_PSP dst to carry a psp association on an skb This commit adds a METADATA_PSP metadata_dst type that holds a reference on a PSP association, so that an association can be attached to an skb without a socket. psp_skb_get_assoc_rcu() now checks for it first. __dev_queue_xmit() and sk_validate_xmit_skb() drop such packets if they are on the wrong device or too big for the MTU. > diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c > index 8f669304a9969..7c5291d5e9712 100644 > --- a/net/psp/psp_main.c > +++ b/net/psp/psp_main.c > @@ -217,6 +217,37 @@ unsigned int psp_key_size(u32 version) [ ... ] > +/** > + * psp_md_alloc() - allocate a METADATA_PSP dst for an association > + * @pas: association, the dst takes over the caller's reference on success > + * > + * Context: process context, may sleep. > + * Return: the dst, or NULL on failure. > + */ > +struct metadata_dst *psp_md_alloc(struct psp_assoc *pas) [Severity: Low] Should this kerneldoc say that whoever attaches the dst must also set skb->decrypted? In this commit nothing sets skb->decrypted on socket-less METADATA_PSP packets. psp_skb_get_assoc_rcu() also returns the md association without checking skb->decrypted. Suppose the METADATA_PSP dst is lost after it is attached, for example because a later action replaces the dst. sk_validate_xmit_skb() would then skip the skb_psp_md() branch. It would also skip the fail-closed branch, because that branch only runs when skb->decrypted is set: } else if (unlikely(skb_is_decrypted(skb))) { pr_warn_ratelimited("unencrypted skb with no associated socket - dropping\n"); In that case the packet would go out in clear text. As far as I can tell, this is handled later in the series. In "net/sched: add act_psp for psp transport mode", the encap path of tcf_psp_act() does: skb_dst_set(skb, dst_clone(¶ms->md->dst)); ... skb->decrypted = 1; That is currently the only caller of psp_md_alloc(). INET_PSP selects SKB_DECRYPTED and SOCK_VALIDATE_XMIT, so the drop path is always built in. Given that, there is no runtime effect. Could the psp_md_alloc() kerneldoc state the skb->decrypted rule, so that future callers keep this fail-closed behaviour? > +{ > + struct metadata_dst *md; > + > + if (!static_branch_inc(&psp_md_needed.key)) > + return NULL; > + md = metadata_dst_alloc(0, METADATA_PSP, GFP_KERNEL); [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124221758.3230929-1-toddfreed%40meta.com