]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selinux: enable setting security context in cgroup
authorAlexey Kodanev <alexey.kodanev@oracle.com>
Wed, 26 Aug 2015 18:56:55 +0000 (11:56 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Wed, 26 Aug 2015 18:56:55 +0000 (11:56 -0700)
Orabug: 21295765

cgroup uses kernfs that has 'security.*' setxattr handler. But setxattr
with 'security.selinux' name returns EOPNOTSUPP, i.e. SBLABEL_MNT
not set on the cgroup filesystem.

Fix it by adding 'cgroup' type to genfs special handling list.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
security/selinux/hooks.c

index 7dade28affba5a0ebc0944be49dbd59dbf5c8761..91276c28e0f002836ebaed27c075d03239526d1c 100644 (file)
@@ -404,6 +404,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
                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, "cgroup") ||
                !strcmp(sb->s_type->name, "sysfs") ||
                !strcmp(sb->s_type->name, "pstore") ||
                !strcmp(sb->s_type->name, "debugfs") ||