Skip to contentSkip to conversation

userns: initialize the depth of user_namespace chain

PATCH In review Rui Xiang 3 participants 5 messages Aug 14, 2013 – Aug 15, 2013

lore
Share & tools
lore

Rui Xiang

author
#0 lore raw

PATCH 1/1 userns: initialize the depth of user_namespace chain

The level of init_user_ns shoule be 1.

---
 kernel/user.c | 1 +
 1 file changed, 1 insertion(+)
kernel/user.c +1 -0
index 69b4c3d..32da187 100644
@@ -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,
Signature · 1 line
1.8.2.2
#1 lore raw
Quoted 1 line · Rui Xiang

The level of init_user_ns shoule be 1.

What's wrong with zero?

--Andy

Quoted 21 lines
---
 kernel/user.c | 1 +
 1 file changed, 1 insertion(+)
kernel/user.c +1 -1
index 69b4c3d..32da187 100644
@@ -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

Signature · 2 lines
Andy Lutomirski
AMA Capital Management, LLC
author
#2 lore raw
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Rui Xiang

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.

Quoted 26 lines

--Andy

Quoted 21 lines
---
 kernel/user.c | 1 +
 1 file changed, 1 insertion(+)
kernel/user.c +1 -1
index 69b4c3d..32da187 100644
@@ -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

#3 lore raw
Quoted 9 lines · Rui Xiang
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Rui Xiang

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,

Quoted 1 line

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.

author
#4 lore raw
Quoted 13 lines · Oleg Nesterov
Quoted 9 lines · Rui Xiang
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Rui Xiang

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,

Quoted 8 lines
Quoted 1 line

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.