mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] add child reaper to pid_namespace
Add a per pid_namespace child-reaper. This is needed so processes are reaped within the same pid space and do not spill over to the parent pid space. Its also needed so containers preserve existing semantic that pid == 1 would reap orphaned children. This is based on Eric Biederman's patch: http://lkml.org/lkml/2006/2/6/285 Signed-off-by: Sukadev Bhattiprolu <[email protected]> Signed-off-by: Cedric Le Goater <[email protected]> Cc: Kirill Korotaev <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Herbert Poetzl <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
6cc1b22a4a
commit
84d737866e
8 changed files with 40 additions and 19 deletions
|
|
@ -24,6 +24,9 @@
|
|||
#include <linux/signal.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/pid_namespace.h>
|
||||
#include <linux/nsproxy.h>
|
||||
|
||||
#include <asm/param.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
|
|
@ -1877,8 +1880,12 @@ relock:
|
|||
if (sig_kernel_ignore(signr)) /* Default is nothing. */
|
||||
continue;
|
||||
|
||||
/* Init gets no signals it doesn't want. */
|
||||
if (current == child_reaper)
|
||||
/*
|
||||
* Init of a pid space gets no signals it doesn't want from
|
||||
* within that pid space. It can of course get signals from
|
||||
* its parent pid space.
|
||||
*/
|
||||
if (current == child_reaper(current))
|
||||
continue;
|
||||
|
||||
if (sig_kernel_stop(signr)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue