Skip to content

Commit

Permalink
selinux: allow per-file labeling for cgroupfs
Browse files Browse the repository at this point in the history
This patch allows genfscon per-file labeling for cgroupfs. For instance,
this allows to label the "release_agent" file within each
cgroup mount and limit writes to it.

Signed-off-by: Antonio Murdaca <[email protected]>
[PM: subject line and merge tweaks]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
runcom authored and pcmoore committed Aug 22, 2017
1 parent 5d72801 commit 901ef84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,9 @@ static int selinux_set_mnt_opts(struct super_block *sb,
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"))
!strcmp(sb->s_type->name, "pstore") ||
!strcmp(sb->s_type->name, "cgroup") ||
!strcmp(sb->s_type->name, "cgroup2"))
sbsec->flags |= SE_SBGENFS;

if (!sbsec->behavior) {
Expand Down

0 comments on commit 901ef84

Please sign in to comment.