Patch "s390/unwind: fix fgraph return address recovery" has been added to the 5.19-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

    s390/unwind: fix fgraph return address recovery

to the 5.19-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:
     s390-unwind-fix-fgraph-return-address-recovery.patch
and it can be found in the queue-5.19 subdirectory.

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



commit 7367c31efb79894a0254894fb361a76805e101da
Author: Sumanth Korikkar <sumanthk@xxxxxxxxxxxxx>
Date:   Tue Jul 26 18:57:59 2022 +0200

    s390/unwind: fix fgraph return address recovery
    
    [ Upstream commit ded466e1806686794b403ebf031133bbaca76bb2 ]
    
    When HAVE_FUNCTION_GRAPH_RET_ADDR_PTR is defined, the return
    address to the fgraph caller is recovered by tagging it along with the
    stack pointer of ftrace stack. This makes the stack unwinding more
    reliable.
    
    When the fgraph return address is modified to return_to_handler,
    ftrace_graph_ret_addr tries to restore it to the original
    value using tagged stack pointer.
    
    Fix this by passing tagged sp to ftrace_graph_ret_addr.
    
    Fixes: d81675b60d09 ("s390/unwind: recover kretprobe modified return address in stacktrace")
    Cc: <stable@xxxxxxxxxxxxxxx> # 5.18
    Reviewed-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>
    Signed-off-by: Sumanth Korikkar <sumanthk@xxxxxxxxxxxxx>
    Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/s390/include/asm/unwind.h b/arch/s390/include/asm/unwind.h
index 0bf06f1682d8..02462e7100c1 100644
--- a/arch/s390/include/asm/unwind.h
+++ b/arch/s390/include/asm/unwind.h
@@ -47,7 +47,7 @@ struct unwind_state {
 static inline unsigned long unwind_recover_ret_addr(struct unwind_state *state,
 						    unsigned long ip)
 {
-	ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, NULL);
+	ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, (void *)state->sp);
 	if (is_kretprobe_trampoline(ip))
 		ip = kretprobe_find_ret_addr(state->task, (void *)state->sp, &state->kr_cur);
 	return ip;



[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