* [PATCH] selinux: enable setting security context in cgroup
@ 2015-06-18 16:33 Alexey Kodanev
2015-06-18 16:43 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kodanev @ 2015-06-18 16:33 UTC (permalink / raw)
To: linux-security-module
Cc: Paul Moore, Stephen Smalley, Eric Paris, cgroups, Vasily Isaenko,
Alexey Kodanev
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>
---
security/selinux/hooks.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 7dade28..91276c2 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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") ||
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selinux: enable setting security context in cgroup
2015-06-18 16:33 [PATCH] selinux: enable setting security context in cgroup Alexey Kodanev
@ 2015-06-18 16:43 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2015-06-18 16:43 UTC (permalink / raw)
To: Alexey Kodanev, linux-security-module
Cc: Paul Moore, Eric Paris, cgroups, Vasily Isaenko
On 06/18/2015 12:33 PM, Alexey Kodanev wrote:
> 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>
> ---
> security/selinux/hooks.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 7dade28..91276c2 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -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") ||
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-18 16:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 16:33 [PATCH] selinux: enable setting security context in cgroup Alexey Kodanev
2015-06-18 16:43 ` Stephen Smalley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.