2005-12-11 16:07:08

by Oleg Nesterov

[permalink] [raw]
Subject: [PATCH ? 1/2] setpgid: should not accept ptraced childs

sys_setpgid() allows to change ->pgrp of ptraced childs.

'man setpgid' does not tell anything about that, so I consider
this behaviour is a bug.

Signed-off-by: Oleg Nesterov <[email protected]>

--- 2.6.15-rc5/kernel/sys.c~ 2005-11-22 19:35:32.000000000 +0300
+++ 2.6.15-rc5/kernel/sys.c 2005-12-11 22:40:33.000000000 +0300
@@ -1106,7 +1106,7 @@ asmlinkage long sys_setpgid(pid_t pid, p
if (!thread_group_leader(p))
goto out;

- if (p->parent == current || p->real_parent == current) {
+ if (p->real_parent == current) {
err = -EPERM;
if (p->signal->session != current->signal->session)
goto out;