diff options
Diffstat (limited to 'security/integrity')
-rw-r--r-- | security/integrity/ima/ima_main.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index a2eb23310eaf..6f611874d10e 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -149,8 +149,8 @@ static void ima_update_counts(struct ima_iint_cache *iint, int mask) | |||
149 | * - Opening a file for read when already open for write, | 149 | * - Opening a file for read when already open for write, |
150 | * could result in a file measurement error. | 150 | * could result in a file measurement error. |
151 | * | 151 | * |
152 | * Return 0 on success, an error code on failure. | 152 | * Always return 0 and audit dentry_open failures. |
153 | * (Based on the results of appraise_measurement().) | 153 | * (Return code will be based upon measurement appraisal.) |
154 | */ | 154 | */ |
155 | int ima_path_check(struct path *path, int mask, int update_counts) | 155 | int ima_path_check(struct path *path, int mask, int update_counts) |
156 | { | 156 | { |
@@ -189,8 +189,13 @@ int ima_path_check(struct path *path, int mask, int update_counts) | |||
189 | file = dentry_open(dentry, mnt, O_RDONLY | O_LARGEFILE, | 189 | file = dentry_open(dentry, mnt, O_RDONLY | O_LARGEFILE, |
190 | current_cred()); | 190 | current_cred()); |
191 | if (IS_ERR(file)) { | 191 | if (IS_ERR(file)) { |
192 | pr_info("%s dentry_open failed\n", dentry->d_name.name); | 192 | int audit_info = 0; |
193 | rc = PTR_ERR(file); | 193 | |
194 | integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, | ||
195 | dentry->d_name.name, | ||
196 | "add_measurement", | ||
197 | "dentry_open failed", | ||
198 | 1, audit_info); | ||
194 | file = NULL; | 199 | file = NULL; |
195 | goto out; | 200 | goto out; |
196 | } | 201 | } |