Commit c93017c8 authored by Jianglei Nie's avatar Jianglei Nie Committed by Greg Kroah-Hartman
Browse files

crypto: ccree - Fix use after free in cc_cipher_exit()



[ Upstream commit 3d950c34 ]

kfree_sensitive(ctx_p->user.key) will free the ctx_p->user.key. But
ctx_p->user.key is still used in the next line, which will lead to a
use after free.

We can call kfree_sensitive() after dev_dbg() to avoid the uaf.

Fixes: 63ee04c8 ("crypto: ccree - add skcipher support")
Signed-off-by: default avatarJianglei Nie <niejianglei2021@163.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 78622926
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment