>From 9885a182bd9feeeb85abf7b2e09340e392ebf43d Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]>
Date: Tue, 25 Nov 2008 11:04:34 -0800
Subject: [PATCH 5/5] Clear si_pid for signal from ancestor ns

Since processes don't have valid pid numbers in a descendant pid namespaces,
the siginfo->si_pid field must be set to 0 when signal is sent from an
ancestor namespace.

TODO:
        - siginfo->si_pid may need to be cleared in other locations (eg:
          __do_notify(), F_SETSIG) and will be addressed in separate patches.

        - rt_sigqueueinfo(): siginfo->si_pid value is unreliable/undefined
          when rt_sigqueueinfo() is used to signal a process in a descendant
          namespace

Signed-off-by: Sukadev Bhattiprolu <[EMAIL PROTECTED]>
---
 kernel/signal.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 8c294c1..14eb986 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -881,6 +881,8 @@ static int send_signal(int sig, struct siginfo *info, 
struct task_struct *t,
                default:
                        copy_siginfo(&q->info, info);
                        q->info.si_signo &= ~SIG_FROM_USER;
+                       if (from_ancestor_ns)
+                               q->info.si_pid = 0;
                        break;
                }
        } else if (!is_si_special(info)) {
-- 
1.5.2.5

_______________________________________________
Containers mailing list
[EMAIL PROTECTED]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to