Skip to content

Commit 44672e4

Browse files
Nick PigginAl Viro
authored andcommitted
apparmor: use task path helpers
apparmor: use task path helpers Signed-off-by: Nick Piggin <npiggin@kernel.dk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent baa0389 commit 44672e4

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎security/apparmor/path.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,14 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
6262
int deleted, connected;
6363
int error = 0;
6464

65-
/* Get the root we want to resolve too */
65+
/* Get the root we want to resolve too, released below */
6666
if (flags & PATH_CHROOT_REL) {
6767
/* resolve paths relative to chroot */
68-
read_lock(&current->fs->lock);
69-
root = current->fs->root;
70-
/* released below */
71-
path_get(&root);
72-
read_unlock(&current->fs->lock);
68+
get_fs_root(current->fs, &root);
7369
} else {
7470
/* resolve paths relative to namespace */
7571
root.mnt = current->nsproxy->mnt_ns->root;
7672
root.dentry = root.mnt->mnt_root;
77-
/* released below */
7873
path_get(&root);
7974
}
8075

0 commit comments

Comments
 (0)