]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:18 +0000 (10:50 +0200)
commit0bfacbf436c96e7baa21e6b962f8dbf5fce4b85d
tree24d94b90ebb038b541889d7f567484cd8dec4abb
parent27adb8fde1185baa9f2cd35b20c0138298bdd59c
crypto: ccree - only try to map auth tag if needed

commit 9d4e212078c8a3bb8084cbfb03f89c016ae71514 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccree/cc_buffer_mgr.c