]> Pileus Git - ~andy/linux/commitdiff
SELinux: renumber the superblock options
authorEric Paris <eparis@redhat.com>
Tue, 9 Oct 2012 20:20:08 +0000 (16:20 -0400)
committerEric Paris <eparis@redhat.com>
Thu, 25 Jul 2013 17:03:06 +0000 (13:03 -0400)
Just to make it clear that we have mount time options and flags,
separate them.  Since I decided to move the non-mount options above
above 0x10, we need a short instead of a char.  (x86 padding says
this takes up no additional space as we have a 3byte whole in the
structure)

Signed-off-by: Eric Paris <eparis@redhat.com>
security/selinux/include/objsec.h
security/selinux/include/security.h

index aa47bcabb5f65e728aadbaa39cdecfa55d20aa16..fe99f64a1d545bee52a0307ca1c100e101256a1d 100644 (file)
@@ -59,7 +59,7 @@ struct superblock_security_struct {
        u32 def_sid;                    /* default SID for labeling */
        u32 mntpoint_sid;               /* SECURITY_FS_USE_MNTPOINT context for files */
        unsigned int behavior;          /* labeling behavior */
-       unsigned char flags;            /* which mount options were specified */
+       unsigned short flags;           /* which mount options were specified */
        struct mutex lock;
        struct list_head isec_head;
        spinlock_t isec_lock;
index 7ec750609cca2e37f9e4f01d02e97f79fe5afd43..9c424d8bd2e05d501e8c79b62c7abd9fafdbfb9d 100644 (file)
 /* Mask for just the mount related flags */
 #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
 #define FSCONTEXT_MNT  0x02
 #define ROOTCONTEXT_MNT        0x04
 #define DEFCONTEXT_MNT 0x08
+#define SBLABEL_MNT    0x10
 /* Non-mount related flags */
-#define SE_SBINITIALIZED       0x10
-#define SE_SBPROC              0x20
-#define SBLABEL_MNT    0x40
+#define SE_SBINITIALIZED       0x0100
+#define SE_SBPROC              0x0200
 
 #define CONTEXT_STR    "context="
 #define FSCONTEXT_STR  "fscontext="