crypto: ccree - Fix use after free in cc_cipher_exit()
stable inclusion from stable-v5.10.110 commit c93017c8d5ebf55a4e453ac7c84cc84cf92ab570 bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c93017c8d5ebf55a4e453ac7c84cc84cf92ab570 -------------------------------- [ 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: NJianglei Nie <niejianglei2021@163.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录