summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/process.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-18 00:55:54 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-22 18:14:17 -0400
commite0fd18ce1169595df929373cad2ae9b00b2289c2 (patch)
treece64180c3935d636de9bac9fbf63d27a0d4d7876 /arch/arm64/kernel/process.c
parent6a872777ffff6184f4ac10bd71d926d5e6f2491e (diff)
arm64: get rid of fork/vfork/clone wrappers
[fixes from Catalin Marinas folded] Acked-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Catalin Marinas <catalin.marinas@arm.com> 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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index bf615e212c6..f82987a784a 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -246,14 +246,20 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
*childregs = *regs;
childregs->regs[0] = 0;
if (is_compat_thread(task_thread_info(p))) {
- childregs->compat_sp = stack_start;
+ if (stack_start)
+ childregs->compat_sp = stack_start;
} else {
/*
* Read the current TLS pointer from tpidr_el0 as it may be
* out-of-sync with the saved value.
*/
asm("mrs %0, tpidr_el0" : "=r" (tls));
- childregs->sp = stack_start;
+ if (stack_start) {
+ /* 16-byte aligned stack mandatory on AArch64 */
+ if (stack_start & 15)
+ return -EINVAL;
+ childregs->sp = stack_start;
+ }
}
/*
* If a TLS pointer was passed to clone (4th argument), use it