[RFC][PATCH 02/20] pspace: The parent process id of pid 1 is always 0.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Force the parent process id of pid == 1 to always be 0.  Force
this for nested pspaces.

Signed-off-by: Eric W. Biederman <[email protected]>


---

 arch/alpha/kernel/entry.S |    3 +++
 kernel/timer.c            |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

bec203c8a3e7bec5e3bee8086361caffa71ad685
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 7af15bf..38996ab 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -891,6 +891,9 @@ sys_getxpid:
 	cmpeq	$4, $5, $5
 	beq	$5, 1b
 #endif
+	cmpeq	$0, 1, $5
+	cmoveq	$5, 0, $1
+	
 	stq	$1, 80($sp)
 	ret
 .end sys_getxpid
diff --git a/kernel/timer.c b/kernel/timer.c
index 4f1cb0a..bae17fb 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -987,6 +987,8 @@ asmlinkage long sys_getppid(void)
 #endif
 		break;
 	}
+	if (current->tgid == 1)
+		pid = 0;
 	return pid;
 }
 
-- 
1.1.5.g3480

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux