aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 92484c2130c6..00ac66fa5c6b 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -254,7 +254,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
254 regs.flags = X86_EFLAGS_IF; 254 regs.flags = X86_EFLAGS_IF;
255 255
256 /* Ok, create the new process.. */ 256 /* Ok, create the new process.. */
257 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, ~0UL, &regs, 0, NULL, NULL); 257 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
258} 258}
259EXPORT_SYMBOL(kernel_thread); 259EXPORT_SYMBOL(kernel_thread);
260 260
@@ -312,8 +312,9 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
312 *childregs = *regs; 312 *childregs = *regs;
313 313
314 childregs->ax = 0; 314 childregs->ax = 0;
315 childregs->sp = sp; 315 if (user_mode(regs))
316 if (sp == ~0UL) 316 childregs->sp = sp;
317 else
317 childregs->sp = (unsigned long)childregs; 318 childregs->sp = (unsigned long)childregs;
318 319
319 p->thread.sp = (unsigned long) childregs; 320 p->thread.sp = (unsigned long) childregs;