linux/security/selinux
Eric Paris 811f379927 SELinux: allow fstype unknown to policy to use xattrs if present
Currently if a FS is mounted for which SELinux policy does not define an
fs_use_* that FS will either be genfs labeled or not labeled at all.
This decision is based on the existence of a genfscon rule in policy and
is irrespective of the capabilities of the filesystem itself.  This
patch allows the kernel to check if the filesystem supports security
xattrs and if so will use those if there is no fs_use_* rule in policy.
An fstype with a no fs_use_* rule but with a genfs rule will use xattrs
if available and will follow the genfs rule.

This can be particularly interesting for things like ecryptfs which
actually overlays a real underlying FS.  If we define excryptfs in
policy to use xattrs we will likely get this wrong at times, so with
this path we just don't need to define it!

Overlay ecryptfs on top of NFS with no xattr support:
SELinux: initialized (dev ecryptfs, type ecryptfs), uses genfs_contexts
Overlay ecryptfs on top of ext4 with xattr support:
SELinux: initialized (dev ecryptfs, type ecryptfs), uses xattr

It is also useful as the kernel adds new FS we don't need to add them in
policy if they support xattrs and that is how we want to handle them.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
2008-07-14 15:02:04 +10:00
..
include SELinux: allow fstype unknown to policy to use xattrs if present 2008-07-14 15:02:04 +10:00
ss SELinux: allow fstype unknown to policy to use xattrs if present 2008-07-14 15:02:04 +10:00
Kconfig selinux: introduce permissive types 2008-04-18 20:26:11 +10:00
Makefile SELinux: Add network port SID cache 2008-04-18 20:26:16 +10:00
avc.c Audit: standardize string audit interfaces 2008-04-28 06:19:22 -04:00
exports.c SELinux: remove redundant exports 2008-04-19 09:52:36 +10:00
hooks.c SELinux: allow fstype unknown to policy to use xattrs if present 2008-07-14 15:02:04 +10:00
netif.c SELinux fixups needed for preemptable RCU from -rt 2008-04-22 15:37:23 +10:00
netlabel.c SELinux: netlabel.c whitespace, syntax, and static declaraction cleanups 2008-04-21 19:05:04 +10:00
netlink.c SELinux: netlink.c whitespace, syntax, and static declaraction cleanups 2008-04-21 19:05:05 +10:00
netnode.c SELinux: keep the code clean formating and syntax 2008-07-14 15:01:36 +10:00
netport.c SELinux: keep the code clean formating and syntax 2008-07-14 15:01:36 +10:00
nlmsgtab.c SELinux: nlmsgtab.c whitespace, syntax, and static declaraction cleanups 2008-04-21 19:05:07 +10:00
selinuxfs.c SELinux: more user friendly unknown handling printk 2008-07-14 15:02:00 +10:00
xfrm.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 2008-04-21 16:01:40 -07:00