diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-18 00:55:54 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-22 18:14:17 -0400 |
commit | e0fd18ce1169595df929373cad2ae9b00b2289c2 (patch) | |
tree | ce64180c3935d636de9bac9fbf63d27a0d4d7876 /arch/arm64/kernel/process.c | |
parent | 6a872777ffff6184f4ac10bd71d926d5e6f2491e (diff) | |
download | linux-e0fd18ce1169595df929373cad2ae9b00b2289c2.tar.gz linux-e0fd18ce1169595df929373cad2ae9b00b2289c2.tar.bz2 linux-e0fd18ce1169595df929373cad2ae9b00b2289c2.zip |
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.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index bf615e212c6c..f82987a784af 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 |