public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] userns: initialize the depth of user_namespace chain
@ 2013-08-14  5:04 Rui Xiang
  2013-08-14  5:06 ` Andy Lutomirski
  0 siblings, 1 reply; 5+ messages in thread
From: Rui Xiang @ 2013-08-14  5:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: oleg, luto

The level of init_user_ns shoule be 1.

Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
---
 kernel/user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/user.c b/kernel/user.c
index 69b4c3d..32da187 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -48,6 +48,7 @@ struct user_namespace init_user_ns = {
 		},
 	},
 	.count = ATOMIC_INIT(3),
+	.level = 1,
 	.owner = GLOBAL_ROOT_UID,
 	.group = GLOBAL_ROOT_GID,
 	.proc_inum = PROC_USER_INIT_INO,
-- 
1.8.2.2


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

* Re: [PATCH] userns: initialize the depth of user_namespace chain
  2013-08-14  5:04 [PATCH] userns: initialize the depth of user_namespace chain Rui Xiang
@ 2013-08-14  5:06 ` Andy Lutomirski
  2013-08-14  6:44   ` Rui Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2013-08-14  5:06 UTC (permalink / raw)
  To: Rui Xiang; +Cc: linux-kernel, oleg

On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang <rui.xiang@huawei.com> wrote:
> The level of init_user_ns shoule be 1.

What's wrong with zero?

--Andy

>
> Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
> ---
>  kernel/user.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/user.c b/kernel/user.c
> index 69b4c3d..32da187 100644
> --- a/kernel/user.c
> +++ b/kernel/user.c
> @@ -48,6 +48,7 @@ struct user_namespace init_user_ns = {
>                 },
>         },
>         .count = ATOMIC_INIT(3),
> +       .level = 1,
>         .owner = GLOBAL_ROOT_UID,
>         .group = GLOBAL_ROOT_GID,
>         .proc_inum = PROC_USER_INIT_INO,
> --
> 1.8.2.2
>



-- 
Andy Lutomirski
AMA Capital Management, LLC

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

* Re: [PATCH] userns: initialize the depth of user_namespace chain
  2013-08-14  5:06 ` Andy Lutomirski
@ 2013-08-14  6:44   ` Rui Xiang
  2013-08-14 18:43     ` Oleg Nesterov
  0 siblings, 1 reply; 5+ messages in thread
From: Rui Xiang @ 2013-08-14  6:44 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: linux-kernel, oleg

On 2013/8/14 13:06, Andy Lutomirski wrote:
> On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang <rui.xiang@huawei.com> wrote:
>> The level of init_user_ns shoule be 1.
> 
> What's wrong with zero?
> 

No problem. It is just consistent with commit 8742f229b63, IMHO.
but the initialization of level should be necessary.


Thanks.

> --Andy
> 
>>
>> Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
>> ---
>>  kernel/user.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/kernel/user.c b/kernel/user.c
>> index 69b4c3d..32da187 100644
>> --- a/kernel/user.c
>> +++ b/kernel/user.c
>> @@ -48,6 +48,7 @@ struct user_namespace init_user_ns = {
>>                 },
>>         },
>>         .count = ATOMIC_INIT(3),
>> +       .level = 1,
>>         .owner = GLOBAL_ROOT_UID,
>>         .group = GLOBAL_ROOT_GID,
>>         .proc_inum = PROC_USER_INIT_INO,
>> --
>> 1.8.2.2
>>
> 
> 
> 



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

* Re: [PATCH] userns: initialize the depth of user_namespace chain
  2013-08-14  6:44   ` Rui Xiang
@ 2013-08-14 18:43     ` Oleg Nesterov
  2013-08-15  1:50       ` Rui Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Oleg Nesterov @ 2013-08-14 18:43 UTC (permalink / raw)
  To: Rui Xiang; +Cc: Andy Lutomirski, linux-kernel

On 08/14, Rui Xiang wrote:
>
> On 2013/8/14 13:06, Andy Lutomirski wrote:
> > On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang <rui.xiang@huawei.com> wrote:
> >> The level of init_user_ns shoule be 1.
> >
> > What's wrong with zero?
> >
>
> No problem. It is just consistent with commit 8742f229b63, IMHO.

Well, I am fine either way,

> but the initialization of level should be necessary.

but it is not necessary. This is just an "arbitrary" limit for now,
32 non-root namespaces. Perhaps we should count init_user_ns too.

Hmm. but I just realized that "> 32" in create_user_ns() should be
">= 32" in this case.

Oleg.


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

* Re: [PATCH] userns: initialize the depth of user_namespace chain
  2013-08-14 18:43     ` Oleg Nesterov
@ 2013-08-15  1:50       ` Rui Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Rui Xiang @ 2013-08-15  1:50 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andy Lutomirski, linux-kernel

On 2013/8/15 2:43, Oleg Nesterov wrote:
> On 08/14, Rui Xiang wrote:
>>
>> On 2013/8/14 13:06, Andy Lutomirski wrote:
>>> On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang <rui.xiang@huawei.com> wrote:
>>>> The level of init_user_ns shoule be 1.
>>>
>>> What's wrong with zero?
>>>
>>
>> No problem. It is just consistent with commit 8742f229b63, IMHO.
> 
> Well, I am fine either way,
> 
>> but the initialization of level should be necessary.
> 
> but it is not necessary. This is just an "arbitrary" limit for now,
> 32 non-root namespaces. Perhaps we should count init_user_ns too.
> 
> Hmm. but I just realized that "> 32" in create_user_ns() should be
> ">= 32" in this case.
> 
Yes. If we need to count init_user_ns, this filed should be set to 1 in 
init_user_ns, and "> 32" in create_user_ns() can limit 32 non-root 
namespaces. And that depends on your design. :)



Thanks.



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

end of thread, other threads:[~2013-08-15  1:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14  5:04 [PATCH] userns: initialize the depth of user_namespace chain Rui Xiang
2013-08-14  5:06 ` Andy Lutomirski
2013-08-14  6:44   ` Rui Xiang
2013-08-14 18:43     ` Oleg Nesterov
2013-08-15  1:50       ` Rui Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox