diff options
author | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2009-06-04 13:53:10 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-06-04 18:02:39 -0400 |
commit | 04288f42033607099cebf5ca15ce8dcec3a9688b (patch) | |
tree | 41d07beeefcadc4c591699c779406f556cc3433b /security/integrity | |
parent | bcb86975dbcc24f820f1a37918d53914af29ace7 (diff) |
integrity: ima audit dentry_open failure
Until we start appraising measurements, the ima_path_check()
return code should always be 0.
- Update the ima_path_check() return code comment
- Instead of the pr_info, audit the dentry_open failure
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
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 | } |