diff options
Diffstat (limited to 'security/integrity/ima/ima_fs.c')
-rw-r--r-- | security/integrity/ima/ima_fs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index db01125926bd..da92fcc08d15 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c | |||
@@ -133,14 +133,14 @@ static int ima_measurements_show(struct seq_file *m, void *v) | |||
133 | * PCR used is always the same (config option) in | 133 | * PCR used is always the same (config option) in |
134 | * little-endian format | 134 | * little-endian format |
135 | */ | 135 | */ |
136 | ima_putc(m, &pcr, sizeof pcr); | 136 | ima_putc(m, &pcr, sizeof(pcr)); |
137 | 137 | ||
138 | /* 2nd: template digest */ | 138 | /* 2nd: template digest */ |
139 | ima_putc(m, e->digest, TPM_DIGEST_SIZE); | 139 | ima_putc(m, e->digest, TPM_DIGEST_SIZE); |
140 | 140 | ||
141 | /* 3rd: template name size */ | 141 | /* 3rd: template name size */ |
142 | namelen = strlen(e->template_desc->name); | 142 | namelen = strlen(e->template_desc->name); |
143 | ima_putc(m, &namelen, sizeof namelen); | 143 | ima_putc(m, &namelen, sizeof(namelen)); |
144 | 144 | ||
145 | /* 4th: template name */ | 145 | /* 4th: template name */ |
146 | ima_putc(m, e->template_desc->name, namelen); | 146 | ima_putc(m, e->template_desc->name, namelen); |
@@ -160,6 +160,8 @@ static int ima_measurements_show(struct seq_file *m, void *v) | |||
160 | 160 | ||
161 | if (is_ima_template && strcmp(field->field_id, "d") == 0) | 161 | if (is_ima_template && strcmp(field->field_id, "d") == 0) |
162 | show = IMA_SHOW_BINARY_NO_FIELD_LEN; | 162 | show = IMA_SHOW_BINARY_NO_FIELD_LEN; |
163 | if (is_ima_template && strcmp(field->field_id, "n") == 0) | ||
164 | show = IMA_SHOW_BINARY_OLD_STRING_FMT; | ||
163 | field->field_show(m, show, &e->template_data[i]); | 165 | field->field_show(m, show, &e->template_data[i]); |
164 | } | 166 | } |
165 | return 0; | 167 | return 0; |
@@ -290,7 +292,7 @@ static atomic_t policy_opencount = ATOMIC_INIT(1); | |||
290 | /* | 292 | /* |
291 | * ima_open_policy: sequentialize access to the policy file | 293 | * ima_open_policy: sequentialize access to the policy file |
292 | */ | 294 | */ |
293 | static int ima_open_policy(struct inode * inode, struct file * filp) | 295 | static int ima_open_policy(struct inode *inode, struct file *filp) |
294 | { | 296 | { |
295 | /* No point in being allowed to open it if you aren't going to write */ | 297 | /* No point in being allowed to open it if you aren't going to write */ |
296 | if (!(filp->f_flags & O_WRONLY)) | 298 | if (!(filp->f_flags & O_WRONLY)) |