nios2: fixed broken sys_clone syscall
authorAndreas Oetken <andreas.oetken@siemens.com>
Fri, 19 Feb 2021 06:41:03 +0000 (14:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:16 +0000 (11:38 +0100)
commit1fe02a86fa92dd22b79dd25b1d0fe5cab7024f14
tree638a5f01c2e1d52b00e4c6619b178a2b3a797113
parent9dfb367a23827e4b85872d09f6c57e79b33fa2fd
nios2: fixed broken sys_clone syscall

[ Upstream commit 9abcfcb20320e8f693e89d86573b58e6289931cb ]

The tls pointer must be pushed on the stack prior to calling nios2_clone
as it is the 5th function argument. Prior handling of the tls pointer was
done inside former called function copy_thread_tls using the r8 register
from the current_pt_regs directly. This was a bad design and resulted in
the current bug introduced in 04bd52fb.

Fixes: 04bd52fb ("nios2: enable HAVE_COPY_THREAD_TLS, switch to kernel_clone_args")
Signed-off-by: Andreas Oetken <andreas.oetken@siemens.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/nios2/kernel/entry.S