mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
TOMOYO: Fix pathname handling of disconnected paths.
Current tomoyo_realpath_from_path() implementation returns strange pathname
when calculating pathname of a file which belongs to lazy unmounted tree.
Use local pathname rather than strange absolute pathname in that case.
Also, this patch fixes a regression by commit 02125a82 "fix apparmor
dereferencing potentially freed dentry, sanitize __d_path() API".
Signed-off-by: Tetsuo Handa <[email protected]>
Acked-by: Al Viro <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
34a9d2c39a
commit
1418a3e5ad
1 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue