]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccree - zero all of request ctx before use
authorGilad Ben-Yossef <gilad@benyossef.com>
Tue, 24 Jul 2018 14:12:45 +0000 (15:12 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Aug 2018 10:06:05 +0000 (18:06 +0800)
commit26839cb1d7677f9f8228c2295e4408b604f7867b
treecd7737142db38b21aa8975b9ae8db21a9f21ed87
parent15dc83bb40bccf3188a8ab831d27b4ee9712b2d1
crypto: ccree - zero all of request ctx before use

In certain error path req_ctx->iv was being freed despite
not being allocated because it was not initialized to NULL.
Rather than play whack a mole with the structure various
field, zero it before use.

This fixes a kernel panic that may occur if an invalid
buffer size was requested triggering the bug above.

Fixes: 23222a81400b ("crypto: ccree - add skcipher support")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_cipher.c