Article View: linux.kernel.netdev
Article #24994Re: [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:30
Date: Tue, 01 Dec 2026 06:30
130 lines
11696 bytes
11696 bytes
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
Technical Details
Message-ID:
<179610662211.3146.5510763653346854323@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374731-linux-kernel-netdev=dewy.ruReferences:
<20261130062722.7504-5-his1415@pribit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374731-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Date: Tue, 01 Dec 2026 06:30:22 +0000 Organization: Usenet Network Message-ID: <179610662211.3146.5510763653346854323@kernel.org> References: <20261130062722.7504-5-his1415@pribit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1635343"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:xoqK3poPE9WQJk274aHAAT+ys/w= sha256:H5gAQ7ftKNXJDVf9tXrWFSLWQzBr1G1d0FerMqgtfyc= sha1:DyS5xGmB3LiWJfq38gBROZP8mDs= sha256:VRFLHhfIJ1x2AkvyYn8oYcPb0aCBVvW+7S+EVKx9yCM= 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 F181011725D; Tue, 1 Dec 2026 09:30: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 WbJE_h60rWaZ; Tue, 1 Dec 2026 09:30:47 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374731-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 70FEF117244; Tue, 1 Dec 2026 09:30:39 +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 C30452C96D; Tue, 1 Dec 2026 06:30:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796106624; b=SrYx7yGjTBylmYitdEa94EMpJHJ9UxIRwMuCNEUf9eDV0OOUtyIWuPCcB8Lqv3NBktaX 2IWrLAZWNcMECVBT3QYRKQny+vBFIRIU2Biqp5OMTZ4kBgzDMxVORCAJdUDzYsMnWqBvO 1H5FU5dz0n+dG1tN5gFN8iQrF7J45t/7jVjhgETXLEkgIj+Zn3KAKbOMEk9cLvVmQ584q z1rppcMqQX/EdJQgjd86mLSKKfQBcOtUEz1DqtZE3HcAORy2Ymhf9J7jhRXLoDlkY7mVY z7j7V6z/4Thdxd9Bc3K9sxqRdf6xN/vwQnaf5rCbDfJivmWkLpR1+vsPOaIpfLy3oNw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796106624; 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=dpNTad6+ZCwuQk/hmwvZ65rMUiH/2DeWv2M1lw38dno=; b=NKZY2Lo8BL6l8lzheGDMCiclywBelolCia5FbieJOWMH7NLS4zR144gkBcPWexRk0akG 9QWFQHgooqFuDgrUVgFqtQSh6KFD/LfaRZhIWxEJFN4VJf3zmSDqz2pZ3rZmvnVtNG8tz DT7vv9QOV2dBNe2msiAnL2SHH5Kvqwkz/aYLLHsxn+167zDk1YbVyWoaizXDOs+HG89BV 7+yZklECqby55Z7u1uhH7WDy5eWJ5N538YckAPU+3EWxP7l0qEjg/F3axAJBuTvmwYVT9 /0QRK31Aj6qMJtIl/p0S/G/iHrjIRgLJ3x9+0fl9c77YP+8PsdV+qAgshPQOJVAYPAA== 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=I7j6cQy8; arc=fail 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 98E35606A334; Tue, 1 Dec 2026 06:30:24 +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=I7j6cQy8 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=1796106623; b=2W7gMZMca1W/95XGWL8hPVVDxeXW1h1o2Xek/oEpp/O841I49tBJ5EKZ7y3AcA8nt0Th 0XgcaDFADCCDOaObkYDn93157fp1MSDBQnbtBv23CwKYKbpak91gluvOjerQ/3B/HlHlL AUXZiYZin574thgObJj20+bA/hy7247gA4W+pW8tki0jVAaKz0J2UO/PZlEZiOWrtFykB zU0EXzX1/rXu5rA9kMDCI0nbfbrmGbDPf6IVOxVrpAf5AuS66RwzonnSjP/SD0BHM3BuL T8DjTOyi5qMl7mmNofnvbjak+NgyYRiGL/Uxhs79mtC77XzY/yxRdsvPp9F7MaV2HRg== X-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== 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=I7j6cQy8; 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 BAAE1606A681; Tue, 1 Dec 2026 06:30:23 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CEFA1F00893; Tue, 1 Dec 2026 06:30:22 +0000 (UTC) X-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== X-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 X-In-Reply-To: <20261130062722.7504-5-his1415@pribit.com> X-sashiko-severity: Medium 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