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

From: Linus Torvalds
Date: Tue Dec 06 2011 - 21:22:18 EST


On Tue, Dec 6, 2011 at 5:37 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> Turns out that returning ERR_PTR(-EINVAL) is more convenient.
> All right, here's a variant that does *NOT* return any vfsmount/dentry
> pointers at all.  And it does best-sane-effort wrt returning the pathname;
> i.e. if it *is* something outside of chroot, that absolute pathname is
> what we'll get.

So I don't mind this patch, but I think the d_absolute_path() thing is
actually being a bit too nice to the two users of that new function.

Both users of that are just broken. And I think they should be fixed,
rather than pandered to. Both of them would be better off just
considering the "out of my mountspace" to be an error, rather than
using some random 'absolute' pathname (where "error" might obviously
mean "I will use another strategy entirely for this case").

Afaik, you really are trying to make crazy code continue to work in
ways that I'm not convinced is really required. Now, maybe it's a good
idea for this stage in the -rc process, but my gut feel is that we
could simply have broken it too. JJ seems willing to fix things up for
AppArmor, and I don't know of any big distro that uses Tomoyo, so...

But I don't actually have any real hatred of this patch. It definitely
falls into my acceptable range.

Linus
--
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/