mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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
Subject: Re: [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support
Date: Tue, 01 Dec 2026 06:30:22 +0000	[thread overview]
Message-ID: <179610662211.3146.5510763653346854323@kernel.org> (raw)
In-Reply-To: <20261130062722.7504-5-his1415@pribit.com>

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

  reply	other threads:[~2026-12-01  6:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Hong In-su
2026-11-30  6:27 ` [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms Hong In-su
2026-12-01  6:30   ` netdev-bot+sashiko
2026-11-30  6:27 ` [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors Hong In-su
2026-11-30  6:27 ` [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support Hong In-su
2026-11-30  6:27 ` [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Hong In-su
2026-12-01  6:30   ` netdev-bot+sashiko [this message]
2026-11-30  7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
2026-11-30  8:18   ` Hong In-su
2026-12-01  6:57 ` Eric Biggers
2026-12-01  9:09   ` Hong In-su

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179610662211.3146.5510763653346854323@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=csh0052@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=his1415@pribit.com \
    --cc=horms@kernel.org \
    --cc=ipsec@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®