From 860623b009278bdeef511d1c018fa8a84a125c96 Mon Sep 17 00:00:00 2001 From: Zhang Tianxing Date: Thu, 18 Mar 2021 17:51:25 +0800 Subject: [PATCH] ima: fix a memory leak in ima_del_digest_data_entry hulk inclusion category: bugfix bugzilla: 46797 CVE: NA Reference: https://gitee.com/openeuler/kernel/issues/I3C03N ------------------------------------------------- This patch fix a memory leak problem when deleting digest list. hlist_del_rcu in ima_del_digest_data_entry only deletes the digest struct from the linked list without releasing the memory it uses. Signed-off-by: Zhang Tianxing Reviewed-by: Roberto Sassu Signed-off-by: Zheng Zengkai --- security/integrity/ima/ima_digest_list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/integrity/ima/ima_digest_list.c b/security/integrity/ima/ima_digest_list.c index 53262495201d..9e0b18640e2c 100644 --- a/security/integrity/ima/ima_digest_list.c +++ b/security/integrity/ima/ima_digest_list.c @@ -120,6 +120,7 @@ static void ima_del_digest_data_entry(u8 *digest, enum hash_algo algo, hlist_del_rcu(&d->hnext); atomic_long_dec(&ima_digests_htable.len); + kfree(d); } /*********************** -- GitLab