* [PATCH] 'kill sig -1' must only apply to caller's namespace
@ 2008-10-23 15:49 sukadev
2008-10-24 11:06 ` Oleg Nesterov
0 siblings, 1 reply; 2+ messages in thread
From: sukadev @ 2008-10-23 15:49 UTC (permalink / raw)
To: Andrew Morton
Cc: Oleg Nesterov, Eric W. Biederman, daniel, Pavel Emelyanov,
Containers, linux-kernel
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Subject: [PATCH] 'kill sig -1' must only apply to caller's namespace
Currently "kill <sig> -1" kills processes in all namespaces and breaks the
isolation of namespaces. Earlier attempt to fix this was discussed at:
http://lkml.org/lkml/2008/7/23/148
As suggested by Oleg Nesterov in that thread, use "task_pid_vnr() > 1"
check since task_pid_vnr() returns 0 if process is outside the caller's
namespace.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Tested-by: Daniel Hokka Zakrisson <daniel@hozac.com>
---
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] 2+ messages in thread* Re: [PATCH] 'kill sig -1' must only apply to caller's namespace
2008-10-23 15:49 [PATCH] 'kill sig -1' must only apply to caller's namespace sukadev
@ 2008-10-24 11:06 ` Oleg Nesterov
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2008-10-24 11:06 UTC (permalink / raw)
To: sukadev
Cc: Andrew Morton, Eric W. Biederman, daniel, Pavel Emelyanov,
Containers, linux-kernel
On 10/23, sukadev@linux.vnet.ibm.com wrote:
>
> --- 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)) {
Thanks Sukadev!
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Oleg.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-24 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-23 15:49 [PATCH] 'kill sig -1' must only apply to caller's namespace sukadev
2008-10-24 11:06 ` Oleg Nesterov
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.