From: "NeilBrown" <neilb@suse.de>
To: "Tetsuo Handa" <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: miklos@szeredi.hu, viro@zeniv.linux.org.uk, haveblue@us.ibm.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, hch@infradead.org,
linux-security-module@vger.kernel.org, jmorris@namei.org
Subject: Re: r-o bind in nfsd
Date: Wed, 26 Mar 2008 09:32:08 +1100 (EST) [thread overview]
Message-ID: <57096.192.168.1.70.1206484328.squirrel@neil.brown.name> (raw)
In-Reply-To: <200803252045.CGB04105.HLSQFOJMtOFVOF@I-love.SAKURA.ne.jp>
On Tue, March 25, 2008 10:45 pm, Tetsuo Handa wrote:
> Hello.
>
>> Maybe some enhancement to the 'intent' structure with a similar
>> effect could be done instead.
>>
>> Then you could, presumably, put a security hook somewhere in
>> link_path_walk for those modules (like AppArmor) which want to do
>> checks based on the namespace.
>
> I think link_path_walk() is not a good place to insert new LSM hooks
> for pathname based access control (AppArmor and TOMOYO) purpose because
>
> (1) The kernel don't know what operation (open/create/truncate etc.)
> will be
> done at the moment of link_path_walk().
Though the 'indent' data structure could be used to carry this information.
>
> (2) Not all operations call link_path_walk() before these operations
> are done. For example, ftruncate() doesn't call link_path_walk().
But do you want to impose path-name based controls to ftruncate?
Surely once you have a file open for write (not O_APPEND), then no
other permission is required to truncate the file, is it?
If it is, then maybe the 'struct file' should be tagged at open time
to say whether 'truncate' is allowed.
>
> (3) The rename() and link() operations handle two pathnames.
> But, it is not possible to know both pathnames at the moment of
> link_path_walk().
Not an insolvable problem.
One could imagine an implementation where a TYPE_RENAME_FROM security
check produced a cookie that was consumed by a TYPE_RENAME_TO security
check. The cookie could then be used by the security module to
make any connection between the two names that might be appropriate.
>
> I think we need to introduce new LSM hooks outside link_path_walk().
> http://kerneltrap.org/mailarchive/linux-fsdevel/2008/2/17/882024
>
<rant>
I suspect we would be much better off removing all the security hooks.
Security done at that level seems to be way too complex such that most
people don't really understand it. And people who don't understand
security don't use it.
We'd be much better off getting rid of the whole "micro-manage security"
concept and provide isolation via some sort of high level container
approach.
</rant>
NeilBrown
next prev parent reply other threads:[~2008-03-25 22:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-21 14:59 Miklos Szeredi
2008-03-21 15:54 ` Al Viro
2008-03-21 16:24 ` Miklos Szeredi
2008-03-21 16:35 ` Al Viro
2008-03-21 16:54 ` Miklos Szeredi
2008-03-21 17:08 ` Miklos Szeredi
2008-03-21 18:11 ` Al Viro
2008-03-21 18:52 ` Miklos Szeredi
2008-03-21 19:49 ` Al Viro
2008-03-21 20:23 ` Miklos Szeredi
2008-03-22 2:20 ` Tetsuo Handa
2008-03-21 21:08 ` Dave Hansen
2008-03-21 21:17 ` Miklos Szeredi
2008-03-25 2:52 ` Neil Brown
2008-03-25 11:45 ` Tetsuo Handa
2008-03-25 22:32 ` NeilBrown [this message]
[not found] ` <20080325224919.GM10722@ZenIV.linux.org.uk>
2008-03-25 23:29 ` NeilBrown
2008-03-26 12:04 ` Stephen Smalley
2008-03-26 16:47 ` Serge E. Hallyn
2008-03-26 21:35 ` James Morris
2008-03-27 0:29 ` Serge E. Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57096.192.168.1.70.1206484328.squirrel@neil.brown.name \
--to=neilb@suse.de \
--cc=akpm@linux-foundation.org \
--cc=haveblue@us.ibm.com \
--cc=hch@infradead.org \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®