crypto: ccree - only try to map auth tag if needed
authorGilad Ben-Yossef <gilad@benyossef.com>
Wed, 29 Jan 2020 14:37:55 +0000 (16:37 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 13 Feb 2020 09:05:24 +0000 (17:05 +0800)
commit504e84abec7a635b861afd8d7f92ecd13eaa2b09
treee3e818be6184e0242f2805b28d5dbf437d7ba5d1
parentce0fc6db38decf0d2919bfe783de6d6b76e421a9
crypto: ccree - only try to map auth tag if needed

Make sure to only add the size of the auth tag to the source mapping
for encryption if it is an in-place operation. Failing to do this
previously caused us to try and map auth size len bytes from a NULL
mapping and crashing if both the cryptlen and assoclen are zero.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_buffer_mgr.c