* [RFC][PATCH] 'kill sig -1' must only apply to callers namespace
@ 2008-10-22 1:41 sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
[not found] ` <20081022014141.GA25355-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8 @ 2008-10-22 1:41 UTC (permalink / raw)
To: Oleg Nesterov, daniel-nym3zxDgnZcAvxtiuMwx3w, Eric W. Biederman,
Pavel Emelyanov
Cc: Containers, sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
From d92b4befe07c6a1e852e4462126a5443342448cd Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Tue, 21 Oct 2008 18:00:01 -0700
Subject: [PATCH] kill sig -1 must only apply to callers namespace
Currently "kill <sig> -1" kills processes in all namespaces and breaks the
isolation of namespaces. Earlier attempt to fix this is discussed at:
http://lkml.org/lkml/2008/7/23/148
but nothing seems to have happened since then.
This patch uses the simple fix suggested by Oleg Nesterov.
Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/signal.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 105217d..4530fc6 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1144,7 +1144,8 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid)
struct task_struct * p;
for_each_process(p) {
- if (p->pid > 1 && !same_thread_group(p, current)) {
+ if (task_pid_vnr(p) > 1 &&
+ !same_thread_group(p, current)) {
int err = group_send_sig_info(sig, info, p);
++count;
if (err != -EPERM)
--
1.5.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC][PATCH] 'kill sig -1' must only apply to callers namespace
[not found] ` <20081022014141.GA25355-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-10-22 3:02 ` Daniel Hokka Zakrisson
2008-10-22 3:18 ` Eric W. Biederman
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Hokka Zakrisson @ 2008-10-22 3:02 UTC (permalink / raw)
Cc: Eric W. Biederman, Containers,
sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8, Oleg Nesterov,
Pavel Emelyanov
sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org wrote:
>
>>From d92b4befe07c6a1e852e4462126a5443342448cd Mon Sep 17 00:00:00 2001
> From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> Date: Tue, 21 Oct 2008 18:00:01 -0700
> Subject: [PATCH] kill sig -1 must only apply to callers namespace
>
> Currently "kill <sig> -1" kills processes in all namespaces and breaks the
> isolation of namespaces. Earlier attempt to fix this is discussed at:
>
> http://lkml.org/lkml/2008/7/23/148
>
> but nothing seems to have happened since then.
>
> This patch uses the simple fix suggested by Oleg Nesterov.
>
> Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Tested-by: Daniel Hokka Zakrisson <daniel-nym3zxDgnZcAvxtiuMwx3w@public.gmane.org>
Thank you for taking care of this.
> ---
> kernel/signal.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 105217d..4530fc6 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1144,7 +1144,8 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t
> pid)
> struct task_struct * p;
>
> for_each_process(p) {
> - if (p->pid > 1 && !same_thread_group(p, current)) {
> + if (task_pid_vnr(p) > 1 &&
> + !same_thread_group(p, current)) {
> int err = group_send_sig_info(sig, info, p);
> ++count;
> if (err != -EPERM)
> --
> 1.5.2.5
--
Daniel Hokka Zakrisson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC][PATCH] 'kill sig -1' must only apply to callers namespace
[not found] ` <20081022014141.GA25355-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-10-22 3:02 ` Daniel Hokka Zakrisson
@ 2008-10-22 3:18 ` Eric W. Biederman
1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2008-10-22 3:18 UTC (permalink / raw)
To: sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
Cc: Containers, Oleg Nesterov, Pavel Emelyanov
sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org writes:
>>From d92b4befe07c6a1e852e4462126a5443342448cd Mon Sep 17 00:00:00 2001
> From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> Date: Tue, 21 Oct 2008 18:00:01 -0700
> Subject: [PATCH] kill sig -1 must only apply to callers namespace
>
> Currently "kill <sig> -1" kills processes in all namespaces and breaks the
> isolation of namespaces. Earlier attempt to fix this is discussed at:
>
> http://lkml.org/lkml/2008/7/23/148
>
> but nothing seems to have happened since then.
Ugh. I thought that conversation had resolved the problem and gotten
a patch in.
This patch works because pid_vnr returns 0 for processes outside of
the current pid namespace.
> This patch uses the simple fix suggested by Oleg Nesterov.
>
> Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Acked-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> ---
> kernel/signal.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 105217d..4530fc6 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1144,7 +1144,8 @@ static int kill_something_info(int sig, struct siginfo
> *info, pid_t pid)
> struct task_struct * p;
>
> for_each_process(p) {
> - if (p->pid > 1 && !same_thread_group(p, current)) {
> + if (task_pid_vnr(p) > 1 &&
> + !same_thread_group(p, current)) {
> int err = group_send_sig_info(sig, info, p);
> ++count;
> if (err != -EPERM)
> --
> 1.5.2.5
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-22 3:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 1:41 [RFC][PATCH] 'kill sig -1' must only apply to callers namespace sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
[not found] ` <20081022014141.GA25355-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-10-22 3:02 ` Daniel Hokka Zakrisson
2008-10-22 3:18 ` Eric W. Biederman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.