Article View: linux.kernel.netdev
Article #18333Re: [PATCH net-next v4 2/5] psp: support tx rekey operation
From: netdev-bot+sashiko
Date: Wed, 18 Nov 2026 06:05
Date: Wed, 18 Nov 2026 06:05
118 lines
12025 bytes
12025 bytes
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] In the commit "psp: support tx rekey operation", the
documentation and the code disagree.
Pre-existing issues:
- [Low] Retired PSP key material is freed without being zeroized.
--
psp: support tx rekey operation
This commit lets tx-assoc be called on a socket that already has a Tx
key. A new psp_assoc is allocated with the same Rx state and the new Tx
key, then published to the socket with rcu_assign_pointer(). For now,
devices that store Tx keys on the device (SADB) get -EOPNOTSUPP.
> diff --git a/net/psp/psp_sock.c b/net/psp/psp_sock.c
> index c1e38845f08c3..d497f41c483e1 100644
> --- a/net/psp/psp_sock.c
> +++ b/net/psp/psp_sock.c
> @@ -280,6 +280,53 @@ psp_sock_set_tx_key(struct sock *sk, struct psp_dev *psd, struct psp_assoc *pas,
> return err;
> }
>
> +static int
> +psp_sock_tx_rekey(struct sock *sk, struct psp_dev *psd, struct psp_assoc *pas,
> + struct psp_key_parsed *key, struct netlink_ext_ack *extack)
> +{
> + struct psp_assoc *new;
> + int err;
> +
> + if (psp_dev_has_sadb(psd)) {
> + NL_SET_ERR_MSG(extack, "Tx rekey not supported on this device");
> + return -EOPNOTSUPP;
> + }
[Severity: Low]
Should the documentation updated in this patch mention this restriction?
The tx-assoc doc in psp.yaml now says, with no condition:
If the socket already has a Tx association, rekey its Tx direction.
psp.rst says tx-assoc "installs a new Tx key, which takes effect
immediately". The only rekey errors it lists are -EINVAL and -EBUSY.
psp_dev_has_sadb() is true for mlx5, which sets
.tx_key_del = mlx5e_psp_assoc_del. So at this commit, a Tx rekey on the
only in-tree hardware driver always fails with -EOPNOTSUPP, and the docs
never mention that errno.
The next patch in the series, "psp: defer tx key deletions for SADB
drivers", removes this check and adds deferred Tx key deletion. After it,
the code and the docs agree. The mismatch only exists between these two
patches, and the commit message calls it out ("return -EOPNOTSUPP for
now").
> + if (!pas->peer_tx) {
> + NL_SET_ERR_MSG(extack, "Socket PSP state is not fully established");
> + return -EBUSY;
> + }
[ ... ]
> + memcpy(&new->rx, &pas->rx, sizeof(new->rx));
> +
> + err = psp_assoc_set_tx(psd, new, key, extack);
> + if (err) {
> + kfree(new);
> + return err;
> + }
> +
> + psp_dev_get(new->psd);
> + list_add(&new->assocs_list, &pas->assocs_list);
> + list_move(&pas->assocs_list, &psd->stale_assocs);
> +
> + rcu_assign_pointer(sk->psp_assoc, new);
> + psp_assoc_put(pas);
[Severity: Low]
This isn't a bug introduced by this patch, but should the retired key
material be wiped before it is freed?
The replaced association still holds the old Tx key in pas->tx and the Rx
key in pas->rx. It is released through:
psp_assoc_put()
call_rcu(&pas->rcu, psp_assoc_free_queue)
psp_assoc_free()
kfree(pas);
The kfree(new) on the psp_assoc_set_tx() error path also frees an object
that already holds a copy of the live Rx key.
Neither path uses kfree_sensitive() or memzero_explicit(), so the keys
stay in freed slab memory until that memory is reused. Since a rekey can
now happen while the connection stays up, this can repeat many times on
one socket.
The same pattern already existed before this patch, in psp_assoc_free()
and in the kfree(dummy) in psp_dev_tx_key_add(). Nothing in net/psp
zeroizes key material today. Reading these keys would also need a
separate kernel memory disclosure bug.
> int psp_sock_assoc_set_tx(struct sock *sk, struct psp_dev *psd,
> u32 version, struct psp_key_parsed *key,
> struct netlink_ext_ack *extack)
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-psp-v4-0-1a599df2aefa%40gmail.com
Technical Details
Message-ID:
<179498190470.3136.17804985440456720671@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer05.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365897-linux-kernel-netdev=dewy.ruReferences:
<20261116-psp-v4-2-1a599df2aefa@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer05.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365897-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 2/5] psp: support tx rekey operation Date: Wed, 18 Nov 2026 06:05:04 +0000 Organization: Usenet Network Message-ID: <179498190470.3136.17804985440456720671@kernel.org> References: <20261116-psp-v4-2-1a599df2aefa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2519224"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bWABIypp8GL0CrPkG/eidoiydFw= sha256:aPR+QCprxdaEYktqv3/Tv/zMkA6MzC0A2etBd8+rN2c= sha1:+DT3p+w07GFDp3eqH4HE7hgpgfA= sha256:vUgtu6mp1Km2xMOq297gjdNQZMFiVo1+s64/tRI/ZjA= 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 95F1E115127; Wed, 18 Nov 2026 09:05:50 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 Bje-ncTYYk3V; Wed, 18 Nov 2026 09:05:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365897-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2CC221151BE; Wed, 18 Nov 2026 09:05:38 +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 01C7239F76; Wed, 18 Nov 2026 06:05:08 +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=1794981907; b=Rsvv9F1xi8N6ioyXGIT8tq6OS9mAf1FzluRelbpXij6nf7fzSQWtMi/Xa2thVV12zr9P pgv/IrZ72La2Q2OTMJn84Enq1EhnzDpdWRuOMsbXrkDXEN4AFCG/kBAkPcmzy3/vCLfJJ QxOWmvdwhBKWr8jGqqTh1+S67+vGoL8lDVL4rUXjnboD1P5FCS/LnEH/B5rk7FWqBZwgT nNyznPhrLgZ0rLuR1L4zph3q0ITju4dYKyLzH0yPul54T8J4w/VDTTt69rlbzzHa8MAIk fqJqe5afm4uZATA414/J4N+owGML5eYCujmdIr1hr73mHz/4U+OXbEQvMxgYqEQcUOA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794981907; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=8UxOlUwurvltrL8LywXYchF60RvSL244Iq18WBoKZQU=; b=T+5F+ZGBqvpJoILdrvy8jJWUarMRXSjDxoPdf5wrN49xfUJrGwxX0tkjZIaD4hIRv8jQ nl7PFQLykBStKK+MSORx7WDLZ7dR0c0n7roiFX3HifwTb09soh+Ty+/zRu/Swv01/HPx/ XLOv6BFGyxAcoiKgLpdNCqr+FFudxCiesWgUbH7YT5Gf+rSy4Vnd9BYwuVMKWjgOMrBCv Jo0SI5jnbaWQB8mt52uXGyDnhuI3MKHPMd2h56Tf5LIuT0bf7O7J2hssji2bMuGZikjqa 1K5mhXw8CWPcOuYbG6RcIUCkoKdqGBp0yT17ueSchieaLLFCJnjTy7JGgZFS2wcodNA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="dg/Om8Tj"; 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 F1EB6606A885; Wed, 18 Nov 2026 06:05:06 +0000 (UTC) X-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=dg/Om8Tj X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794981906; b=OxeDLGxxwnDfZCg2WL8SurpxD4HA4XbRJDUZvWVb/e3JFbQtGAs0T9on+IdZK12ys2ZX uJDDGsqGXPImRSoz+M9k7nYvcNH1JkESQZOtLbiaQeVRtKvoeqliD84gr1Z8rPoTTRC7a lsH9X1jK+QnU/+Gu/XrexLGLPiEntPsYKfrpBkruugLH/QPqL1qby75eYMjmOcdZfUOOC rcMMTsILti0DOEiyJ5TGfxVO/9J7JtCJnXYqCNkENHzzzBeZeQmltw8lhuvIDnRzQ5oym ihrqC1sPapt+bMh1RT3SwB0AR4w9/kAF8N79dBppDqZqFgY19U4+jIGA38eYsLQj5vg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794981906; 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=8UxOlUwurvltrL8LywXYchF60RvSL244Iq18WBoKZQU=; b=xGjSCqdfjGr1aOt4cHzChJq/LPGnUvYzxVsA/n07pS/ipBMdLB/mFEj9w7WPFETS0wXr ezeuvLKSKcbmY8Jb0nUxWRbgkL1xQbHzJkc1oi+oh98FiEWuIIBtx/3n/oxJjBC6CdRQ7 l7LY7s4VkkHn8lrUtKOalGeDzN3dHBL2mhTyPT3MPkENsM//RtgqL1i4hNzbEIBhDQq9E jArVuqF4xBfEKdPyFg2A9M+rBi9iAClwx2kidHoAu6SI9XdYha5v14xexW2bXveOUH79f ullCMMGATynXwFNUjhXeGLGD8xk3h8kq2gyx2h5stzGMUiOIpgl2RZ5ZKgFrrgSGePQ== X-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="dg/Om8Tj"; arc=none smtp.remote-ip=100.103.45.18 X-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 1F2E9606A332; Wed, 18 Nov 2026 06:05:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AF061F000C6; Wed, 18 Nov 2026 06:05:05 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794981906; bh=8UxOlUwurvltrL8LywXYchF60RvSL244Iq18WBoKZQU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=dg/Om8TjN11NRsuZFFRkEdgzh6GRD86UQQJstuppFBw1A0AtU/WC0jQhsDE/7H3tk UBVR3Haq5Hu89t7qSg6hniWwfO/o93o2Ih0Z/0CR+EjftOnlCC2/7TF/dOfEnK4ETC 960QN7yGod/Qg+YAEdlf5U/HefDcoeYnh4EmwKf6hQ4kWnine5SoiRSNm9HHpETUHD pZ01eB1HnCe3Is8HY08WdWdMapbFu5WA1fEw7RxGDd97RSmMR6M1WdDOdnNrRlUyev P3yHic00Gh039y6+ISl1Yy5p0dlhMwxjcMLLES7WhEOUn1yTcQArFFluaybigEWTW6 umqXmsmYEYFGg== X-Cc: kuba@kernel.org, willemdebruijn.kernel@gmail.com, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, donald.hunter@gmail.com, andrew+netdev@lunn.ch, shuah@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, willemb@google.com X-In-Reply-To: <20261116-psp-v4-2-1a599df2aefa@gmail.com> X-sashiko-severity: Low 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-Received-Bytes: 11740