aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/process.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index bc03526d25de..1f816f0d7740 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -503,7 +503,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
503{ 503{
504 struct pt_regs *childregs, *kregs; 504 struct pt_regs *childregs, *kregs;
505 extern void ret_from_fork(void); 505 extern void ret_from_fork(void);
506 unsigned long sp = (unsigned long)p->thread_info + THREAD_SIZE; 506 unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
507 507
508 CHECK_FULL_REGS(regs); 508 CHECK_FULL_REGS(regs);
509 /* Copy registers */ 509 /* Copy registers */
@@ -588,10 +588,8 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
588 * set. Do it now. 588 * set. Do it now.
589 */ 589 */
590 if (!current->thread.regs) { 590 if (!current->thread.regs) {
591 unsigned long childregs = (unsigned long)current->thread_info + 591 struct pt_regs *regs = task_stack_page(current) + THREAD_SIZE;
592 THREAD_SIZE; 592 current->thread.regs = regs - 1;
593 childregs -= sizeof(struct pt_regs);
594 current->thread.regs = (struct pt_regs *)childregs;
595 } 593 }
596 594
597 memset(regs->gpr, 0, sizeof(regs->gpr)); 595 memset(regs->gpr, 0, sizeof(regs->gpr));
@@ -767,7 +765,7 @@ out:
767static int validate_sp(unsigned long sp, struct task_struct *p, 765static int validate_sp(unsigned long sp, struct task_struct *p,
768 unsigned long nbytes) 766 unsigned long nbytes)
769{ 767{
770 unsigned long stack_page = (unsigned long)p->thread_info; 768 unsigned long stack_page = (unsigned long)task_stack_page(p);
771 769
772 if (sp >= stack_page + sizeof(struct thread_struct) 770 if (sp >= stack_page + sizeof(struct thread_struct)
773 && sp <= stack_page + THREAD_SIZE - nbytes) 771 && sp <= stack_page + THREAD_SIZE - nbytes)