Commit:     b07e35f94a7b6a059f889b904529ee907dc0634d
Parent:     5d540fb71552b9f2c542bea967200c48be2d8ef6
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 30 23:56:27 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Aug 31 01:42:22 2007 -0700

    setpgid(child) fails if the child was forked by sub-thread
    Spotted by Marcin Kowalczyk <[EMAIL PROTECTED]>.
    sys_setpgid(child) fails if the child was forked by sub-thread.
    Fix the "is it our child" check. The previous commit
    ee0acf90d320c29916ba8c5c1b2e908d81f5057d was not complete.
    (this patch asks for the new same_thread_group() helper, but mainline 
     have it yet).
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Acked-by: Roland McGrath <[EMAIL PROTECTED]>
    Tested-by: "Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/sys.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 449b81b..1b33b05 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1442,7 +1442,6 @@ asmlinkage long sys_times(struct tms __user * tbuf)
  * Auch. Had to add the 'did_exec' flag to conform completely to POSIX.
  * LBT 04.03.94
 asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
        struct task_struct *p;
@@ -1470,7 +1469,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
        if (!thread_group_leader(p))
                goto out;
-       if (p->real_parent == group_leader) {
+       if (p->real_parent->tgid == group_leader->tgid) {
                err = -EPERM;
                if (task_session(p) != task_session(group_leader))
                        goto out;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to