This is a note to let you know that I've just added the patch titled crypto: stm32 - fix loop iterating through scatterlist for DMA to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: crypto-stm32-fix-loop-iterating-through-scatterlist-for-dma.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d9c83f71eeceed2cb54bb78be84f2d4055fd9a1f Mon Sep 17 00:00:00 2001 From: Thomas Bourgoin <thomas.bourgoin@xxxxxxxxxxx> Date: Thu, 13 Jul 2023 17:15:15 +0200 Subject: crypto: stm32 - fix loop iterating through scatterlist for DMA From: Thomas Bourgoin <thomas.bourgoin@xxxxxxxxxxx> commit d9c83f71eeceed2cb54bb78be84f2d4055fd9a1f upstream. We were reading the length of the scatterlist sg after copying value of tsg inside. So we are using the size of the previous scatterlist and for the first one we are using an unitialised value. Fix this by copying tsg in sg[0] before reading the size. Fixes : 8a1012d3f2ab ("crypto: stm32 - Support for STM32 HASH module") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Thomas Bourgoin <thomas.bourgoin@xxxxxxxxxxx> Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -627,9 +627,9 @@ static int stm32_hash_dma_send(struct st } for_each_sg(rctx->sg, tsg, rctx->nents, i) { + sg[0] = *tsg; len = sg->length; - sg[0] = *tsg; if (sg_is_last(sg)) { if (hdev->dma_mode == 1) { len = (ALIGN(sg->length, 16) - 16); Patches currently in stable-queue which might be from thomas.bourgoin@xxxxxxxxxxx are queue-6.5/crypto-stm32-fix-mdmat-condition.patch queue-6.5/crypto-stm32-fix-loop-iterating-through-scatterlist-for-dma.patch