]> git.hungrycats.org Git - linux/commitdiff
[PATCH] selinux: Allow non-root processes to read selinuxfs enforce node
authorAndrew Morton <akpm@osdl.org>
Mon, 16 Feb 2004 02:06:16 +0000 (18:06 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 16 Feb 2004 02:06:16 +0000 (18:06 -0800)
From: Stephen Smalley <sds@epoch.ncsc.mil>

This patch changes the mode bits on the selinuxfs enforce node so that
non-root processes can read it.  This is necessary to allow non-root
userspace policy enforcers to check the enforcing flag upon a permission
failure as well.  A process must still have the appropriate SELinux
permission in order to read the node.

security/selinux/selinuxfs.c

index 482513614d975abcbf75708ff233df9fe481897c..682fb85010f819f81b9538230a3613c21f96da4a 100644 (file)
@@ -603,7 +603,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
 {
        static struct tree_descr selinux_files[] = {
                [SEL_LOAD] = {"load", &sel_load_ops, S_IRUSR|S_IWUSR},
-               [SEL_ENFORCE] = {"enforce", &sel_enforce_ops, S_IRUSR|S_IWUSR},
+               [SEL_ENFORCE] = {"enforce", &sel_enforce_ops, S_IRUGO|S_IWUSR},
                [SEL_CONTEXT] = {"context", &sel_context_ops, S_IRUGO|S_IWUGO},
                [SEL_ACCESS] = {"access", &transaction_ops, S_IRUGO|S_IWUGO},
                [SEL_CREATE] = {"create", &transaction_ops, S_IRUGO|S_IWUGO},