summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/selinux/hooks.c3
-rw-r--r--security/selinux/include/security.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 0d4408debb45..c156f5eb1aea 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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) {
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 004a2479880f..7aad3a1389d1 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -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