]> git.hungrycats.org Git - linux/commit
[PATCH] SELinux: context mount support - SELinux changes.
authorAndrew Morton <akpm@osdl.org>
Mon, 16 Feb 2004 02:05:39 +0000 (18:05 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 16 Feb 2004 02:05:39 +0000 (18:05 -0800)
commit0ce036428919c8d2519e4af4f3bbeb8f76f05441
tree84da7a1e09761c717773fb52c0ceb346b2bfa635
parent79352ac639fa8df9ef5425b4242dc0de3a569abd
[PATCH] SELinux: context mount support - SELinux changes.

From: James Morris <jmorris@redhat.com>

This patch implements context mount support within SELinux.

Three new mount options are provided:

context=%s
  Label the entire filesystem with the specified security context during
  mount and change the labeling behavior to 'mountpoint labeling'.  The
  /proc/self/attr/fscreate attribute will be ignored for file creation on
  the filesystem, although policy-specified transitions will still work
  normally.  This also sets the aggregate filesystem security context.

fscontext=%s
  Set the label of the aggregate filesystem to the specified security
  context, so that SELinux policy controls over the filesystem itself may
  be reinstated.  Only works for filesystems without EA labeling support,
  and is not valid if 'context' has been specified.

defcontext=%s
  Set the default security context for files created in this filesystem to
  the specified security context (as opposed to the current global default).
  Only works for filesystems without EA labeling support, and is not
  valid if 'context' has been specified.

To set the context or fscontext options, the security policy must specify
appropriate permissions for the filesystem relabelfrom and filesystem
relabelto controls.  For the defcontext option, the filesystem relablefrom
and filesystem assoicate controls are invoked.

The security mount options are parsed out and stripped from the normal
mount option data so that no normal filesystems need to be aware of them.

Filesystems with binary mount option data (e.g. NFS, SMBFS, AFS, Coda)
need to be handled as special cases: only NFS is supprted at this stage
per the previous patch.
security/selinux/hooks.c
security/selinux/include/objsec.h
security/selinux/include/security.h