Commit f7dd795e authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[PATCH] 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: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Oren Laadan <orenl@cs.columbia.edu>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e19f247a
...@@ -1114,7 +1114,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) ...@@ -1114,7 +1114,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
if (!thread_group_leader(p)) if (!thread_group_leader(p))
goto out; goto out;
if (p->parent == current || p->real_parent == group_leader) { if (p->real_parent == group_leader) {
err = -EPERM; err = -EPERM;
if (p->signal->session != group_leader->signal->session) if (p->signal->session != group_leader->signal->session)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment