Skip to content

Commit

Permalink
selinux: enable genfscon labeling for tracefs
Browse files Browse the repository at this point in the history
In kernel version 4.1, tracefs was separated from debugfs into its
own filesystem. Prior to this split, files in
/sys/kernel/debug/tracing could be labeled during filesystem
creation using genfscon or later from userspace using setxattr. This
change re-enables support for genfscon labeling.

Signed-off-by: Jeff Vander Stoep <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
jeffvanderstoep authored and pcmoore committed Jun 20, 2017
1 parent 0b4d345 commit 6a39118
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,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;
Expand Down

0 comments on commit 6a39118

Please sign in to comment.