Merge tag 'char-misc-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[sfrench/cifs-2.6.git] / security / selinux / hooks.c
index 9d984bfb978bcee8d145a74afe1ca27136a2499b..29c39e0b03ed7e3048d5fed858f31d40dc2f8d3d 100644 (file)
@@ -401,23 +401,14 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
 {
        struct superblock_security_struct *sbsec = sb->s_security;
 
-       if (sbsec->behavior == SECURITY_FS_USE_XATTR ||
-           sbsec->behavior == SECURITY_FS_USE_TRANS ||
-           sbsec->behavior == SECURITY_FS_USE_TASK)
-               return 1;
-
-       /* Special handling for sysfs. Is genfs but also has setxattr handler*/
-       if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0)
-               return 1;
-
-       /*
-        * Special handling for rootfs. Is genfs but supports
-        * setting SELinux context on in-core inodes.
-        */
-       if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0)
-               return 1;
-
-       return 0;
+       return sbsec->behavior == SECURITY_FS_USE_XATTR ||
+               sbsec->behavior == SECURITY_FS_USE_TRANS ||
+               sbsec->behavior == SECURITY_FS_USE_TASK ||
+               /* Special handling. Genfs but also in-core setxattr handler */
+               !strcmp(sb->s_type->name, "sysfs") ||
+               !strcmp(sb->s_type->name, "pstore") ||
+               !strcmp(sb->s_type->name, "debugfs") ||
+               !strcmp(sb->s_type->name, "rootfs");
 }
 
 static int sb_finish_set_opts(struct super_block *sb)
@@ -456,10 +447,6 @@ static int sb_finish_set_opts(struct super_block *sb)
        if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
                printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
                       sb->s_id, sb->s_type->name);
-       else
-               printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
-                      sb->s_id, sb->s_type->name,
-                      labeling_behaviors[sbsec->behavior-1]);
 
        sbsec->flags |= SE_SBINITIALIZED;
        if (selinux_is_sblabel_mnt(sb))