Skip to content

Commit

Permalink
[PATCH] setpgid: should not accept ptraced childs
Browse files Browse the repository at this point in the history
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@tv-sign.ru>
Cc: Oren Laadan <orenl@cs.columbia.edu>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jan 9, 2006
1 parent e19f247 commit f7dd795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
if (!thread_group_leader(p))
goto out;

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

0 comments on commit f7dd795

Please sign in to comment.