security: selinux: allow per-file labelling for binderfs
PATCH 1/1 security: selinux: allow per-file labelling for binderfs
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
--- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
@@ -752,6 +752,7 @@ 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,"binderfs" ) || !strcmp (sb->s_type->name,"pstore" )) sbsec->flags |=SE_SBGENFS ;
Signature · 1 line
2.24.1.735.g03f4e72817-goog
Quoted 8 lines · Hridya Valsaraju
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
Acked-by Mark Salyzyn <[email protected]>Signed-off-by Hridya Valsaraju <[email protected]>
Do you want binderfs to also support userspace labeling of files via setxattr()? If so, you'll want to also add it to selinux_is_genfs_special_handling() as well.
Quoted 17 lines
--- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+)security/selinux/hooks.c +1
-0@@ -752,6 +752,7 @@ 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,"binderfs" ) || !strcmp (sb->s_type->name,"pstore" )) sbsec->flags |=SE_SBGENFS ;
Quoted 7 lines · Stephen Smalley' via kernel-team
Quoted 5 lines · Hridya Valsaraju
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
Quoted 7 lines
Quoted 3 lines
Acked-by Mark Salyzyn <[email protected]>Signed-off-by Hridya Valsaraju <[email protected]>Do you want binderfs to also support userspace labeling of files via
setxattr()? If so, you'll want to also add it toselinux_is_genfs_special_handling()as well.
Thank you for the quick response Stephen :) I cannot think of a use-case for the userspace labelling of files in binderfs via setxattr() as of now. I
will make the change if one comes up!
Thanks,
Hridya
Quoted 22 lines
Quoted 11 lines
--- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+)security/selinux/hooks.c +0
-0security/selinux/hooks.c static int selinux_set_mnt_opts(struct super_block *sb, · line 758
Quoted 7 lines
security/selinux/hooks.c +1
-0@@ -752,6 +752,7 @@ 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,"binderfs" ) || !strcmp (sb->s_type->name,"pstore" )) sbsec->flags |=SE_SBGENFS ;--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Stephen Smalley
Acked-byQuoted 13 lines · Hridya Valsaraju
Quoted 11 lines · Stephen Smalley' via kernel-team
Quoted 8 lines · Hridya Valsaraju
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
Acked-by Mark Salyzyn <[email protected]>Signed-off-by Hridya Valsaraju <[email protected]>
Quoted 8 lines
Quoted 3 lines
Do you want binderfs to also support userspace labeling of files via
setxattr()? If so, you'll want to also add it toselinux_is_genfs_special_handling()as well.Thank you for the quick response Stephen :) I cannot think of a use-case for the userspace labelling of files in binderfs via
setxattr()as of now. I
will make the change if one comes up!
Ok, then you can include my:
Quoted 27 lines
Thanks,
HridyaQuoted 22 lines
Quoted 11 lines
--- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+)security/selinux/hooks.c +0
-0security/selinux/hooks.c static int selinux_set_mnt_opts(struct super_block *sb, · line 758
Quoted 7 lines
security/selinux/hooks.c +1
-0@@ -752,6 +752,7 @@ 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,"binderfs" ) || !strcmp (sb->s_type->name,"pstore" )) sbsec->flags |=SE_SBGENFS ;--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Quoted 19 lines · Stephen Smalley
Quoted 17 lines · Hridya Valsaraju
Quoted 14 lines · Stephen Smalley' via kernel-team
Quoted 8 lines · Hridya Valsaraju
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
Acked-by Mark Salyzyn <[email protected]>Signed-off-by Hridya Valsaraju <[email protected]>Do you want binderfs to also support userspace labeling of files via
setxattr()? If so, you'll want to also add it toselinux_is_genfs_special_handling()as well.
Quoted 7 lines
Quoted 4 lines
Thank you for the quick response Stephen :) I cannot think of a use-case for the userspace labelling of files in binderfs via
setxattr()as of now. I
will make the change if one comes up!Ok, then you can include my:
Acked-by Stephen Smalley <[email protected]>
Great! Thank you for reviewing my patch Stephen!
Regards,
Hridya
Quoted 29 lines
Quoted 28 lines
Thanks,
HridyaQuoted 22 lines
Quoted 11 lines
--- security/selinux/hooks.c | 1 + 1 file changed, 1 insertion(+)security/selinux/hooks.c +0
-0security/selinux/hooks.c static int selinux_set_mnt_opts(struct super_block *sb, · line 758
Quoted 7 lines
security/selinux/hooks.c +1
-0@@ -752,6 +752,7 @@ 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,"binderfs" ) || !strcmp (sb->s_type->name,"pstore" )) sbsec->flags |=SE_SBGENFS ;--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Quoted 18 lines · Stephen Smalley
Quoted 17 lines · Hridya Valsaraju
Quoted 14 lines · Stephen Smalley' via kernel-team
Quoted 8 lines · Hridya Valsaraju
This patch allows genfscon per-file labeling for binderfs. This is required to have separate permissions to allow access to binder, hwbinder and vndbinder devices which are relocating to binderfs.
Acked-by Mark Salyzyn <[email protected]>Signed-off-by Hridya Valsaraju <[email protected]>Do you want binderfs to also support userspace labeling of files via
setxattr()? If so, you'll want to also add it toselinux_is_genfs_special_handling()as well.
Quoted 7 lines
Quoted 4 lines
Thank you for the quick response Stephen :) I cannot think of a use-case for the userspace labelling of files in binderfs via
setxattr()as of now. I
will make the change if one comes up!Ok, then you can include my:
Acked-by Stephen Smalley <[email protected]>
Merged into selinux/next, thanks everyone!
Signature · 2 lines
paul moore www.paul-moore.com