Commit 3167ec9e authored by Jianglei Nie's avatar Jianglei Nie Committed by Zheng Zengkai
Browse files

ima: Fix potential memory leak in ima_init_crypto()

stable inclusion
from stable-v5.10.132
commit c1d9702ceb4a091da6bee380627596d1fba09274
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c1d9702ceb4a091da6bee380627596d1fba09274



--------------------------------

[ Upstream commit 067d2521 ]

On failure to allocate the SHA1 tfm, IMA fails to initialize and exits
without freeing the ima_algo_array. Add the missing kfree() for
ima_algo_array to avoid the potential memory leak.

Signed-off-by: default avatarJianglei Nie <niejianglei2021@163.com>
Fixes: 6d94809a ("ima: Allocate and initialize tfm for each PCR bank")
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent dca07861
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment