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

From: John Johansen
Date: Tue Dec 06 2011 - 19:09:20 EST


On 12/06/2011 03:45 PM, Linus Torvalds wrote:
> On Tue, Dec 6, 2011 at 3:12 PM, John Johansen
> <john.johansen@xxxxxxxxxxxxx> wrote:
>>
>> What we want to know is if we missed the supplied root, so that we don't
>> mediate off of that path. And it would be nice to get a partial path for
>> the purposes of logging, so that there is some guidance on how to update
>> policy.
>
> How about this change:
> - don't change 'root' (and mark it const)
> - if we hit the expected root, we're all happy and do what we do now
> - if we hit some *unexpected* root (the "global root") add a '?' or
> something at the head of the path.
>
> End result: callers like getcwd() can trivially replace their current
> "path_equal(&tmp,&root)" (or whatever they do) with just checking the
> first character of the end result. A good path always starts with '/'.
>
> Something kind of like this (this does *not* change apparmor or tomoyo
> - I didn't even look at those uses).
>
yes this would give apparmor what it needs. We would still have to break
one chroot case, until our labeling is properly updated. But its insane
to plan the api around that case as it is hardly used and a proper solution
for that case is in the works.

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