]> Pileus Git - ~andy/linux/commitdiff
Revert "SELinux: do not handle seclabel as a special flag"
authorEric Paris <eparis@redhat.com>
Wed, 28 Aug 2013 17:32:42 +0000 (13:32 -0400)
committerEric Paris <eparis@redhat.com>
Wed, 28 Aug 2013 18:45:21 +0000 (14:45 -0400)
This reverts commit 308ab70c465d97cf7e3168961dfd365535de21a6.

It breaks my FC6 test box.  /dev/pts is not mounted.  dmesg says

SELinux: mount invalid.  Same superblock, different security settings
for (dev devpts, type devpts)

Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
security/selinux/hooks.c
security/selinux/include/security.h

index 0d4408debb457e684b44fb54f41d1eb60d879004..c156f5eb1aea26b7b4d8b281e32974563f281449 100644 (file)
@@ -504,6 +504,9 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
                        opts->num_mnt_opts++;
                tmp >>= 1;
        }
+       /* Check if the Label support flag is set */
+       if (sbsec->flags & SBLABEL_MNT)
+               opts->num_mnt_opts++;
 
        opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC);
        if (!opts->mnt_opts) {
index 004a2479880f8baee25b85df00fee249886a2bd5..7aad3a1389d155d0f5f1bfc209264df5f0d9b0e9 100644 (file)
@@ -43,7 +43,7 @@
 #endif
 
 /* Mask for just the mount related flags */
-#define SE_MNTMASK     0x1f
+#define SE_MNTMASK     0x0f
 /* Super block security struct flags for mount options */
 /* BE CAREFUL, these need to be the low order bits for selinux_get_mnt_opts */
 #define CONTEXT_MNT    0x01