From: Gowrishankar M <gomut...@linux.vnet.ibm.com>

At present, while signalling processes using sysrq, process iteration
goes beyond current PID namespace.

Below patch uses one of the proposed namespace iteration macros to fix
the boundary.

Signed-off-by: Gowrishankar M <gowrishanka...@linux.vnet.ibm.com>
---
 drivers/char/sysrq.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index ce0d9da..adca5da 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -13,6 +13,7 @@
  */
 
 #include <linux/sched.h>
+#include <linux/pid_namespace.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
@@ -293,8 +294,8 @@ static void send_sig_all(int sig)
 {
        struct task_struct *p;
 
-       for_each_process(p) {
-               if (p->mm && !is_global_init(p))
+       for_each_process_in_ns(p, current->nsproxy->pid_ns) {
+               if (p->mm && !is_container_init(p))
                        /* Not swapper, init nor kernel thread */
                        force_sig(sig, p);
        }
-- 
1.5.5.1

_______________________________________________
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
Devel@openvz.org
https://openvz.org/mailman/listinfo/devel

Reply via email to