lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git pull] apparmor fix for __d_path() misuse
On Tue, Dec 06, 2011 at 02:19:08PM -0800, John Johansen wrote:
> On 12/06/2011 01:07 PM, Linus Torvalds wrote:
> > On Tue, Dec 6, 2011 at 12:53 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >>
> >> The trouble is, might very well stop *NOT* at the global root. Consider
> >> a race with umount -l; we have no way to tell "it had been outside of
> >> chroot jail" from "it had walked up to the place where ->mnt_parent had
> >> been already reset, sorry, no idea what it was".
> >
> > Sure, but you made that case return NULL already as part of the "no
> > bastard" case, didn't you?
> >
> > That part of the patch looked fine.
> >
> > It was just the extra convolutions around 'bastard' that seemed to be
> > over-designed, and made for just a single use that seems very
> > peripheral anyway.
> >
> it is, and the plan is to not need the bastard even. What apparmor should
> be doing is lazy labeling the live objects, and anything that is disconnected
> is evaluated based on the previous labeling.

I still don't understand how you deal with objects seen by processes in
different namespaces. Please, explain lazy labeling in details...

You do realize that there's no hope whatsoever for prohibiting access
to struct file opened in parent's namespace and already written into
there, right?

> This will also remove its
> use of passing root = { NULL, NULL } to __d_path.

One word: tomoyo... You are not the only weird one. They want an absolute
pathname and don't care about races with umount. Whatever it's relative
to, the thing just goes ahead and plays with itse^Wthe string it got. As
long as they are not dereferencing pointers to free objects, I Don't Want To
Know(tm).

> Right now we could drop the bastard parameter and passing root = { NULL, NULL }

OK, please tell me what do you need from __d_path(). Suppose it has missed
the supplied root; what do you want to know about the place it had stopped
in? If we don't do extra arguments, we are limited by this:
* some condition is checked by __d_path(); if it's satisfied,
pointer to relative pathname (based hell-knows-where) is returned as
usual; we *can't* tell that from normal "reached root, here's your
pathname" case.
* if it isn't satisfied, we return NULL. No relative pathname
to look at, etc.

Unless you are OK with what __d_path(path, root, NULL, buf, buflen) is doing
with this patch, we'd need to split it; seq_path_root()/show_mountinfo()
requirements leave no wiggling space for case root->mnt != NULL,
bastard == NULL.


\
 
 \ /
  Last update: 2011-12-06 23:43    [W:0.054 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site