Patch "nios2: fixed broken sys_clone syscall" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nios2: fixed broken sys_clone syscall

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nios2-fixed-broken-sys_clone-syscall.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 66ad0e2ad7650c7aec7a3740902a44be393c827a
Author: Andreas Oetken <andreas.oetken@xxxxxxxxxxx>
Date:   Fri Feb 19 14:41:03 2021 +0800

    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@xxxxxxxxxxx>
    Signed-off-by: Ley Foon Tan <ley.foon.tan@xxxxxxxxx>
    Acked-by: Christian Brauner <christian.brauner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
index da8442450e460..0794cd7803dfe 100644
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -389,7 +389,10 @@ ENTRY(ret_from_interrupt)
  */
 ENTRY(sys_clone)
 	SAVE_SWITCH_STACK
+	subi    sp, sp, 4 /* make space for tls pointer */
+	stw     r8, 0(sp) /* pass tls pointer (r8) via stack (5th argument) */
 	call	nios2_clone
+	addi    sp, sp, 4
 	RESTORE_SWITCH_STACK
 	ret
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux