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=1796209090; b=jdFGxYk7Qo5X3+LnPe03tlHxDZgUxbnaCnG/G9mQ7BMebRkMuRZxLiCEMNq6Zu7Nl3oF 9lZ27md3OV7B7n1sWmMMqWHxHj7nMhJvlByhGQuUuNYqwy2ize5eEKbAqyTllryj3wChk +Dj71tQWUlDdqAghVlcljVULOIx6vM25g3or6GPDcKZyoh6dpBrduNng4/9MpgemW6rsW L/vmgmRqCg3RPqHz4WRyQ6S3U4ATKZSPI7oPJPdRANLO+Oz3dluKC6ZzOfiwxgMzNwkWj vW+woPIQ6EBh6Ei7N/5fywJRy0u+09abmW5eHiFOUjoTdcFOLGa1tn7Fnpc5h3wxx5A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796209090; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=BNV4W6wv0YAR8XC3VdYwFRFMoMUQMD2xxKPEImpxgck=; b=Vn/+rOU1J0hPZS7tJRdfDDovgDeTmi4M2ohvpjACZ6BfIGhff4zoDdqf8b2bP1YzZBeM KILyjQgeNnNRAJl/WB+LLgNKt3omao+sNhAKJHEN0HEd7m9Yzk8K7PFr50qPwzGCtH13y Qgm5vnjad/n2kW8u1ODy4f33oJKEyvqZvCk18JTwnIsEnqR0uSdCd13X9BDzM2NNeexKV kyl+eQVMD1dLzKs+S2wohazh/pC8/idiFErPlG3vQcFTdF27bf8h3XG/i6vaajMKcPHCk A5VHvkC1LNtUO4YR/CMcj7RpXrHYyyvslPuNGA9cNUyjY6E5LcXPHbzzwahG9o1KFgg== 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=ToEHI4rI; 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 2FDB8606A339; Wed, 2 Dec 2026 10:58:10 +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=ToEHI4rI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 516071F0092F; Wed, 2 Dec 2026 10:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796209089; bh=BNV4W6wv0YAR8XC3VdYwFRFMoMUQMD2xxKPEImpxgck=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ToEHI4rIQGgKy67hz44+9us8v5zik7CC2ipY1lXcjryLFzm+mJBtXMyQBar1oMbVG h1BYI8nhJcKUZc0vp8+s3ygpKWWi+AH9iuHvVoyuNIq7xIZZAebZnZVBHq9El2Pt5r l/cd3Xigr0lXR087rYNdHIgQ/sxQu3v32Q0KnNu+qBxm8etbC/ImSem6Db/ppp5erf /Ce0akcPO3qwLwvMfheaNSAwmqgNzaxmlbmyCzoqnByjM1M6iRE0UPE6QRrP/2oZ2g nL8l3pyur6ew5//dtvlA5zCRmS+tuV+p6UrmTKfyBeVsonEjYcSKDkOK41Zwk/xIbD snun06A15RnbQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v15 25/35] arm64: dts: amlogic: axg: add crypto node 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: <20261202101036.116145-5-jnieto.alaber@gmail.com> References: <20261202100714.115460-1-jnieto.alaber@gmail.com> <20261202101036.116145-1-jnieto.alaber@gmail.com> <20261202101036.116145-5-jnieto.alaber@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 10:58:08 +0000 X-Mailing-List: linux-crypto@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: spurious 0-byte DMA desc in meson_hasher_do_one_request() -- commit d6413ff29b6f1b6e862879e118ab3c6eaef958f4 Author: Alexey Romanov arm64: dts: amlogic: axg: add crypto node This commit adds the crypto engine device tree node to meson-axg.dtsi to enable hardware SHA1/224/256 and AES support on Amlogic AXG SoCs. > diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot= /dts/amlogic/meson-axg.dtsi > index 5b8ef98f6d03b..e755a019b384b 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi > +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi > @@ -321,6 +321,13 @@ ethmac: ethernet@ff3f0000 { > status =3D "disabled"; > }; > =20 > + crypto: crypto@ff63e000 { > + compatible =3D "amlogic,axg-crypto"; > + reg =3D <0x0 0xff63e000 0x0 0x48>; > + interrupts =3D ; > + clocks =3D <&clkc CLKID_CLK81>; > + }; > + > pcie_phy: phy@ff644000 { > compatible =3D "amlogic,axg-pcie-phy"; > reg =3D <0x0 0xff644000 0x0 0x1c>; [Severity: High] In commit "crypto: amlogic - Introduce hasher" earlier in this series, can meson_hasher_do_one_request() emit and execute a spurious 0-byte DMA descriptor with t_src =3D 0 during non-final SHA updates? drivers/crypto/amlogic/amlogic-gxl-hasher.c:meson_hasher_do_one_request() { ... for (;;) { ... 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; } else if (len) { ... } ... if (!ctx.todo && ctx.nbytes) continue; if (!ctx.todo && rctx->final_req && rctx->partial_size) continue; if (!ctx.todo && !rctx->final_req && !ctx.tloffset) continue; if (meson_setup_data_descs(&ctx)) { ret =3D meson_kick_hardware(&ctx); if (ret) goto fail; } } } When a non-final meson_sha_update() request has a length greater than blocksize that is not a multiple of blocksize (for example, 100 bytes), the first iteration queues the 64-byte block into flow->tl[0] without DESC_LAST and increments ctx.tloffset to 1. The second iteration copies the remaining 36 bytes into rctx->partial, leaving ctx.nbytes =3D 0, ctx.todo =3D 0, and ctx.src_addr =3D 0. Because ctx.tloffset is non-zero, = all three continue checks fail and meson_setup_data_descs() appends a 0-byte descriptor at t_src =3D 0 with DESC_LAST before kicking the hardware, corrupting the intermediate hash state. The same fallthrough happens on a subsequent sub-block update after rctx->begin_req is false, because meson_setup_state_descs() increments ctx.tloffset before the remaining bytes are buffered into rctx->partial with ctx.todo =3D 0. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202100714.1154= 60-1-jnieto.alaber@gmail.com?part=3D25