Commit 25e89027 authored by Thomas Bourgoin's avatar Thomas Bourgoin Committed by sanglipeng
Browse files

crypto: stm32 - fix loop iterating through scatterlist for DMA

stable inclusion
from stable-v5.10.195
commit a1d2e2c670a3dbac1958d6939b0cb618f106451c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a1d2e2c670a3dbac1958d6939b0cb618f106451c



--------------------------------

commit d9c83f71 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 : 8a1012d3 ("crypto: stm32 - Support for STM32 HASH module")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarThomas Bourgoin <thomas.bourgoin@foss.st.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent d0a3526c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment