]> git.hungrycats.org Git - linux/commit
crypto: mxs-dcp - fix source scatterlist length access
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 21 Jun 2026 19:26:16 +0000 (21:26 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 5 Jul 2026 05:27:15 +0000 (13:27 +0800)
commitc5bcb084a9871e5b62afb5f48b60adfa13b5d9f8
tree06cf60486c1f4277d95781752b240263c3e17827
parentd03f980a25853f6a380895119a572a3bb1194e8d
crypto: mxs-dcp - fix source scatterlist length access

mxs_dcp_aes_block_crypt() uses sg_dma_len() without mapping the source
scatterlist with dma_map_sg() first. Therefore, sg_dma_len() is invalid
and could return zero or a stale DMA length, causing encryption and
decryption to process the wrong number of bytes when
CONFIG_NEED_SG_DMA_LENGTH=y.

Use the original scatterlist length instead.

Fixes: 15b59e7c3733 ("crypto: mxs - Add Freescale MXS DCP driver")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/mxs-dcp.c