提交 ae8e6311 编写于 作者: T Tomas Paukrt 提交者: Zheng Zengkai

crypto: mxs-dcp - Fix scatterlist processing

stable inclusion
from stable-v5.10.110
commit 8e57117142bbe4adcf2088996c6900b128823eb5
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

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

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

[ Upstream commit 28e9b6d8 ]

This patch fixes a bug in scatterlist processing that may cause incorrect AES block encryption/decryption.

Fixes: 2e6d793e ("crypto: mxs-dcp - Use sg_mapping_iter to copy data")
Signed-off-by: NTomas Paukrt <tomaspaukrt@email.cz>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5259c16c
...@@ -331,7 +331,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq) ...@@ -331,7 +331,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128); memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128);
} }
for_each_sg(req->src, src, sg_nents(src), i) { for_each_sg(req->src, src, sg_nents(req->src), i) {
src_buf = sg_virt(src); src_buf = sg_virt(src);
len = sg_dma_len(src); len = sg_dma_len(src);
tlen += len; tlen += len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册