Patch "fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock" has been added to the 6.4-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

    fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock

to the 6.4-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:
     fprobe-add-unlock-to-match-a-succeeded-ftrace_test_r.patch
and it can be found in the queue-6.4 subdirectory.

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



commit 9ea6b366f8d472e6814dbc9aad4e5bfb1d00ac39
Author: Ze Gao <zegao2021@xxxxxxxxx>
Date:   Mon Jul 3 17:23:36 2023 +0800

    fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock
    
    [ Upstream commit 5f0c584daf7464f04114c65dd07269ee2bfedc13 ]
    
    Unlock ftrace recursion lock when fprobe_kprobe_handler() is failed
    because of some running kprobe.
    
    Link: https://lore.kernel.org/all/20230703092336.268371-1-zegao@xxxxxxxxxxx/
    
    Fixes: 3cc4e2c5fbae ("fprobe: make fprobe_kprobe_handler recursion free")
    Reported-by: Yafang <laoar.shao@xxxxxxxxx>
    Closes: https://lore.kernel.org/linux-trace-kernel/CALOAHbC6UpfFOOibdDiC7xFc5YFUgZnk3MZ=3Ny6we=AcrNbew@xxxxxxxxxxxxxx/
    Signed-off-by: Ze Gao <zegao@xxxxxxxxxxx>
    Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Acked-by: Yafang Shao <laoar.shao@xxxxxxxxx>
    Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index 18d36842faf57..93b3e361bb97a 100644
--- a/kernel/trace/fprobe.c
+++ b/kernel/trace/fprobe.c
@@ -102,12 +102,14 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
 
 	if (unlikely(kprobe_running())) {
 		fp->nmissed++;
-		return;
+		goto recursion_unlock;
 	}
 
 	kprobe_busy_begin();
 	__fprobe_handler(ip, parent_ip, ops, fregs);
 	kprobe_busy_end();
+
+recursion_unlock:
 	ftrace_test_recursion_unlock(bit);
 }
 



[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