]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: No need to set the x0-x2 registers in start_thread()
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 16 Oct 2012 16:07:46 +0000 (17:07 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 18 Oct 2012 19:14:01 +0000 (20:14 +0100)
commitbd960f4d1ed556a965d9c18fc7f104a9b2dedc65
treef5f0626fdf4a841ffba5f7ce79e7e8cbfee6a56a
parent70b9d27854df960d03b9a944d346a3961c780c7e
arm64: No need to set the x0-x2 registers in start_thread()

For historical reasons, ARM used to set r0-r2 in start_thread() to the
first values on the user stack when starting a new user application. The
same logic has been inherited in AArch64. The x0 register is overridden
by the sys_execve() return value so it's always zero on success. The x1
and x2 registers are ignored by AArch64 and EABI AArch32 applications,
so we can safely remove the register setting for both native and compat
user space.

This also fixes a potential fault with the kernel accessing user space
stack directly.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm64/include/asm/processor.h