aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-01-07 09:27:15 -0800
committerZiyan <jaraidaniel@gmail.com>2016-03-11 16:02:03 +0100
commit1f6ff017cc2b10acf4ef4019684e4f3e07480f08 (patch)
tree4dd70113842a1022169040d513652961ff25c991 /security
parentff7200ace139986a76c4f03f8a45478914dbb559 (diff)
downloadkernel_samsung_espresso10-1f6ff017cc2b10acf4ef4019684e4f3e07480f08.zip
kernel_samsung_espresso10-1f6ff017cc2b10acf4ef4019684e4f3e07480f08.tar.gz
kernel_samsung_espresso10-1f6ff017cc2b10acf4ef4019684e4f3e07480f08.tar.bz2
pstore: selinux: add security in-core xattr support for pstore and debugfs
- add "pstore" and "debugfs" to list of in-core exceptions - change fstype checks to boolean equation - change from strncmp to strcmp for checking (Cherry Pick from commit 2294d499b7969df3838becf5e58bf16b0e3c86c8) Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 18917345 Bug: 18935184 Change-Id: Ib648f30ce4b5d6c96f11465836d6fee89bec1c72
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index edc6e80..90ce023 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -419,15 +419,11 @@ static int sb_finish_set_opts(struct super_block *sb)
sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
sbsec->flags &= ~SE_SBLABELSUPP;
- /* Special handling for sysfs. Is genfs but also has setxattr handler*/
- if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 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)
+ /* Special handling. Is genfs but also has in-core setxattr handler*/
+ if (!strcmp(sb->s_type->name, "sysfs") ||
+ !strcmp(sb->s_type->name, "pstore") ||
+ !strcmp(sb->s_type->name, "debugfs") ||
+ !strcmp(sb->s_type->name, "rootfs"))
sbsec->flags |= SE_SBLABELSUPP;
/* Initialize the root inode. */