All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: David Howells <dhowells@redhat.com>,
	torvalds@osdl.org, viro@ftp.linux.org.uk
Cc: 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: Wed, 15 Aug 2007 09:23:22 -0700 (PDT)	[thread overview]
Message-ID: <45343.31878.qm@web36610.mail.mud.yahoo.com> (raw)
In-Reply-To: <29015.1187178055@redhat.com>


--- David Howells <dhowells@redhat.com> wrote:

> 
> Hi Linus, Al,
> 
> Would you object greatly to functions like vfs_mkdir() gaining a security
> parameter?

Could you describe how this compares to the proposal that the
AppArmor developers suggested recently? I expect that we can 
reduce the amount of discussion required, and maybe avoid some
confusion if you could do that.

Thank you.

> What I'm thinking of is this:
> 
> 	int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode,
> 		      struct security *security)
> 
> Where the security context is the state of the context at the time the call
> was issued:
> 
> 	struct security {
> 		uid_t			fsuid;
> 		git_t			fsgid;
> 		struct group_info	*group_info;
> 		void			*security;
> 		struct key		*session_keyring;
> 		struct key		*process_keyring;
> 		struct key		*thread_keyring;
> 
> And perhaps:
> 
> 		struct audit_context	*audit_context;
> 		seccomp_t		seccomp;
> 	};
> 
> This would, for the most part, be a temporary affair, being set up by such as
> sys_mkdir()/sys_mkdirat() from data held in task_struct.
> 
> This information would then be passed into the filesystem and LSM layers so
> that files, directories, etc. can be created, opened, deleted, or otherwise
> mangled based on these security items, rather than the one in whichever
> task_struct is current.
> 
> 
> The reason for doing this would be to support an act-as interface, so that
> services such as nfsd and cachefiles could act with different security
> details
> to the ones attached to the task.  This would have a couple of potential
> benefits:
> 
>  (1) nfsd threads don't have to keep changing their security contexts.
> 
>  (2) cachefiles can act on behalf of a process without changing its security
>      context.
> 
> 
> Note that I/O operations such as read, write and ioctl would *not* be passed
> this data as the file struct should contain the relevant security
> information.
> Similarly, page I/O operations would also not need alteration as the VMA
> covering the region points to a file struct, which holds the appropriate
> security.
> 
> David
> 
> 
> 


Casey Schaufler
casey@schaufler-ca.com

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

WARNING: multiple messages have this Message-ID (diff)
From: Casey Schaufler <casey@schaufler-ca.com>
To: David Howells <dhowells@redhat.com>,
	torvalds@osdl.org, viro@ftp.linux.org.uk
Cc: 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: Wed, 15 Aug 2007 09:23:22 -0700 (PDT)	[thread overview]
Message-ID: <45343.31878.qm@web36610.mail.mud.yahoo.com> (raw)
In-Reply-To: <29015.1187178055@redhat.com>


--- David Howells <dhowells@redhat.com> wrote:

> 
> Hi Linus, Al,
> 
> Would you object greatly to functions like vfs_mkdir() gaining a security
> parameter?

Could you describe how this compares to the proposal that the
AppArmor developers suggested recently? I expect that we can 
reduce the amount of discussion required, and maybe avoid some
confusion if you could do that.

Thank you.

> What I'm thinking of is this:
> 
> 	int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode,
> 		      struct security *security)
> 
> Where the security context is the state of the context at the time the call
> was issued:
> 
> 	struct security {
> 		uid_t			fsuid;
> 		git_t			fsgid;
> 		struct group_info	*group_info;
> 		void			*security;
> 		struct key		*session_keyring;
> 		struct key		*process_keyring;
> 		struct key		*thread_keyring;
> 
> And perhaps:
> 
> 		struct audit_context	*audit_context;
> 		seccomp_t		seccomp;
> 	};
> 
> This would, for the most part, be a temporary affair, being set up by such as
> sys_mkdir()/sys_mkdirat() from data held in task_struct.
> 
> This information would then be passed into the filesystem and LSM layers so
> that files, directories, etc. can be created, opened, deleted, or otherwise
> mangled based on these security items, rather than the one in whichever
> task_struct is current.
> 
> 
> The reason for doing this would be to support an act-as interface, so that
> services such as nfsd and cachefiles could act with different security
> details
> to the ones attached to the task.  This would have a couple of potential
> benefits:
> 
>  (1) nfsd threads don't have to keep changing their security contexts.
> 
>  (2) cachefiles can act on behalf of a process without changing its security
>      context.
> 
> 
> Note that I/O operations such as read, write and ioctl would *not* be passed
> this data as the file struct should contain the relevant security
> information.
> Similarly, page I/O operations would also not need alteration as the VMA
> covering the region points to a file struct, which holds the appropriate
> security.
> 
> David
> 
> 
> 


Casey Schaufler
casey@schaufler-ca.com

  reply	other threads:[~2007-08-15 16:23 UTC|newest]

Thread overview: 16+ 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 11:40 ` David Howells
2007-08-15 11:40 ` David Howells
2007-08-15 16:23 ` Casey Schaufler [this message]
2007-08-15 16:23   ` Casey Schaufler
2007-08-15 16:52   ` David Howells
2007-08-15 16:52     ` David Howells
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
2007-08-17 18:05     ` Andreas Gruenbacher
2007-08-20 12:09   ` David Howells
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=45343.31878.qm@web36610.mail.mud.yahoo.com \
    --to=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@osdl.org \
    --cc=viro@ftp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.