X-Git-Url: https://git.openfabrics.org/?p=~shefty%2Frdma-dev.git;a=blobdiff_plain;f=security%2Ftomoyo%2Frealpath.c;h=d9f3ced8756ec4dc87492b8edecf172375843f5d;hp=36fa7c9bedc40b4ce8f4d7db9e03f7438802078d;hb=1418a3e5ad4d01b1d4abf2c479c50b0cedd59e3f;hpb=34a9d2c39afe74a941b9e88efe2762afc4d82443 diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c index 36fa7c9bedc..d9f3ced8756 100644 --- a/security/tomoyo/realpath.c +++ b/security/tomoyo/realpath.c @@ -293,8 +293,16 @@ char *tomoyo_realpath_from_path(struct path *path) pos = tomoyo_get_local_path(path->dentry, buf, buf_len - 1); /* Get absolute name for the rest. */ - else + else { pos = tomoyo_get_absolute_path(path, buf, buf_len - 1); + /* + * Fall back to local name if absolute name is not + * available. + */ + if (pos == ERR_PTR(-EINVAL)) + pos = tomoyo_get_local_path(path->dentry, buf, + buf_len - 1); + } encode: if (IS_ERR(pos)) continue;