diff options
author | Tyler Hicks <tyhicks@linux.microsoft.com> | 2020-07-09 09:19:00 +0300 |
---|---|---|
committer | Mimi Zohar <zohar@linux.ibm.com> | 2020-07-17 04:53:55 +0300 |
commit | 9ff8a616dfab96a4fa0ddd36190907dc68886d9b (patch) | |
tree | 0acdb5172013a9860dd91c3ccc2ce9bcbb01c248 /security/integrity/ima/ima_policy.c | |
parent | 34e980bb83a07b533d175221436d698c1312c4a3 (diff) | |
download | linux-9ff8a616dfab96a4fa0ddd36190907dc68886d9b.tar.xz |
ima: Have the LSM free its audit rule
Ask the LSM to free its audit rule rather than directly calling kfree().
Both AppArmor and SELinux do additional work in their audit_rule_free()
hooks. Fix memory leaks by allowing the LSMs to perform necessary work.
Fixes: b16942455193 ("ima: use the lsm policy update notifier")
Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Cc: Janne Karhunen <janne.karhunen@gmail.com>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_policy.c')
-rw-r--r-- | security/integrity/ima/ima_policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 66aa3e17a888..d7c268c2b0ce 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -258,7 +258,7 @@ static void ima_lsm_free_rule(struct ima_rule_entry *entry) int i; for (i = 0; i < MAX_LSM_RULES; i++) { - kfree(entry->lsm[i].rule); + security_filter_rule_free(entry->lsm[i].rule); kfree(entry->lsm[i].args_p); } kfree(entry); |