Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
pstore: selinux: add security in-core xattr support for rootfs, pstor…
Browse files Browse the repository at this point in the history
…e and debugfs

- add "rootfs", "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 2294d49)

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 18917345
Bug: 18935184
Change-Id: Ib648f30ce4b5d6c96f11465836d6fee89bec1c72
  • Loading branch information
Mark Salyzyn committed Jan 15, 2015
1 parent 28207c2 commit 563897d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions security/selinux/hooks.c
Expand Up @@ -419,8 +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)
/* 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. */
Expand Down

0 comments on commit 563897d

Please sign in to comment.