* [PATCH] Fix capability.c to work with threaded init
@ 2007-08-18 1:30 sukadev-r/Jw6+rmf7HQT0dZR+AlfA
0 siblings, 0 replies; 5+ messages in thread
From: sukadev-r/Jw6+rmf7HQT0dZR+AlfA @ 2007-08-18 1:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Containers, Oleg Nesterov, Pavel Emelianov
From: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] Fix capability.c to work with threaded init
When setting capabilities, cap_set_all() must skip all threads of the
container_init process - not just the main thread.
Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/capability.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: 2.6.23-rc2-mm2/kernel/capability.c
===================================================================
--- 2.6.23-rc2-mm2.orig/kernel/capability.c 2007-08-17 17:33:17.000000000 -0700
+++ 2.6.23-rc2-mm2/kernel/capability.c 2007-08-17 17:33:17.000000000 -0700
@@ -137,7 +137,7 @@ static inline int cap_set_all(kernel_cap
int found = 0;
do_each_thread(g, target) {
- if (target == current || is_container_init(target))
+ if (target == current || is_container_init(target->group_leader))
continue;
found = 1;
if (security_capset_check(target, effective, inheritable,
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH] Fix capability.c to work with threaded init
@ 2007-08-03 6:26 sukadev-r/Jw6+rmf7HQT0dZR+AlfA
[not found] ` <20070803062610.GB16833-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: sukadev-r/Jw6+rmf7HQT0dZR+AlfA @ 2007-08-03 6:26 UTC (permalink / raw)
To: Pavel Emelianov; +Cc: Containers, Oleg Nesterov
From: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] Fix capability.c to work with threaded init
Callers of is_container_init() should pass in task->group_leader
to ensure they work with threaded-init.
Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/capability.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: lx26-23-rc1-mm1/kernel/capability.c
===================================================================
--- lx26-23-rc1-mm1.orig/kernel/capability.c 2007-08-02 22:58:02.000000000 -0700
+++ lx26-23-rc1-mm1/kernel/capability.c 2007-08-02 22:58:17.000000000 -0700
@@ -137,7 +137,7 @@ static inline int cap_set_all(kernel_cap
int found = 0;
do_each_thread(g, target) {
- if (target == current || is_container_init(target))
+ if (target == current || is_container_init(target->group_leader))
continue;
found = 1;
if (security_capset_check(target, effective, inheritable,
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <20070803062610.GB16833-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] Fix capability.c to work with threaded init [not found] ` <20070803062610.GB16833-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2007-08-03 16:51 ` Dave Hansen 2007-08-03 17:29 ` Oleg Nesterov 0 siblings, 1 reply; 5+ messages in thread From: Dave Hansen @ 2007-08-03 16:51 UTC (permalink / raw) To: sukadev-r/Jw6+rmf7HQT0dZR+AlfA; +Cc: Containers, Oleg Nesterov, Pavel Emelianov On Thu, 2007-08-02 at 23:26 -0700, sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote: > > Callers of is_container_init() should pass in task->group_leader > to ensure they work with threaded-init. Can you explain this in a little more detail? That's a pretty sparse changelog. -- Dave ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix capability.c to work with threaded init 2007-08-03 16:51 ` Dave Hansen @ 2007-08-03 17:29 ` Oleg Nesterov [not found] ` <20070803172934.GB3783-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Oleg Nesterov @ 2007-08-03 17:29 UTC (permalink / raw) To: Dave Hansen; +Cc: Containers, Pavel Emelianov On 08/03, Dave Hansen wrote: > > On Thu, 2007-08-02 at 23:26 -0700, sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote: > > > > Callers of is_container_init() should pass in task->group_leader > > to ensure they work with threaded-init. > > Can you explain this in a little more detail? That's a pretty sparse > changelog. Without this change cap_set_all() skips only the main thread of /sbin/init, but we should skip the entire process as the comment states. Oleg. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20070803172934.GB3783-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>]
* Re: [PATCH] Fix capability.c to work with threaded init [not found] ` <20070803172934.GB3783-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> @ 2007-08-03 20:51 ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA 0 siblings, 0 replies; 5+ messages in thread From: sukadev-r/Jw6+rmf7HQT0dZR+AlfA @ 2007-08-03 20:51 UTC (permalink / raw) To: Oleg Nesterov; +Cc: Containers, Pavel Emelianov Oleg Nesterov [oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org] wrote: | On 08/03, Dave Hansen wrote: | > | > On Thu, 2007-08-02 at 23:26 -0700, sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote: | > > | > > Callers of is_container_init() should pass in task->group_leader | > > to ensure they work with threaded-init. | > | > Can you explain this in a little more detail? That's a pretty sparse | > changelog. | You are right. The changelog could be better. How about this: | | Without this change cap_set_all() skips only the main thread of /sbin/init, | but we should skip the entire process as the comment states. | | Oleg. --- From: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Subject: [PATCH] cap_set_all() must skip all threads of init When setting capabilities, cap_set_all() must skip all threads of the container_init process - not just the main thread. Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> --- kernel/capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: lx26-23-rc1-mm1/kernel/capability.c =================================================================== --- lx26-23-rc1-mm1.orig/kernel/capability.c 2007-08-02 22:58:02.000000000 -0700 +++ lx26-23-rc1-mm1/kernel/capability.c 2007-08-02 22:58:17.000000000 -0700 @@ -137,7 +137,7 @@ static inline int cap_set_all(kernel_cap int found = 0; do_each_thread(g, target) { - if (target == current || is_container_init(target)) + if (target == current || is_container_init(target->group_leader)) continue; found = 1; if (security_capset_check(target, effective, inheritable, ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-18 1:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-18 1:30 [PATCH] Fix capability.c to work with threaded init sukadev-r/Jw6+rmf7HQT0dZR+AlfA
-- strict thread matches above, loose matches on Subject: below --
2007-08-03 6:26 sukadev-r/Jw6+rmf7HQT0dZR+AlfA
[not found] ` <20070803062610.GB16833-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-08-03 16:51 ` Dave Hansen
2007-08-03 17:29 ` Oleg Nesterov
[not found] ` <20070803172934.GB3783-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
2007-08-03 20:51 ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox