summaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima.h
diff options
context:
space:
mode:
authorMimi Zohar2017-01-17 12:45:41 +0100
committerMimi Zohar2017-01-27 20:16:02 +0100
commitbc15ed663e7e53ee4dc3e60f8d09c93a0528c694 (patch)
tree7ab298e6fac6256585436cd3f78b8b1fa36daa02 /security/integrity/ima/ima.h
parentMerge branch 'smack-for-4.11' of git://github.com/cschaufler/smack-next into ... (diff)
downloadkernel-qcow2-linux-bc15ed663e7e53ee4dc3e60f8d09c93a0528c694.tar.gz
kernel-qcow2-linux-bc15ed663e7e53ee4dc3e60f8d09c93a0528c694.tar.xz
kernel-qcow2-linux-bc15ed663e7e53ee4dc3e60f8d09c93a0528c694.zip
ima: fix ima_d_path() possible race with rename
On failure to return a pathname from ima_d_path(), a pointer to dname is returned, which is subsequently used in the IMA measurement list, the IMA audit records, and other audit logging. Saving the pointer to dname for later use has the potential to race with rename. Intead of returning a pointer to dname on failure, this patch returns a pointer to a copy of the filename. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'security/integrity/ima/ima.h')
-rw-r--r--security/integrity/ima/ima.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index 5e6180a4da7d..b563fbd4d122 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -204,7 +204,7 @@ int ima_store_template(struct ima_template_entry *entry, int violation,
struct inode *inode,
const unsigned char *filename, int pcr);
void ima_free_template_entry(struct ima_template_entry *entry);
-const char *ima_d_path(const struct path *path, char **pathbuf);
+const char *ima_d_path(const struct path *path, char **pathbuf, char *filename);
/* IMA policy related functions */
int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask,