[PATCH 5/5] Clear si_pid for signal from ancestor ns

From: Sukadev Bhattiprolu
Date: Tue Nov 25 2008 - 14:04:34 EST


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 <sukadev@xxxxxxxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/