Commit 4447e8db authored by Paul Mackerras's avatar Paul Mackerras

PPC32: fix arch-level tid handling.

This makes sure we clear the user_tid in copy_thread, and that we
don't pass a bogus tid parameter in sys_clone when the CLONE_SETTID
and CLONE_CLEARTID flags are clear.
parent 3ec53303
......@@ -331,6 +331,8 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE;
unsigned long childframe;
p->user_tid = NULL;
CHECK_FULL_REGS(regs);
/* Copy registers */
sp -= sizeof(struct pt_regs);
......@@ -444,7 +446,10 @@ int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6,
struct pt_regs *regs)
{
struct task_struct *p;
CHECK_FULL_REGS(regs);
if ((p1 & (CLONE_SETTID | CLONE_CLEARTID)) == 0)
p3 = 0;
p = do_fork(p1 & ~CLONE_IDLETASK, p2, regs, 0, (int *)p3);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......
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