Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-10 Thread Djalal Harouni
On Fri, Nov 10, 2017 at 3:38 AM, Andy Lutomirski  wrote:
> On Thu, Nov 9, 2017 at 8:14 AM, Djalal Harouni  wrote:
>> This patch introduces the new 'pids' mount option, as it was discussed
>> and suggested by Andy Lutomirski [1].
>>
>> * If 'pids=' is passed without 'newinstance' then it has no effect.
>
> Would it be safer this were an error instead?

Hm, I tend to say that you are right, but I also keep your comment
when you said that "newinstance" should be the default later and users
won't have to explicitly pass it. What you think ?

-- 
tixxdz


Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-10 Thread Djalal Harouni
On Fri, Nov 10, 2017 at 3:38 AM, Andy Lutomirski  wrote:
> On Thu, Nov 9, 2017 at 8:14 AM, Djalal Harouni  wrote:
>> This patch introduces the new 'pids' mount option, as it was discussed
>> and suggested by Andy Lutomirski [1].
>>
>> * If 'pids=' is passed without 'newinstance' then it has no effect.
>
> Would it be safer this were an error instead?

Hm, I tend to say that you are right, but I also keep your comment
when you said that "newinstance" should be the default later and users
won't have to explicitly pass it. What you think ?

-- 
tixxdz


Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-09 Thread James Morris
On Thu, 9 Nov 2017, Djalal Harouni wrote:

> This patch introduces the new 'pids' mount option, as it was discussed
> and suggested by Andy Lutomirski [1].
> 
> * If 'pids=' is passed without 'newinstance' then it has no effect.
> 
> * If 'newinstance,pids=all' then all processes will be shown in proc.
> 
> * If 'newinstance,pids=ptraceable' then only ptraceable processes will be
> shown.
> 
> * 'pids=' takes precendence over 'hidepid=' since 'hidepid=' can be
>   ignored if "gid=" was set and caller has the "gid=" set in its groups.
>   We want to guarantee that LSM have a security path there that can not
>   be disabled with "gid=".
> 
> This allows to support lightweight sandboxes in Embedded Linux.
> 
> Later Yama LSM can be updated to check that processes are able only
> able to see their children inside /proc/, allowing to support more tight
> cases.
> 
> [1] https://lkml.org/lkml/2017/4/26/646
> 
> Cc: Kees Cook 
> Cc: Greg Kroah-Hartman 
> Suggested-by: Andy Lutomirski 
> Signed-off-by: Alexey Gladkov 
> Signed-off-by: Djalal Harouni 


Reviewed-by: James Morris 


-- 
James Morris




Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-09 Thread James Morris
On Thu, 9 Nov 2017, Djalal Harouni wrote:

> This patch introduces the new 'pids' mount option, as it was discussed
> and suggested by Andy Lutomirski [1].
> 
> * If 'pids=' is passed without 'newinstance' then it has no effect.
> 
> * If 'newinstance,pids=all' then all processes will be shown in proc.
> 
> * If 'newinstance,pids=ptraceable' then only ptraceable processes will be
> shown.
> 
> * 'pids=' takes precendence over 'hidepid=' since 'hidepid=' can be
>   ignored if "gid=" was set and caller has the "gid=" set in its groups.
>   We want to guarantee that LSM have a security path there that can not
>   be disabled with "gid=".
> 
> This allows to support lightweight sandboxes in Embedded Linux.
> 
> Later Yama LSM can be updated to check that processes are able only
> able to see their children inside /proc/, allowing to support more tight
> cases.
> 
> [1] https://lkml.org/lkml/2017/4/26/646
> 
> Cc: Kees Cook 
> Cc: Greg Kroah-Hartman 
> Suggested-by: Andy Lutomirski 
> Signed-off-by: Alexey Gladkov 
> Signed-off-by: Djalal Harouni 


Reviewed-by: James Morris 


-- 
James Morris




Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-09 Thread Andy Lutomirski
On Thu, Nov 9, 2017 at 8:14 AM, Djalal Harouni  wrote:
> This patch introduces the new 'pids' mount option, as it was discussed
> and suggested by Andy Lutomirski [1].
>
> * If 'pids=' is passed without 'newinstance' then it has no effect.

Would it be safer this were an error instead?


Re: [PATCH RFC v3 6/7] proc: support new 'pids=all|ptraceable' mount option

2017-11-09 Thread Andy Lutomirski
On Thu, Nov 9, 2017 at 8:14 AM, Djalal Harouni  wrote:
> This patch introduces the new 'pids' mount option, as it was discussed
> and suggested by Andy Lutomirski [1].
>
> * If 'pids=' is passed without 'newinstance' then it has no effect.

Would it be safer this were an error instead?