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=1796118376; b=14uyJ9O+xMQFsFk8ZOFvjAp0v9FHDrm/3bPfPc9n5aCL/Tk5KfBCp3k1KmpKHA7UZPks ACcvUedcs1cgYyYCgU0k7Wv3PuUaGIfoQmXQpRSIjOXN7XXolR1/gEs4vpvUIL4stY5DX bKIPJeKN8mktcVo8IKzc7D1rJpeDaN0DrHbpvD32kA+/WulKOQkj8RyqqSsnfJCTUJVLZ 53/v8NTMzUuB880qhS38QJomwhIfMJoWpLpXikEUXR9f3WcgUPxYG2unF49GiYshS/3QG 9nSS/yDLdVcSGdXLUpnBugSKz93RnVhGC3nd+hmPX7QXun/yyf6+oe/em6J2llrl7oQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796118376; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=MGQXdIjACI+imnxeCeFV5Y56Kr+XZlJp6HrHf+MXf2E=; b=yP6DsNnMjArt0dCFfkmeXAqea1vRum5sSOFMCgQ1LuYeb3sv4P2FKWH6Rqq0VAaWAKdQ +QFWEfMvk4A55SPvSxDSHjeDgjbEs1WH45hbjoM6TVmVkMlFXiaGSLWteHa2Tbb0NL+3B W9GiFncrenXP/Gk/O7yTSt/zC12ekiUcPNQBOmmR1dFW7s8SFi1Ks+2gDCTggeW/LZgZu 0F94iCvr1PQYiS3XGwyklr6B/1SNVfyWqhGFJ0CsXzLBs2hqkP2dq3KD9xLEAXHmZBsMW GDabPfT8CEddeTMtIiPO0P1junsF2WN9xdktDFJzJSX3senZf44d8tvR5MnzPsK5hww== 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=A8xkIQOG; 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 D9A2460A2608 for ; Tue, 1 Dec 2026 09:46:16 +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=A8xkIQOG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2128C1F00A1E; Tue, 1 Dec 2026 09:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796118376; bh=MGQXdIjACI+imnxeCeFV5Y56Kr+XZlJp6HrHf+MXf2E=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=A8xkIQOGhmd9mNfa5Di10V37pXfFTMhdJdRKYF+QXZczsoLJGEO5wCx5hQU5wZ6/Q JEMHvQVsCQ2HOCHG2IFi96QxGJiRntRefd64Ie0mnKetUx62WCl8fWCm+r7P7P6k1F pVIVHNMY2Q5NJndmlzDFe2Czzrh/bps9v2c1qTzOVM/7T1naWAKWPrxcYONsxCTeAB SHBoNrF5EUjpoCveY8ZqCEO/ej6+e5GmMeenX6w+pZWpCqC7eQPiQ+frvkQHRp5Qdz umGXunyDpjisrTDnS2UDLNPIpXavxF8z7gMppQJFLBFYjPPhnobBTe2xKYy8DmHUN5 AfB8o2k7wgdkA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] crypto: tegra - Fix dma_free_coherent() size in tegra_sha_do_init() Reply-To: sashiko-reviews@lists.linux.dev To: "Thomas Fourier" Cc: "Akhil R" , "Herbert Xu" , "David S. Miller" , "Thierry Reding" , "Jonathan Hunter" , "Dave Penkler" , "Greg Kroah-Hartman" , =?utf-8?b?RG9taW5payBLYXJv?= =?utf-8?b?bCBQacSFdGtvd3NraQ==?= , =?utf-8?b?VXdlIEtsZWluZS1Lw7ZuaWcgKFRoZSBDYXBhYmxlIEh1Yik=?= , "Bjorn Helgaas" , =?utf-8?b?b3BlbiBsaXN0OkNSWVBUTyBBUEk=?= In-Reply-To: <20261201093717.7521-2-fourier.thomas@gmail.com> References: <20261201093717.7521-2-fourier.thomas@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 09:46:15 +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: - [Medium] crypto: tegra - unrelated fluke_dma_read() change bundled into commit It also noticed 1 related pre-existing issue this patch does not introduce: - [Critical] gpib: unhandled dma_map_single() failure in fluke and fmh DMA transfers [1] -- commit 0f61af3df7a71e6095c67cd6f36bba561cd161e0 Author: Thomas Fourier crypto: tegra - Fix dma_free_coherent() size in tegra_sha_do_init() This commit passes rctx->blk_size instead of rctx->residue.size to dma_free_coherent() on the intr_res_fail error path in tegra_sha_do_init(), and also updates a dma_unmap_single() call in fluke_dma_read(). > diff --git a/drivers/gpib/eastwood/fluke_gpib.c b/drivers/gpib/eastwood/f= luke_gpib.c > index 1363f0a1f5701..f08a8229aa99d 100644 > --- a/drivers/gpib/eastwood/fluke_gpib.c > +++ b/drivers/gpib/eastwood/fluke_gpib.c > @@ -585,7 +585,7 @@ static int fluke_dma_read(struct gpib_board *board, u= 8 *buffer, > DMA_PREP_INTERRUPT | DMA_CTRL_ACK); > if (!tx_desc) { > dev_err(board->gpib_dev, "failed to allocate dma transmit descriptor\n= "); > - dma_unmap_single(NULL, bus_address, length, DMA_FROM_DEVICE); > + dma_unmap_single(board->dev, bus_address, length, DMA_FROM_DEVICE); [Severity: Medium] Was this fluke_dma_read() change in the GPIB eastwood driver folded into the Tegra crypto commit by mistake? It fixes a bug from 55936779f496 ("staging: gpib: Add Fluke cda based cards GPIB driver") in an unrelated subsystem and should be split into its own patch. [Severity: Critical] This problem wasn't introduced by this patch, but fluke_dma_read() and fluke_dma_write() never check the address returned by dma_map_single() with dma_mapping_error() [1]: drivers/gpib/eastwood/fluke_gpib.c:fluke_dma_read() { ... bus_address =3D dma_map_single(board->dev, e_priv->dma_buffer, length, DMA_FROM_DEVICE); /* program dma controller */ retval =3D fluke_config_dma(board, 0); ... } In the sibling fmh_gpib_dma_read() and fmh_gpib_dma_write() functions in drivers/gpib/fmh_gpib/fmh_gpib.c, dma_mapping_error() is logged with dev_err(), but execution continues without returning an error. When DMA mapping fails, all four paths pass DMA_MAPPING_ERROR to dmaengine_prep_slave_single(), submit the transfer to the DMA controller, and later pass the invalid address to dma_unmap_single(), which can trigger DMA or IOMMU faults and memory corruption. [1] https://sashiko.dev/#/bug/linux-ee72ea5b-39f1-4760-9696-84b497f26d28 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201093717.7521= -2-fourier.thomas@gmail.com?part=3D1