aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima_queue.c
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@polito.it>2011-12-19 15:57:27 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-25 17:24:41 -0800
commit808f398267e920a772c1ae07781adfb0d4d1c48a (patch)
tree8fab39a3e202c4bbd239ed69af475413a2a76287 /security/integrity/ima/ima_queue.c
parent9919fe804d613e513ef13f5eedc9e583c4429d38 (diff)
downloadkernel_samsung_smdk4412-808f398267e920a772c1ae07781adfb0d4d1c48a.zip
kernel_samsung_smdk4412-808f398267e920a772c1ae07781adfb0d4d1c48a.tar.gz
kernel_samsung_smdk4412-808f398267e920a772c1ae07781adfb0d4d1c48a.tar.bz2
ima: free duplicate measurement memory
commit 45fae7493970d7c45626ccd96d4a74f5f1eea5a9 upstream. Info about new measurements are cached in the iint for performance. When the inode is flushed from cache, the associated iint is flushed as well. Subsequent access to the inode will cause the inode to be re-measured and will attempt to add a duplicate entry to the measurement list. This patch frees the duplicate measurement memory, fixing a memory leak. Signed-off-by: Roberto Sassu <roberto.sassu@polito.it> Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'security/integrity/ima/ima_queue.c')
-rw-r--r--security/integrity/ima/ima_queue.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index 8e28f04..e1a5062 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -114,6 +114,7 @@ int ima_add_template_entry(struct ima_template_entry *entry, int violation,
memcpy(digest, entry->digest, sizeof digest);
if (ima_lookup_digest_entry(digest)) {
audit_cause = "hash_exists";
+ result = -EEXIST;
goto out;
}
}