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=1796106623; b=2W7gMZMca1W/95XGWL8hPVVDxeXW1h1o2Xek/oEpp/O841I49tBJ5EKZ7y3AcA8nt0Th 0XgcaDFADCCDOaObkYDn93157fp1MSDBQnbtBv23CwKYKbpak91gluvOjerQ/3B/HlHlL AUXZiYZin574thgObJj20+bA/hy7247gA4W+pW8tki0jVAaKz0J2UO/PZlEZiOWrtFykB zU0EXzX1/rXu5rA9kMDCI0nbfbrmGbDPf6IVOxVrpAf5AuS66RwzonnSjP/SD0BHM3BuL T8DjTOyi5qMl7mmNofnvbjak+NgyYRiGL/Uxhs79mtC77XzY/yxRdsvPp9F7MaV2HRg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796106623; 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=dpNTad6+ZCwuQk/hmwvZ65rMUiH/2DeWv2M1lw38dno=; b=iYfFUc9USpSdaXJSl3xeL30xxkUufCmmNmLxGEg3Ht9uKXFrjNN3qTg7wUi8ADsiynna JbojLmf5IWJoebRtmzUf/4cRDn2DwRHNA48J5PHbzkzc/yNHGst3vm1jV5PiWrfLech1S 9V0fTkPzH/lqOlPsIN1ekZBFxquqYC9z8FavaTtzMtw04+o7Ul/YugPENW9o7t42K1dfK Ovs6KthCHmOVJNd8YXg/xxl66egIp1/Eege/GrQy0d+J6DWHsJG8YANsfov//xw99kY4R 5QcWtMjHJlC4iP0QYLm/MMaKB5Uwde+0iHc8MFU39nVSYO/pmbQVJmVZPb5zlOS7bfQ== 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=I7j6cQy8; 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 BAAE1606A681; Tue, 1 Dec 2026 06:30:23 +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=I7j6cQy8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CEFA1F00893; Tue, 1 Dec 2026 06:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796106623; bh=dpNTad6+ZCwuQk/hmwvZ65rMUiH/2DeWv2M1lw38dno=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I7j6cQy8KAZXb9Qw7A0LXA1Q/D6xuyp7ToETgRbd19ZGNYKqk/8dgmSM4XjA3YEHT XhSC3taMmni+XkgCGLJANNgOdcRhuvPXg3qkA1l2DhhUO5aWN/dHi/Y4O8ODEVBaXU a2pHataagpoJuNVrABfsJe+wuchgKEn1qUcaBP2sbtVR5o411WBVFGYfn1vDd1F7zt g/HovrK8JMiUCb/l452LNc3zaS9Vb7YvlY4lcxqCYf5kXYBa3dt9rWj7/KY9Uj90BC zKupOASf3rCax+94R1If8CKhrnttH0pRibxcKPdCIuWW35KQ9v5Rc4qv2ZC7AujzTt CIvUCrwj2YZzg== Subject: Re: [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support From: netdev-bot+sashiko@kernel.org To: his1415@pribit.com Cc: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, sd@queasysnail.net, andrew+netdev@lunn.ch, csh0052@gmail.com, oss-drivers@corigine.com, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, ipsec@lists.linux.dev, linux-kernel@vger.kernel.org Date: Tue, 01 Dec 2026 06:30:22 +0000 Message-ID: <179610662211.3146.5510763653346854323@kernel.org> In-Reply-To: <20261130062722.7504-5-his1415@pribit.com> References: <20261130062722.7504-5-his1415@pribit.com> X-sashiko-severity: Medium 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 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] This patch adds three aead_list entries for "rfc4106(gcm(aria))" with geniv "seqiv", ICV 64/96/128 and no .desc,… -- xfrm: add ARIA GCM support This commit adds XFRM AEAD algorithm descriptors for rfc4106(gcm(aria)) with 64-bit, 96-bit and 128-bit ICV lengths. The kernel crypto API already supports this algorithm. The new entries are netlink-only (pfkey_supported = 0) and have no sadb_alg_id. > diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c > index 98ef2c48982a2..d74f86d4e6722 100644 > --- a/net/xfrm/xfrm_algo.c > +++ b/net/xfrm/xfrm_algo.c > @@ -82,6 +82,42 @@ static struct xfrm_algo_desc aead_list[] = { [ ... ] > +{ > + .name = "rfc4106(gcm(aria))", > + > + .uinfo = { > + .aead = { > + .geniv = "seqiv", > + .icv_truncbits = 96, > + } > + }, > + > + .pfkey_supported = 0, > +}, > +{ > + .name = "rfc4106(gcm(aria))", > + > + .uinfo = { > + .aead = { > + .geniv = "seqiv", > + .icv_truncbits = 128, > + } > + }, > + > + .pfkey_supported = 0, > +}, [Severity: Medium] Can an ARIA-GCM SA now be offloaded to Chelsio inline IPsec hardware and end up running as AES-GCM? These new entries have the same geniv, ICV and key length profile as rfc4106(gcm(aes)). They have no .desc, so attach_aead() leaves x->props.ealgo at 0: net/xfrm/xfrm_user.c:attach_aead() { ... x->props.ealgo = algo->desc.sadb_alg_id; ... } cxgb4_xfrm_add_state() passes the SA straight to ch_ipsec_xfrm_add_state(). That function never checks x->props.ealgo or x->aead->alg_name. Its only AEAD checks are these: drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c:ch_ipsec_xfrm_add_state() { ... if (x->aead->alg_icv_len != 128 && x->aead->alg_icv_len != 96) { ... if ((x->aead->alg_key_len != 128 + 32) && (x->aead->alg_key_len != 256 + 32)) { ... if (strcmp(x->geniv, "seqiv")) { ... } An rfc4106(gcm(aria)) SA passes all of these if it has a 128 or 256 bit key plus salt and a 96 or 128 bit ICV. ch_ipsec_setkey() then treats the key as an AES key. It picks ck_size from the AES key size and builds the GHASH subkey by running AES over the ARIA key bytes: ch_ipsec_setkey() { ... ret = aes_prepareenckey(&aes, key, keylen); ... aes_encrypt(&aes, ghash_h, ghash_h); ... } If so, egress ESP on the offloaded SA would be AES-GCM under the ARIA key bytes, while the xfrm state still reports ARIA-GCM. An ARIA-GCM peer would then fail ICV verification on every packet. The other offload drivers seem to reject this SA: - mlx5 and cn10k require props.ealgo == SADB_X_EALG_AES_GCM_ICV16. - nfp switches on ealgo. - ixgbe, ixgbevf and netdevsim compare alg_name against "rfc4106(gcm(aes))". The missing cipher check in the Chelsio driver is older than this patch. rfc7539esp(chacha20,poly1305) and rfc4543(gcm(aes)) SAs also pass it. However, ARIA SAs could not be created before this patch, so the ARIA misprogramming is new here. Would a prerequisite patch make sense? It could make ch_ipsec_xfrm_add_state() require x->props.ealgo to be SADB_X_EALG_AES_GCM_ICV12 or SADB_X_EALG_AES_GCM_ICV16, or require x->aead->alg_name to be "rfc4106(gcm(aes))". > { > .name = "rfc4309(ccm(aes))", > -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130062722.7504-1-his1415%40pribit.com