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=1796209312; b=P+VbsHDtFDzuc+Tin9A14OP/PuC+SL6XNB0+PgDLS4jb8ySvXtr/HOW6UFKp9eP0r5Ro 9T+qS1H/d4VPLHJarzu4wKtg7SXSRc2ADVjbEk5Hou2viFW9cg+sqxWACX8EK6ae98nt2 qllqrtw9caLNtp6LpDepTgz8pf/q93TKPl6lA7hWQDHD74kD2ZNlezM1D5m8MzH9Jmg5t Qx9O0h3wp8k7PQTJUhbr1PeF7KkWYllOjmemOvXj7LIFO2UMiSAnXVnsNeSozre9DfZGY MI4oJrBGbf4w6Ib3MpzqRqHgEySd2H5xFGPcO7nhytZbfmn7D+qNrJD8mM9uj70fPgA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796209312; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+5jbzfr4R/0Cw4hJqVJSM2o/OC81uPGC71qW4+ozZA8=; b=JfGmEaW51tltyjTKkZdbTV9y+OGwn+Ddk4tjfC0ELbmcNA1rAzkpe9yI6MC4XII/PC0d mlLH9u+jgDF+FwMQskUffieC/ZKuti694qKT9sgSXs00DNAMA7YuClYdyR3gbJ+DZgiHl aGsi24I+USy3aO0jKFztpUn/sobSaEGLl2GILYCIuWyhsds+3UerMR7bWHQHS7uvjILdC 7dSCdk80iy6AXK01cHov4vj/5udBGLuxdCLbAmlu2419YfLlUpy2eCcWrsRsaxFnrt0Aq KyszQ0P7ghOD/ceOKh8SQ+CNOsUzoz04skX/JzNKxr39sWKYo5jb26rgLDj0hhak4pw== 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=ajvkEFee; 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 1AD76606A31A; Wed, 2 Dec 2026 11:01:51 +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=ajvkEFee Received: by smtp.kernel.org (Postfix) with ESMTPSA id 794E21F000C1; Wed, 2 Dec 2026 11:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796209311; bh=+5jbzfr4R/0Cw4hJqVJSM2o/OC81uPGC71qW4+ozZA8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ajvkEFeeeVoaZNN711CpxoQZuvaLgvC5KPmP6MNO8ENV4yjuGnIXJoe3uwogPj1Sl YugOUJB4LPdBR2LIg4G7eSHnZNbJgr+YArFghpA6piGiF1Ui94dB01rdgrcHitMtKB 5MJHSlSfyRt4tFvZIAaei99I35SEbdQcbxzkjHwJ3zzlmumWece75g1vbL3ImlZUD2 Hfr7CeDD/m7KkdWBKhQcNM0iCkMFE3vu3XPy6dlRaGdbvrWOIPqzj4nvkc2KKNQeLw bICWZvBCVZFRArDDkn2r2fHGk1JpHYTT8lSAQ0Ejr4ySUXJd0Lb4M9aIKPT94c/6X/ qiPJ3UO4LEd4w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v15 17/35] crypto: amlogic - Add support for A1-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-18-jnieto.alaber@gmail.com> References: <20261202100714.115460-1-jnieto.alaber@gmail.com> <20261202100714.115460-18-jnieto.alaber@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 11:01:50 +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 - 0-length SHA DMA descriptor on partial update -- commit be66e1e9ce951d55cbc35bb5ee6540ded856ef0f Author: Alexey Romanov crypto: amlogic - Add support for A1-series This commit adds platform data and device tree compatible strings for the Amlogic A1 and S4 crypto engines, with hardware hasher support enabled. > diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/a= mlogic/amlogic-gxl-core.c > index 08d89db14788a..3a6bac10bb04b 100644 > --- a/drivers/crypto/amlogic/amlogic-gxl-core.c > +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c > @@ -298,6 +298,14 @@ static const struct meson_pdata meson_axg_pdata =3D { > .support_192bit_key =3D true, > }; > =20 > +static const struct meson_pdata meson_a1_pdata =3D { > + .descs_reg =3D 0x0, > + .status_reg =3D 0x8, > + .setup_desc_cnt =3D 1, > + .hasher_supported =3D true, > + .support_192bit_key =3D false, > +}; [Severity: High] With hasher_supported enabled here, can a non-final SHA update request with a trailing partial block kick a 0-length DMA descriptor reading from physical address 0x0 in meson_hasher_do_one_request()? For example, when an update request passes 74 bytes (one 64-byte block plus 10 trailing bytes), the first loop iteration queues the 64-byte data descriptor (incrementing ctx.tloffset) without kicking hardware because ctx.nbytes is still 10. On the second iteration, the remaining 10 bytes are copied into rctx->partial, leaving ctx.nbytes =3D 0, ctx.todo =3D 0, and ctx.src_addr =3D 0: drivers/crypto/amlogic/amlogic-gxl-hasher.c:meson_hasher_do_one_request() { ... } 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.tloffset is non-zero, neither continue branch is taken, and meson_setup_data_descs() appends an extra descriptor with length 0, t_src =3D 0, and DESC_LAST before kicking the hardware, corrupting the SHA state or causing a DMA error. The same happens on a subsequent small update after hardware has already run once (rctx->begin_req is false), because meson_setup_state_descs() sets ctx.tloffset =3D setup_desc_cnt before checking whether a full block is ready to be processed. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202100714.1154= 60-1-jnieto.alaber@gmail.com?part=3D17