userns: initialize the depth of user_namespace chain
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
@@ -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
Quoted 1 line · Rui Xiang
The level of
init_user_nsshoule be 1.
What's wrong with zero?
--Andy
Quoted 21 lines
Signed-off-by Rui Xiang <[email protected]>--- kernel/user.c | 1 + 1 file changed, 1 insertion(+)kernel/user.c +1
-1@@ -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
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Rui Xiang
The level of
init_user_nsshoule 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
Signed-off-by Rui Xiang <[email protected]>--- kernel/user.c | 1 + 1 file changed, 1 insertion(+)kernel/user.c +1
-1@@ -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
Quoted 9 lines · Rui Xiang
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Rui Xiang
The level of
init_user_nsshoule 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.
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_nsshoule 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_nstoo.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.