Re: [git pull] apparmor fix for __d_path() misuse

From: Al Viro
Date: Tue Dec 06 2011 - 20:23:18 EST


On Tue, Dec 06, 2011 at 05:11:59PM -0800, Linus Torvalds wrote:

> It's
> *some* kind of root, but that's just about all the relevant
> information you'd ever want to know.

Damnit, it may very well be NOT ANY KIND OF ROOT AT ALL. Which is what
I'd been trying to tell you all along. You can race with umount -l.
In that case that thing might have been *INSIDE* your chroot jail.
Anywhere in it.

We raced with umount -l /mnt. And what would be /mnt/1/2/foo/bar/baz
had shown up as /foo/bar/baz. A few cycles earlier or later it could
be /1/2/foo/bar/baz or /bar/baz. And you are not in chroot jail at
all. _That_ is what I have trouble with. Because that sysadmin will
misinterpret it exactly the way you have...

See what I'm talking about? I'm fine with giving the pathname to global
root. It's doing that to *random* just-unmounted vfsmount that is not
a good thing.

And yes, we can avoid returning that struct vfsmount *. Fortunately.
See the posting in another branch of that thread for details.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/