aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/integrity/ima/ima_api.c')
-rw-r--r--security/integrity/ima/ima_api.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index c38bbce8c6a6..ba9e4d792dd5 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -92,8 +92,8 @@ int ima_store_template(struct ima_template_entry *entry,
92 int violation, struct inode *inode, 92 int violation, struct inode *inode,
93 const unsigned char *filename) 93 const unsigned char *filename)
94{ 94{
95 const char *op = "add_template_measure"; 95 static const char op[] = "add_template_measure";
96 const char *audit_cause = "hashing_error"; 96 static const char audit_cause[] = "hashing_error";
97 char *template_name = entry->template_desc->name; 97 char *template_name = entry->template_desc->name;
98 int result; 98 int result;
99 struct { 99 struct {
@@ -132,7 +132,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename,
132 const char *op, const char *cause) 132 const char *op, const char *cause)
133{ 133{
134 struct ima_template_entry *entry; 134 struct ima_template_entry *entry;
135 struct inode *inode = file->f_dentry->d_inode; 135 struct inode *inode = file_inode(file);
136 int violation = 1; 136 int violation = 1;
137 int result; 137 int result;
138 138
@@ -160,10 +160,10 @@ err_out:
160 * @function: calling function (FILE_CHECK, BPRM_CHECK, MMAP_CHECK, MODULE_CHECK) 160 * @function: calling function (FILE_CHECK, BPRM_CHECK, MMAP_CHECK, MODULE_CHECK)
161 * 161 *
162 * The policy is defined in terms of keypairs: 162 * The policy is defined in terms of keypairs:
163 * subj=, obj=, type=, func=, mask=, fsmagic= 163 * subj=, obj=, type=, func=, mask=, fsmagic=
164 * subj,obj, and type: are LSM specific. 164 * subj,obj, and type: are LSM specific.
165 * func: FILE_CHECK | BPRM_CHECK | MMAP_CHECK | MODULE_CHECK 165 * func: FILE_CHECK | BPRM_CHECK | MMAP_CHECK | MODULE_CHECK
166 * mask: contains the permission mask 166 * mask: contains the permission mask
167 * fsmagic: hex value 167 * fsmagic: hex value
168 * 168 *
169 * Returns IMA_MEASURE, IMA_APPRAISE mask. 169 * Returns IMA_MEASURE, IMA_APPRAISE mask.
@@ -248,7 +248,7 @@ int ima_collect_measurement(struct integrity_iint_cache *iint,
248 * 248 *
249 * We only get here if the inode has not already been measured, 249 * We only get here if the inode has not already been measured,
250 * but the measurement could already exist: 250 * but the measurement could already exist:
251 * - multiple copies of the same file on either the same or 251 * - multiple copies of the same file on either the same or
252 * different filesystems. 252 * different filesystems.
253 * - the inode was previously flushed as well as the iint info, 253 * - the inode was previously flushed as well as the iint info,
254 * containing the hashing info. 254 * containing the hashing info.
@@ -260,8 +260,8 @@ void ima_store_measurement(struct integrity_iint_cache *iint,
260 struct evm_ima_xattr_data *xattr_value, 260 struct evm_ima_xattr_data *xattr_value,
261 int xattr_len) 261 int xattr_len)
262{ 262{
263 const char *op = "add_template_measure"; 263 static const char op[] = "add_template_measure";
264 const char *audit_cause = "ENOMEM"; 264 static const char audit_cause[] = "ENOMEM";
265 int result = -ENOMEM; 265 int result = -ENOMEM;
266 struct inode *inode = file_inode(file); 266 struct inode *inode = file_inode(file);
267 struct ima_template_entry *entry; 267 struct ima_template_entry *entry;
@@ -332,5 +332,5 @@ const char *ima_d_path(struct path *path, char **pathbuf)
332 pathname = NULL; 332 pathname = NULL;
333 } 333 }
334 } 334 }
335 return pathname; 335 return pathname ?: (const char *)path->dentry->d_name.name;
336} 336}