Patch "powerpc/ftrace: Fix stack teardown in ftrace_no_trace" has been added to the 6.1-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

    powerpc/ftrace: Fix stack teardown in ftrace_no_trace

to the 6.1-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:
     powerpc-ftrace-fix-stack-teardown-in-ftrace_no_trace.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 7c103535ae04f336f97c5657304b0bbb95fb9433
Author: Naveen N Rao <naveen@xxxxxxxxxx>
Date:   Thu Nov 30 12:29:47 2023 +0530

    powerpc/ftrace: Fix stack teardown in ftrace_no_trace
    
    [ Upstream commit 4b3338aaa74d7d4ec5b6734dc298f0db94ec83d2 ]
    
    Commit 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix
    stack unwind") added use of a new stack frame on ftrace entry to fix
    stack unwind. However, the commit missed updating the offset used while
    tearing down the ftrace stack when ftrace is disabled. Fix the same.
    
    In addition, the commit missed saving the correct stack pointer in
    pt_regs. Update the same.
    
    Fixes: 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind")
    Cc: stable@xxxxxxxxxxxxxxx # v6.5+
    Signed-off-by: Naveen N Rao <naveen@xxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/20231130065947.2188860-1-naveen@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/trace/ftrace_mprofile.S b/arch/powerpc/kernel/trace/ftrace_mprofile.S
index 6f9c2dea905b7..f4a72b38488f7 100644
--- a/arch/powerpc/kernel/trace/ftrace_mprofile.S
+++ b/arch/powerpc/kernel/trace/ftrace_mprofile.S
@@ -62,7 +62,7 @@
 	.endif
 
 	/* Save previous stack pointer (r1) */
-	addi	r8, r1, SWITCH_FRAME_SIZE
+	addi	r8, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
 	PPC_STL	r8, GPR1(r1)
 
 	.if \allregs == 1
@@ -182,7 +182,7 @@ ftrace_no_trace:
 	mflr	r3
 	mtctr	r3
 	REST_GPR(3, r1)
-	addi	r1, r1, SWITCH_FRAME_SIZE
+	addi	r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
 	mtlr	r0
 	bctr
 #endif




[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