[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwn=n5H_PuaRhnVPpMtfeig8nSi+Wj4Yzv6VBdjkUBEjw@mail.gmail.com>
Date: Tue, 6 Dec 2011 15:45:15 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: John Johansen <john.johansen@...onical.com>
Cc: Al Viro <viro@...iv.linux.org.uk>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [git pull] apparmor fix for __d_path() misuse
On Tue, Dec 6, 2011 at 3:12 PM, John Johansen
<john.johansen@...onical.com> 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).
Comments?
Linus
View attachment "patch.diff" of type "text/x-patch" (4304 bytes)
Powered by blists - more mailing lists