All of lore.kernel.org
 help / color / mirror / Atom feed
* Strange Associate bug
@ 2004-09-17 19:52 Daniel J Walsh
  2004-09-17 20:06 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel J Walsh @ 2004-09-17 19:52 UTC (permalink / raw)
  To: Stephen Smalley, SE Linux

If I mount an NFS filesystem and then try to move a file to it,
I get permission denied and end up with an associate error

 >mount remote:/vol/vol1/home /mnt/dwalsh
 >touch /home/dwalsh/foo
 >mv /home/dwalsh/foo /mnt/dwalsh
mv: cannot create regular file `./foo': Permission denied
Sep 17 15:48:19 celtics kernel: audit(1095450499.359:0): avc:  denied  { 
associate } for  pid=19797 exe=/bin/mv name=foo 
scontext=user_u:object_r:user_home_t tcontext=system_u:object_r:nfs_t 
tclass=filesystem

allow user_home_t nfs_t:filesystem { associate };

Do I need to change mv to be able to handle this or do we need

allow domain nfs_t:filesystem associate;

Dan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Strange Associate bug
  2004-09-17 19:52 Strange Associate bug Daniel J Walsh
@ 2004-09-17 20:06 ` Stephen Smalley
  2004-09-18  7:51   ` Colin Walters
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2004-09-17 20:06 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SE Linux, James Morris

On Fri, 2004-09-17 at 15:52, Daniel J Walsh wrote:
> If I mount an NFS filesystem and then try to move a file to it,
> I get permission denied and end up with an associate error
> 
>  >mount remote:/vol/vol1/home /mnt/dwalsh
>  >touch /home/dwalsh/foo
>  >mv /home/dwalsh/foo /mnt/dwalsh
> mv: cannot create regular file `./foo': Permission denied
> Sep 17 15:48:19 celtics kernel: audit(1095450499.359:0): avc:  denied  { 
> associate } for  pid=19797 exe=/bin/mv name=foo 
> scontext=user_u:object_r:user_home_t tcontext=system_u:object_r:nfs_t 
> tclass=filesystem
> 
> allow user_home_t nfs_t:filesystem { associate };
> 
> Do I need to change mv to be able to handle this or do we need
> 
> allow domain nfs_t:filesystem associate;

You mean:
allow file_type nfs_t:filesystem associate;

Options are:
1) Change the kernel code to ignore the fscreate context when the
filesystem uses genfs_contexts, similar to the existing mount context=
handling, or
2) Change mv to reset the fscreate context to NULL and retry if the file
creation fails with EACCES, thereby falling back to the default labeling
behavior,
3) Allow the association, as above.

Allowing the association is a bit misleading, because the file is going
to revert to the base type ultimately, even if the incore inode happens
to be temporarily labeled with the fscreate context.

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Strange Associate bug
  2004-09-17 20:06 ` Stephen Smalley
@ 2004-09-18  7:51   ` Colin Walters
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Walters @ 2004-09-18  7:51 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: Daniel J Walsh, SE Linux, James Morris

On Fri, 2004-09-17 at 16:06 -0400, Stephen Smalley wrote:

> Options are:
> 1) Change the kernel code to ignore the fscreate context when the
> filesystem uses genfs_contexts, similar to the existing mount context=
> handling, or
> 2) Change mv to reset the fscreate context to NULL and retry if the file
> creation fails with EACCES, thereby falling back to the default labeling
> behavior,

What about:

2a) Change the kernel to return EOPNOTSUPP if fscreate context is non-
NULL for a genfs filesystem, and change mv to retry with NULL if the
operation fails with EOPNOTSUPP, but also print a warning.

> 3) Allow the association, as above.
> 
> Allowing the association is a bit misleading, because the file is going
> to revert to the base type ultimately, even if the incore inode happens
> to be temporarily labeled with the fscreate context.

Yeah, that sounds bad.



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-18  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-17 19:52 Strange Associate bug Daniel J Walsh
2004-09-17 20:06 ` Stephen Smalley
2004-09-18  7:51   ` Colin Walters

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.