๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23781

Re: [PATCH ipsec-next v3 2/2] xfrm: add ARIA GCM support

#23781
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 02:33
113 lines
11620 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 1 ยท High: 0 ยท Medium: 0 ยท 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).

- [Critical] This patch adds rfc4106(gcm(aria)) AEAD descriptors to
  aead_list in net/xfrm/xfrm_algo.c (lines 85-120).

--

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 the algorithm.

> 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[] = {
>  		.sadb_alg_maxbits = 256
>  	}
>  },
> +{
> +	.name = "rfc4106(gcm(aria))",
> +
> +	.uinfo = {
> +		.aead = {
> +			.geniv = "seqiv",
> +			.icv_truncbits = 64,
> +		}
> +	},
> +
> +	.pfkey_supported = 0,
> +},

[Severity: Critical]
Can an ARIA-GCM SA end up offloaded to Netronome hardware with a NULL
cipher?

These descriptors have no .desc, so desc.sadb_alg_id is 0. attach_aead()
in net/xfrm/xfrm_user.c copies it straight into the state:

	x->props.ealgo = algo->desc.sadb_alg_id;

That leaves x->props.ealgo == SADB_EALG_NONE.

nfp_net_xfrm_add_state() in drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
assumes chacha20-poly1305 is the only AEAD with that id:

	case SADB_EALG_NONE:
		/* The xfrm descriptor for CHACAH20_POLY1305 does not set the algorithm id, which
		 * is the default value SADB_EALG_NONE. In the branch of SADB_EALG_NONE, driver
		 * uses algorithm name to identify CHACAH20_POLY1305's algorithm.
		 */
		if (x->aead && !strcmp(x->aead->alg_name, "rfc7539esp(chacha20,poly1305)")) {
			...
			break;
		}
		fallthrough;
	case SADB_EALG_NULL:
		cfg->ctrl_word.cimode = NFP_IPSEC_CIMODE_CBC;
		cfg->ctrl_word.cipher = NFP_IPSEC_CIPHER_NULL;
		break;

"rfc4106(gcm(aria))" fails the strcmp, so the code falls through and
programs NFP_IPSEC_CIPHER_NULL.

The auth switch earlier in the same function doesn't reject it either.
With aalgo == SADB_AALG_NONE and x->aead set, it only does:

	case SADB_AALG_NONE:
		if (x->aead) {
			trunc_len = -1;

ctrl_word.hash stays at NFP_IPSEC_HASH_NONE. The x->aead block after that
just copies the ARIA key and salt into the config.

net/xfrm/xfrm_device.c doesn't check aead or ealgo before calling the
driver, and NFP registers no xdo_dev_offload_ok callback. So the call
chain attach_aead() -> xfrm_dev_state_add() -> nfp_net_xfrm_add_state()
returns success.

Userspace (for example strongSwan with hw_offload=auto) then reports an
ARIA-GCM SA, while the NIC applies no encryption and no ICV. Offloaded
outbound ESP payloads would go out in plaintext, and inbound SAs would
get no integrity check.

The companion commit "xfrm: add ARIA CBC and CTR support" appears to have
the same issue. cbc(aria) and rfc3686(ctr(aria)) are added to ealg_list
without a sadb id. Since x->aead is NULL for them, they would always fall
through to NFP_IPSEC_CIPHER_NULL, while any configured HMAC still applies.

Could the NFP driver return -EINVAL for any SADB_EALG_NONE algorithm it
doesn't recognize by name, instead of falling through to the NULL cipher,
before these descriptors are added? Another option is to give the new
algorithms an id that offload drivers can't mistake for NONE or NULL.

> +{
> +	.name = "rfc4106(gcm(aria))",

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127020448.55891-1-his1415%40pribit.com
Technical Details
Message-ID: <179583319029.3135.1719122173893517950@kernel.org>
Path: mbox-mo1.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!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373013-linux-kernel-netdev=dewy.ru
References: <20261127020448.55891-3-his1415@pribit.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.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!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373013-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH ipsec-next v3 2/2] xfrm: add ARIA GCM support
Date: Sat, 28 Nov 2026 02:33:10 +0000
Organization: Usenet Network
Message-ID: <179583319029.3135.1719122173893517950@kernel.org>
References: <20261127020448.55891-3-his1415@pribit.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="865097"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FSuDFRf1NQ91IQG1Ea4qTKYMkLE= sha256:QaSrILVCZnuvTK2U7dwPgi2Fcxu3tyB4pfPuclx7OQk= sha1:e+zRUb2/1dEdxGoqf5V5/pCZJc4= sha256:GTGAgt8eyaDadSJWsy8ebh6X2y/J8eQloHac3IDUdhQ=
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 CA501125F69; Sat, 28 Nov 2026 05:33:34 +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 NZaG9v61jP3y; Sat, 28 Nov 2026 05:33:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373013-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 04995125F6D; Sat, 28 Nov 2026 05:33:17 +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 3CFCE27973; Sat, 28 Nov 2026 02:33:14 +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=1795833192; b=E5qnA2/JcclSjH982cUA0Wk3XA+BnGBqFz2Zv2Nl4LDPWdRkCF7thW3xIsSz5atIXspb TbY38VTGypC2kOloGr9Bn3lvNO6fw6rH6hXIkDhzoblyjvzpAQPJk8FGyttNmjV1TdDlj 3h8Cy/fVks4wf8sxJWC/nfW5YayrChhEm9NbbO1wAXaEd4bFtRZj5tU1ppjyYoSc0eLIz bUcJPGpovWei4THQBXRVHWpmpi0Ywa7CQ9jFxD4LfEXqrbt0bKga6EvE4+iEUj4gXKdev ymjxAA90Mf9V7rhTj+u74XOQj5q9RTUY2mxsiM7AC9gv74ElO3JfBbUPeY8viqJzwOQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795833192; 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=4qn0uyCItDbl/DfLGGMPD5QWobg00imW5lBzN8AtDn4=; b=DtANlBXsFBCaNgVnvEM6OPen/vqAZy//MSzwupLxnWi1FHkXwbDXEptwr1l+PX/a75vt 6rGtxKHvWuhxiogft2PiOadAByHj5hlCrLCz6/859ydRbC3e4s28J1IIIjdCNTSvXTSA6 +v4r1KGJ4HHrRSJUS5ZLm/6OABabR0us11LwhUsZkN+Td8MRTB7lsmyD5vIR5iEWVCN/F 7AvmGilrnlrn36/h/MbCChqtW5zM/Y2Ih+k2MPkj8tBJx7CMmkT9lVmj/W03JZIwOaaOB AhJPVbty2e+/ZH+m0zxQZ91lMNA8X+Dz6FfPJaowhTn4cjC30JCW1f6xyhMl0hQFjRQ==
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=LGrCyPAX; 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 AC419606A33C; Sat, 28 Nov 2026 02:33:12 +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=LGrCyPAX
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=1795833191; b=46zUZS3NncKzZ3eRCRd80qWKGkLbwn0BGil7k9J/NnrjkdgT8jx0Z5XgJUtdXerM1b+M ribXibDj90AbBWPOIK/PWZy4+5rvdPre+3NQMqM4oWMEW1eIGKPEpFCvJ1AVCCkRjIMjp SoJfbQ1vRs9wNC5SD/bQ6hU5hH4ToLcj4ar4Rj/mgBKhjctFZl+xPyoxthThd1GH5Xz2+ Xdg5M+rY7jsRHMDxVeaL5nE4l1HMkFnvjmaiNQWeGwgBzsUvK+GDMiaNz3in6OGkhaXAH sLPMLm9wJO53CfMkBbS5xt9jtkS3Hlm1Ho7RCT0Jo7hXtmcZf+6j9N8Yaj/26oGi18g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795833191; 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=4qn0uyCItDbl/DfLGGMPD5QWobg00imW5lBzN8AtDn4=; b=TmlvF9dCX8cAkrLhX0WKGsqTWZsmXKvOUFhEQ5IsVVIFMI4DCnS0vcHRKu34Yi6ng/kD Z8FusaAVILTdeZ0lu3wLpO1rSFlmDSEf3StQxfDrLrku6LGXUrCPefuPb44OyQdhnBDkz xYfLWZ6ahw6p+pPAeKeNlpQmARTpmV7iVWHq6gzF8+DIbe1/3o9k4b8IenagZSN8KFje1 wmeNdnprYbPiH1x3c5XHLZAvXOsW+Za3UUDFtFfXNxEGFkzXFITRTbegshRQLbVqBGSKl Sp9aTzZ0x+/8DEY6v5fxV6GU/3xi4Yl9vZ0q4a8e92y85ntAok2DgOAENS6dPhWIQ3Q==
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=LGrCyPAX; 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 CE43D606A32D; Sat, 28 Nov 2026 02:33:11 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE4BB1F00897; Sat, 28 Nov 2026 02:33:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795833191; bh=4qn0uyCItDbl/DfLGGMPD5QWobg00imW5lBzN8AtDn4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=LGrCyPAX0bY+vp+mzgO97bJwexv7z/Hq5pJcsBgyNtmk6Vk/153Bay1O/+1bfNb8Y tmUf33q9kJm7VKz50UiowplGk8Pos2699SbMHCDskjpnziVMvJ2mYjJ/WclSMLyZ9h gFFBnFi6c6qh703nWBICWr+DCE8PKKnooYyoI7Fb80GCKyL8IV6T2sh2+DlRbCPV8W LyuWsirNVJc/BCyDO28q+8AZ/vOegjGGUv0u8U2HPI1avy7PHdnFrmKZY5faqsrNGg dt3IBYtyPFpTc+jabQk1bLLs4yjLs+FdXXRhBN3+rHRytU0/28HGIu2K9se7Iodo2J dUBgf00wLwmew==
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, netdev@vger.kernel.org, ipsec@lists.linux.dev, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261127020448.55891-3-his1415@pribit.com>
X-sashiko-severity: Critical
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