Re: [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support

From: netdev-bot+sashiko

Date: Tue Dec 01 2026 - 01:30:28 EST


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