diff options
| author | Ali Al-Asadi <alasadi56@gmail.com> | 2017-12-25 09:25:31 +0100 |
|---|---|---|
| committer | Ali Al-Asadi <alasadi56@gmail.com> | 2017-12-25 09:25:31 +0100 |
| commit | d419af293a363e09587acb69910104a48dbf3deb (patch) | |
| tree | a8a213e370276be6642c710fe35264558ef918f5 /security/selinux/hooks.c | |
| parent | 87d59c267cf877f59e46981a0b87d05af5a8a65b (diff) | |
| parent | 15c63d8508791a0733c9f0229f75864ad3e99d4e (diff) | |
Merge https://github.com/TeamButter/android_kernel_motorola_msm8952 into o8.1o8.0
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 3dc771cbd3b..60e1a58c544 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -435,6 +435,7 @@ static int sb_finish_set_opts(struct super_block *sb) if (!strcmp(sb->s_type->name, "sysfs") || !strcmp(sb->s_type->name, "pstore") || !strcmp(sb->s_type->name, "debugfs") || + !strcmp(sb->s_type->name, "tracefs") || !strcmp(sb->s_type->name, "rootfs")) sbsec->flags |= SE_SBLABELSUPP; @@ -445,6 +446,13 @@ static int sb_finish_set_opts(struct super_block *sb) if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0) sbsec->flags |= SE_SBLABELSUPP; + /* + * 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); @@ -710,6 +718,7 @@ static int selinux_set_mnt_opts(struct super_block *sb, sbsec->flags |= SE_SBPROC | SE_SBGENFS; if (!strcmp(sb->s_type->name, "debugfs") || + !strcmp(sb->s_type->name, "tracefs") || !strcmp(sb->s_type->name, "sysfs") || !strcmp(sb->s_type->name, "pstore")) sbsec->flags |= SE_SBGENFS; |
