diff options
author | Linus Torvalds | 2011-12-07 08:14:42 -0800 |
---|---|---|
committer | Linus Torvalds | 2011-12-07 08:14:42 -0800 |
commit | 3172f8fe1ca1d432b196efad453c0ceb89302075 (patch) | |
tree | 0b9e8af7ea9ee9883ff1a834357694254200335a /fs/namespace.c | |
parent | b835c0f47f725d864bf2545f10c733b754bb6d51 (diff) | |
parent | 02125a826459a6ad142f8d91c5b6357562f96615 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fix apparmor dereferencing potentially freed dentry, sanitize __d_path() API
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 6d3a1963879b..cfc6d4448aa5 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1048,15 +1048,12 @@ static int show_mountinfo(struct seq_file *m, void *v) if (err) goto out; seq_putc(m, ' '); - seq_path_root(m, &mnt_path, &root, " \t\n\\"); - if (root.mnt != p->root.mnt || root.dentry != p->root.dentry) { - /* - * Mountpoint is outside root, discard that one. Ugly, - * but less so than trying to do that in iterator in a - * race-free way (due to renames). - */ - return SEQ_SKIP; - } + + /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ + err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); + if (err) + goto out; + seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw"); show_mnt_opts(m, mnt); @@ -2776,3 +2773,8 @@ void kern_unmount(struct vfsmount *mnt) } } EXPORT_SYMBOL(kern_unmount); + +bool our_mnt(struct vfsmount *mnt) +{ + return check_mnt(mnt); +} |