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=1796208242; b=mV92OS0hdvpdruVuvWNr5r/7koSPquCZzkVN8HRT4BMW5uglpydrZ+Ww6EKb3pXpvIwK 3WzIzVLM75l5BvgNmcjJkmp7g+RE8G/8wW1sDOvcEQb40tMJSa+/p9LfkXKQtcB8SOr26 pJovLPx5GJPfrRV2Lx69VwCsTLLmHN/TRIQy+yCtJlHrlGrpJNrYRWdA0DR74kyVc/2xY ZLSfbyxLJbFkLNKrWcey5026xfg8IYQsDs9KAxNbtERcF+kJQzcuqe/RauWa2NUGtDqpB cK0qzdqPpNdqUuJIO9tkHTcZ0bVV9WUXsXWuHySoaki4lj//SXr5oFj4K282ZF8RZ+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796208242; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ir91qAWBkaxTqMXF7+qaMvcExZr07CrX2AZZGuyYgiE=; b=3tlQ7syYJSOe5Y6vuJsPS+bRCf/osR+x/EMI+xJHWR7ctcotBrheqWAHflg/LQ26mLTk EWA0/Gcz7doOmZrK7Bpkrb1IFSll+RzwsbMdnEq25nBgb2MPc3h+u4G4BeqvYnAHaKdiR T8aD0RNOVOqfVHa66hzFT5erBR7OgS9X9WIOY6Tl/jrLjg+hnMtJ6qCq5JfXkyTItVu3Q lQJYq72U2Gyj9Heow1Pw58pdaQNGjLBH9PK54Xw/MUD3YmSl1niCkX5+jlumKGLxT2ajB anCXijQDz3lPPkHuQj340/k7I/3qqztOpIKk+gXUyCl+uAPYpaD1VTmDRrpoHVAn+Ng== 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="A/Et+ppC"; 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 E50CD606A687; Wed, 2 Dec 2026 10:44:01 +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=A/Et+ppC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75EC61F00930; Wed, 2 Dec 2026 10:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796208241; bh=ir91qAWBkaxTqMXF7+qaMvcExZr07CrX2AZZGuyYgiE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=A/Et+ppCMkTqE71HyzUy6ppXPyVguIpoKvK4rUsvAjQC1XCCX7zPuhq0N7Dpv9UMy 5QESYyKq/V0CmMyihsO7CU/QmDDxhdInetSeFZZlz8Yz4F5ucAuRVOWo0jktF5/riC JECVLViRxQN0Zu5KIg5ki+D4YYay6oN6Kenv7w8I5ORmPCPoz6RdEGr9fRzNRqUtQp 8EVu9LXefTvyCOvYZElvp68vvjNHGRiyY5/7VohwQc8dwO4BxEwVSvlRyiEG1Kx794 TFZaKeVN+9ttguBoLUb5S7St//tKq4ZIumB3sQrtArmVQGOl8lOtWfxSIbbjI6+YKb ctXwwEGIEvNZQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v15 16/35] crypto: amlogic - Add support for AXG-series Reply-To: sashiko-reviews@lists.linux.dev To: "Jose Nieto" , "Corentin Labbe" , "Herbert Xu" , "David S . Miller" Cc: linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, "Neil Armstrong" , "Kevin Hilman" , "Jerome Brunet" , "Martin Blumenstingl" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Alexey Romanov" In-Reply-To: <20261202100714.115460-17-jnieto.alaber@gmail.com> References: <20261202100714.115460-1-jnieto.alaber@gmail.com> <20261202100714.115460-17-jnieto.alaber@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 10:44:00 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] crypto: amlogic: bogus 0-byte SHA DMA descriptor in meson_hasher_do_one_request() -- commit 6b34f6d28194aa5410f659684336c46581480c73 Author: Alexey Romanov crypto: amlogic - Add support for AXG-series This commit adds platform data and the device tree match entry for the Amlogic AXG crypto accelerator, enabling hardware hashing with three setup descriptors. > diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/a= mlogic/amlogic-gxl-core.c > index 0fb0da20e06b2..08d89db14788a 100644 > --- a/drivers/crypto/amlogic/amlogic-gxl-core.c > +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c > @@ -290,6 +290,14 @@ static const struct meson_pdata meson_g12a_pdata =3D= { > .support_192bit_key =3D false, > }; > =20 > +static const struct meson_pdata meson_axg_pdata =3D { > + .descs_reg =3D 0x0, > + .status_reg =3D 0x8, > + .setup_desc_cnt =3D 3, > + .hasher_supported =3D true, > + .support_192bit_key =3D true, > +}; [Severity: High] Can enabling hasher_supported here submit a bogus 0-byte SHA DMA descriptor from physical address 0 in meson_hasher_do_one_request() during incremental crypto_ahash_update() calls, corrupting the hash state? On any non-final update after the first block has been hashed (so rctx->begin_req and rctx->final_req are both false), meson_setup_state_descs() runs at the start of the loop and advances ctx.tloffset by setup_desc_cnt (3 on AXG) before checking whether a full block is ready. When the update only provides len < blocksize bytes, the loop copies them into rctx->partial and sets ctx.nbytes to 0, leaving ctx.todo and ctx.src_addr at 0 while ctx.tloffset is non-zero: drivers/crypto/amlogic/amlogic-gxl-hasher.c:meson_hasher_do_one_request() { ... meson_setup_state_descs(&ctx); if (rctx->partial_size && rctx->partial_size < blocksize) { ret =3D meson_fill_partial_buffer(&ctx, len); if (ret) goto fail; } else if (len && len < blocksize) { memcpy(rctx->partial, sg_virt(ctx.src_sg) + ctx.src_offset, len); rctx->partial_size =3D len; ctx.nbytes -=3D len; ctx.src_offset +=3D len; } ... if (!ctx.todo && ctx.nbytes) continue; if (!ctx.todo && !rctx->final_req && !ctx.tloffset) continue; if (meson_setup_data_descs(&ctx)) { ret =3D meson_kick_hardware(&ctx); ... } Because ctx.nbytes is 0 and ctx.tloffset is non-zero, both continue checks are skipped and meson_setup_data_descs() queues and kicks a 0-length data descriptor with ctx.src_addr =3D=3D 0. Later commit "crypto: amlogic: hash= er: add one-shot digest path" adds a check for rctx->final_req, but non-final updates still fall through. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202100714.1154= 60-1-jnieto.alaber@gmail.com?part=3D16