OSDN Git Service

Merge tag 'v4.0.8' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
[android-x86/kernel.git] / security / selinux / hooks.c
index 2588e08..9029a54 100644 (file)
@@ -453,6 +453,13 @@ static int sb_finish_set_opts(struct super_block *sb)
        if (selinux_is_sblabel_mnt(sb))
                sbsec->flags |= SBLABEL_MNT;
 
+       /*
+        * 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)
+               sbsec->flags |= SE_SBLABELSUPP;
+
        /* Initialize the root inode. */
        rc = inode_doinit_with_dentry(root_inode, root);