aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima.h
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@polito.it>2013-06-07 06:16:28 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2013-10-25 17:17:04 -0400
commit7bc5f447ce9d01e19394b5399bf1a4fcebf0f8dd (patch)
treeb15aaf6f56d81d204296455a80fd1ff29c4cd122 /security/integrity/ima/ima.h
parent9803d413f41db86fdf0097f1af781fe2e68f474c (diff)
ima: define new function ima_alloc_init_template() to API
Instead of allocating and initializing the template entry from multiple places (eg. boot aggregate, violation, and regular measurements), this patch defines a new function called ima_alloc_init_template(). The new function allocates and initializes the measurement entry with the inode digest and the filename. In respect to the current behavior, it truncates the file name passed in the 'filename' argument if the latter's size is greater than 255 bytes and the passed file descriptor is NULL. Changelog: - initialize 'hash' variable for non TPM case - Mimi - conform to expectation for 'iint' to be defined as a pointer. - Mimi - add missing 'file' dependency for recalculating file hash. - Mimi Signed-off-by: Roberto Sassu <roberto.sassu@polito.it> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima.h')
-rw-r--r--security/integrity/ima/ima.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index 27d2ffbd0763..da03d3389619 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -107,6 +107,9 @@ void ima_store_measurement(struct integrity_iint_cache *iint, struct file *file,
107 const unsigned char *filename); 107 const unsigned char *filename);
108void ima_audit_measurement(struct integrity_iint_cache *iint, 108void ima_audit_measurement(struct integrity_iint_cache *iint,
109 const unsigned char *filename); 109 const unsigned char *filename);
110int ima_alloc_init_template(struct integrity_iint_cache *iint,
111 struct file *file, const unsigned char *filename,
112 struct ima_template_entry **entry);
110int ima_store_template(struct ima_template_entry *entry, int violation, 113int ima_store_template(struct ima_template_entry *entry, int violation,
111 struct inode *inode, const unsigned char *filename); 114 struct inode *inode, const unsigned char *filename);
112void ima_template_show(struct seq_file *m, void *e, enum ima_show_type show); 115void ima_template_show(struct seq_file *m, void *e, enum ima_show_type show);