From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
sds@tycho.nsa.gov, casey@schaufler-ca.com,
linux-fsdevel@vger.kernel.org, nfsv4@linux-nfs.org,
linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov,
linux-security-module@vger.kernel.org
Subject: Re: Adding a security parameter to VFS functions
Date: Fri, 17 Aug 2007 00:34:12 +0100 [thread overview]
Message-ID: <20070816233412.GO21089@ftp.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.0.999.0708161550140.30176@woody.linux-foundation.org>
On Thu, Aug 16, 2007 at 03:57:24PM -0700, Linus Torvalds wrote:
> I personally consider this an affront to everythign that is decent.
>
> Why the *hell* would mkdir() be so magical as to need something like that?
>
> Make it something sane, like a "struct nameidata" instead, and make it at
> least try to look like the path creation that is done by "open()". Or
> create a "struct file *" or something.
No. I agree that mkdir/mknod/etc. should all take the same thing.
*However*, it should not be nameidata or file. Why? Because it
should not contain vfsmount. Object creation should not *care*
where fs is mounted. At all. The same goes for open(), BTW - letting
it see the reference to vfsmount via nameidata is bloody wrong and
I really couldn't care less what kinds of perversions apparmour crowd
might like - pathnames simply do not belong there.
Said that, I agree that we need uniform prototypes for all these guys
and I can see arguments both for and against having creds passed by
reference stored in whatever struct we are passing (for: copy-on-write
refcounted cred objects would almost never have to be modified or
copied and normally we would just pick the current creds reference
from task_struct and assing it to a single field in whatever we pass
instead of nameidata; against: might be conceptually simpler to have
all that data directly in that struct and a helper filling it in).
Which way we do that and which struct we end up passing is a very good
question, but I want to make it very clear: having object creation/removal/
renaming methods[1] depend on which vfsmount we are dealing with is *wrong*.
IOW, I strongly object against the use of nameidata here.
next prev parent reply other threads:[~2007-08-16 23:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 11:40 Adding a security parameter to VFS functions David Howells
2007-08-15 16:23 ` Casey Schaufler
2007-08-15 16:52 ` David Howells
2007-08-16 22:20 ` Andreas Gruenbacher
2007-08-16 22:36 ` Andreas Gruenbacher
2007-08-16 22:57 ` Linus Torvalds
2007-08-16 23:30 ` Kyle Moffett
2007-08-16 23:34 ` Al Viro [this message]
2007-08-17 18:05 ` Andreas Gruenbacher
2007-08-20 12:09 ` David Howells
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=20070816233412.GO21089@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=casey@schaufler-ca.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).