diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-21 15:56:52 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:36:33 -0500 |
commit | 9ac08002130b591d0f2ee035aa9062f84f2f15cb (patch) | |
tree | 35262e61fafefd6279eb39b2b45c4de5ee2166a2 /arch/arm64/kernel/process.c | |
parent | b9763ce33fff6b37e1f2e2effb14fb25e67a68f2 (diff) | |
download | linux-9ac08002130b591d0f2ee035aa9062f84f2f15cb.tar.bz2 |
arm64: sanitize copy_thread(), switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/arm64/kernel/process.c')
-rw-r--r-- | arch/arm64/kernel/process.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 8a5f3341861e..5a1335caf6f1 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -235,15 +235,15 @@ asmlinkage void ret_from_fork(void) asm("ret_from_fork"); int copy_thread(unsigned long clone_flags, unsigned long stack_start, unsigned long stk_sz, struct task_struct *p, - struct pt_regs *regs) + struct pt_regs *unused) { struct pt_regs *childregs = task_pt_regs(p); unsigned long tls = p->thread.tp_value; memset(&p->thread.cpu_context, 0, sizeof(struct cpu_context)); - if (likely(regs)) { - *childregs = *regs; + if (likely(!(p->flags & PF_KTHREAD))) { + *childregs = *current_pt_regs(); childregs->regs[0] = 0; if (is_compat_thread(task_thread_info(p))) { if (stack_start) @@ -266,7 +266,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, * for the new thread. */ if (clone_flags & CLONE_SETTLS) - tls = regs->regs[3]; + tls = childregs->regs[3]; } else { memset(childregs, 0, sizeof(struct pt_regs)); childregs->pstate = PSR_MODE_EL1h; |