diff mbox series

crypto: mxs-dcp - Fix scatterlist processing

Message ID T0R.ZXsl.2soFymqM66b.1Xx3df@seznam.cz (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: mxs-dcp - Fix scatterlist processing | expand

Commit Message

Tomas Paukrt Jan. 22, 2022, 5:07 p.m. UTC
This patch fixes a bug in scatterlist processing that may cause incorrect AES block encryption/decryption.

Fixes: 2e6d793e1bf0 ("crypto: mxs-dcp - Use sg_mapping_iter to copy data")
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
---
 drivers/crypto/mxs-dcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Jan. 28, 2022, 6:28 a.m. UTC | #1
Tomas Paukrt <tomaspaukrt@email.cz> wrote:
> This patch fixes a bug in scatterlist processing that may cause incorrect AES block encryption/decryption.
> 
> Fixes: 2e6d793e1bf0 ("crypto: mxs-dcp - Use sg_mapping_iter to copy data")
> Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
> ---
> drivers/crypto/mxs-dcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index d19e5ff..d6f9e2f 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -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);
 	}
 
-	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);
 		len = sg_dma_len(src);
 		tlen += len;