crypto: mxs-dcp - fix scatterlist linearization for hash
authorRosioru Dragos <dragos.rosioru@nxp.com>
Tue, 25 Feb 2020 15:05:52 +0000 (17:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Apr 2020 06:00:40 +0000 (08:00 +0200)
commit1c7d62cf043816d0a1884e6961aa0b84ac067154
tree98dbaa10b390749a842095bfea322e32b5d4edab
parent25f78b3ce3d5c2c0d08fe62187971f2036fb550e
crypto: mxs-dcp - fix scatterlist linearization for hash

commit fa03481b6e2e82355c46644147b614f18c7a8161 upstream.

The incorrect traversal of the scatterlist, during the linearization phase
lead to computing the hash value of the wrong input buffer.
New implementation uses scatterwalk_map_and_copy()
to address this issue.

Cc: <stable@vger.kernel.org>
Fixes: 15b59e7c3733 ("crypto: mxs - Add Freescale MXS DCP driver")
Signed-off-by: Rosioru Dragos <dragos.rosioru@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/mxs-dcp.c