mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
crypto: ccree - Fix use after free in cc_cipher_exit()
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: 63ee04c8b4
("crypto: ccree - add skcipher support")
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
54cce8ecb9
commit
3d950c3407
@ -257,8 +257,8 @@ static void cc_cipher_exit(struct crypto_tfm *tfm)
|
||||
&ctx_p->user.key_dma_addr);
|
||||
|
||||
/* Free key buffer in context */
|
||||
kfree_sensitive(ctx_p->user.key);
|
||||
dev_dbg(dev, "Free key buffer in context. key=@%p\n", ctx_p->user.key);
|
||||
kfree_sensitive(ctx_p->user.key);
|
||||
}
|
||||
|
||||
struct tdes_keys {
|
||||
|
Loading…
Reference in New Issue
Block a user