Skip to content

Commit

Permalink
sparc64: Fix accidental syscall restart on child return from clone/fo…
Browse files Browse the repository at this point in the history
…rk/vfork.

This fixes a regression added by
238468b ("[SPARC64]: Use trap type
stored in pt_regs to handle syscall restart.")

Because we now encode the "returning from syscall" status in the
pt_regs area, we have to be mindful to zap it out in the child
of a fork.

During a parallel kernel build I saw an accidental -EINTR return
from vfork() in 'make' because of this bug.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Apr 27, 2008
1 parent 9088881 commit fd73541
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
if (clone_flags & CLONE_SETTLS)
t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];

/* We do not want to accidently trigger system call restart
* handling in the new thread. Therefore, clear out the trap
* type, which will make pt_regs_regs_is_syscall() return false.
*/
pt_regs_clear_trap_type(t->kregs);

return 0;
}

Expand Down

0 comments on commit fd73541

Please sign in to comment.