]> git.hungrycats.org Git - linux/commit
crypto: stm32 - fix loop iterating through scatterlist for DMA
authorThomas Bourgoin <thomas.bourgoin@foss.st.com>
Thu, 13 Jul 2023 15:15:15 +0000 (17:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:43 +0000 (09:48 +0200)
commit3b8c7cc94e298fd0242e1025a8aafa9259a09b0d
treed390e7ab1cd887b00cd782760f6291b9fe531a32
parentafe98365be9501cfe2280be580b423de69e25609
crypto: stm32 - fix loop iterating through scatterlist for DMA

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@vger.kernel.org
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/stm32/stm32-hash.c