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

From: Oleg Nesterov
Date: Sun Dec 11 2005 - 11:06:27 EST


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 <oleg@xxxxxxxxxx>

--- 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;
-
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/