提交 f6924d51 编写于 作者: Z Zhang Tianxing 提交者: Zheng Zengkai

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: NZhang Tianxing <zhangtianxing3@huawei.com>
Reviewed-by: NRoberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8b293dbc
...@@ -120,6 +120,7 @@ static void ima_del_digest_data_entry(u8 *digest, enum hash_algo algo, ...@@ -120,6 +120,7 @@ static void ima_del_digest_data_entry(u8 *digest, enum hash_algo algo,
hlist_del_rcu(&d->hnext); hlist_del_rcu(&d->hnext);
atomic_long_dec(&ima_digests_htable.len); atomic_long_dec(&ima_digests_htable.len);
kfree(d);
} }
/*********************** /***********************
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册