diff options
author | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2014-05-07 16:22:40 +0300 |
---|---|---|
committer | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2014-10-01 13:30:58 +0300 |
commit | a42b11d78befe0ff668eb9a73e45c908eed1bb77 (patch) | |
tree | f38c70345a0eed6438eaf3125dd6e936b6415258 | |
parent | 9f88c2df39982ff83149c5471852e042c125b81e (diff) | |
download | linux-digsig-ima-directories.tar.gz |
ima: return dentry name if mnt is NULLima-directories
This patch returns dentry name if mnt is NULL.
Symbolic links checking hook does not have mnt.
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
-rw-r--r-- | security/integrity/ima/ima_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c index 250c3c0cdc0015..af30ac80262792 100644 --- a/security/integrity/ima/ima_api.c +++ b/security/integrity/ima/ima_api.c @@ -324,9 +324,12 @@ void ima_audit_measurement(struct integrity_iint_cache *iint, const char *ima_d_path(struct path *path, char **pathbuf) { char *pathname = NULL; + struct dentry *dentry = path->dentry; - if (!path->mnt) + if (!dentry) return NULL; + if (!path->mnt) + goto out; *pathbuf = __getname(); if (*pathbuf) { @@ -337,5 +340,6 @@ const char *ima_d_path(struct path *path, char **pathbuf) pathname = NULL; } } - return pathname ?: (const char *)path->dentry->d_name.name; +out: + return pathname ?: (const char *)dentry->d_name.name; } |