All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] security: selinux: allow per-file labelling for binderfs
@ 2020-01-06 18:13 Hridya Valsaraju
  2020-01-06 18:34 ` Stephen Smalley
  0 siblings, 1 reply; 6+ messages in thread
From: Hridya Valsaraju @ 2020-01-06 18:13 UTC (permalink / raw)
  To: Paul Moore, Stephen Smalley, Eric Paris, selinux, linux-kernel
  Cc: kernel-team, Hridya Valsaraju, Jeff Vander Stoep, Mark Salyzyn

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: Jeff Vander Stoep <jeffv@google.com>
Acked-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Hridya Valsaraju <hridya@google.com>
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 116b4d644f68..3f0669a708e9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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;
 
-- 
2.24.1.735.g03f4e72817-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] security: selinux: allow per-file labelling for binderfs
  2020-01-06 18:13 [PATCH] security: selinux: allow per-file labelling for binderfs Hridya Valsaraju
@ 2020-01-06 18:34 ` Stephen Smalley
  2020-01-06 19:06   ` Hridya Valsaraju
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Smalley @ 2020-01-06 18:34 UTC (permalink / raw)
  To: Hridya Valsaraju, Paul Moore, Eric Paris, selinux, linux-kernel
  Cc: kernel-team, Jeff Vander Stoep, Mark Salyzyn

On 1/6/20 1:13 PM, Hridya Valsaraju wrote:
> 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: Jeff Vander Stoep <jeffv@google.com>
> Acked-by: Mark Salyzyn <salyzyn@android.com>
> Signed-off-by: Hridya Valsaraju <hridya@google.com>

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.

> ---
>   security/selinux/hooks.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 116b4d644f68..3f0669a708e9 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -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;
>   
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] security: selinux: allow per-file labelling for binderfs
  2020-01-06 18:34 ` Stephen Smalley
@ 2020-01-06 19:06   ` Hridya Valsaraju
  2020-01-06 19:33     ` Stephen Smalley
  0 siblings, 1 reply; 6+ messages in thread
From: Hridya Valsaraju @ 2020-01-06 19:06 UTC (permalink / raw)
  To: Stephen Smalley
  Cc: Paul Moore, Eric Paris, selinux, LKML, Android Kernel Team,
	Jeff Vander Stoep, Mark Salyzyn

On Mon, Jan 6, 2020 at 10:33 AM 'Stephen Smalley' via kernel-team
<kernel-team@android.com> wrote:
>
> On 1/6/20 1:13 PM, Hridya Valsaraju wrote:
> > 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: Jeff Vander Stoep <jeffv@google.com>
> > Acked-by: Mark Salyzyn <salyzyn@android.com>
> > Signed-off-by: Hridya Valsaraju <hridya@google.com>
>
> 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.

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


>
> > ---
> >   security/selinux/hooks.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> > index 116b4d644f68..3f0669a708e9 100644
> > --- a/security/selinux/hooks.c
> > +++ b/security/selinux/hooks.c
> > @@ -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 kernel-team+unsubscribe@android.com.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] security: selinux: allow per-file labelling for binderfs
  2020-01-06 19:06   ` Hridya Valsaraju
@ 2020-01-06 19:33     ` Stephen Smalley
  2020-01-06 22:25       ` Hridya Valsaraju
  2020-01-07  2:13       ` Paul Moore
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Smalley @ 2020-01-06 19:33 UTC (permalink / raw)
  To: Hridya Valsaraju
  Cc: Paul Moore, Eric Paris, selinux, LKML, Android Kernel Team,
	Jeff Vander Stoep, Mark Salyzyn

On 1/6/20 2:06 PM, Hridya Valsaraju wrote:
> On Mon, Jan 6, 2020 at 10:33 AM 'Stephen Smalley' via kernel-team
> <kernel-team@android.com> wrote:
>>
>> On 1/6/20 1:13 PM, Hridya Valsaraju wrote:
>>> 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: Jeff Vander Stoep <jeffv@google.com>
>>> Acked-by: Mark Salyzyn <salyzyn@android.com>
>>> Signed-off-by: Hridya Valsaraju <hridya@google.com>
>>
>> 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.
> 
> 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 <sds@tycho.nsa.gov>

> 
> Thanks,
> Hridya
> 
> 
>>
>>> ---
>>>    security/selinux/hooks.c | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
>>> index 116b4d644f68..3f0669a708e9 100644
>>> --- a/security/selinux/hooks.c
>>> +++ b/security/selinux/hooks.c
>>> @@ -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 kernel-team+unsubscribe@android.com.
>>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] security: selinux: allow per-file labelling for binderfs
  2020-01-06 19:33     ` Stephen Smalley
@ 2020-01-06 22:25       ` Hridya Valsaraju
  2020-01-07  2:13       ` Paul Moore
  1 sibling, 0 replies; 6+ messages in thread
From: Hridya Valsaraju @ 2020-01-06 22:25 UTC (permalink / raw)
  To: Stephen Smalley
  Cc: Paul Moore, Eric Paris, selinux, LKML, Android Kernel Team,
	Jeff Vander Stoep, Mark Salyzyn

On Mon, Jan 6, 2020 at 11:33 AM Stephen Smalley <sds@tycho.nsa.gov> wrote:
>
> On 1/6/20 2:06 PM, Hridya Valsaraju wrote:
> > On Mon, Jan 6, 2020 at 10:33 AM 'Stephen Smalley' via kernel-team
> > <kernel-team@android.com> wrote:
> >>
> >> On 1/6/20 1:13 PM, Hridya Valsaraju wrote:
> >>> 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: Jeff Vander Stoep <jeffv@google.com>
> >>> Acked-by: Mark Salyzyn <salyzyn@android.com>
> >>> Signed-off-by: Hridya Valsaraju <hridya@google.com>
> >>
> >> 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.
> >
> > 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 <sds@tycho.nsa.gov>

Great! Thank you for reviewing my patch Stephen!

Regards,
Hridya

>
> >
> > Thanks,
> > Hridya
> >
> >
> >>
> >>> ---
> >>>    security/selinux/hooks.c | 1 +
> >>>    1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> >>> index 116b4d644f68..3f0669a708e9 100644
> >>> --- a/security/selinux/hooks.c
> >>> +++ b/security/selinux/hooks.c
> >>> @@ -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 kernel-team+unsubscribe@android.com.
> >>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] security: selinux: allow per-file labelling for binderfs
  2020-01-06 19:33     ` Stephen Smalley
  2020-01-06 22:25       ` Hridya Valsaraju
@ 2020-01-07  2:13       ` Paul Moore
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-01-07  2:13 UTC (permalink / raw)
  To: Hridya Valsaraju
  Cc: Eric Paris, selinux, LKML, Android Kernel Team,
	Jeff Vander Stoep, Mark Salyzyn, Stephen Smalley

On Mon, Jan 6, 2020 at 2:33 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 1/6/20 2:06 PM, Hridya Valsaraju wrote:
> > On Mon, Jan 6, 2020 at 10:33 AM 'Stephen Smalley' via kernel-team
> > <kernel-team@android.com> wrote:
> >>
> >> On 1/6/20 1:13 PM, Hridya Valsaraju wrote:
> >>> 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: Jeff Vander Stoep <jeffv@google.com>
> >>> Acked-by: Mark Salyzyn <salyzyn@android.com>
> >>> Signed-off-by: Hridya Valsaraju <hridya@google.com>
> >>
> >> 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.
> >
> > 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 <sds@tycho.nsa.gov>

Merged into selinux/next, thanks everyone!

-- 
paul moore
www.paul-moore.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-07  2:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 18:13 [PATCH] security: selinux: allow per-file labelling for binderfs Hridya Valsaraju
2020-01-06 18:34 ` Stephen Smalley
2020-01-06 19:06   ` Hridya Valsaraju
2020-01-06 19:33     ` Stephen Smalley
2020-01-06 22:25       ` Hridya Valsaraju
2020-01-07  2:13       ` Paul Moore

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.