]> git.itanic.dy.fi Git - linux-stable/commitdiff
rethook, fprobe: do not trace rethook related functions
authorZe Gao <zegao2021@gmail.com>
Wed, 17 May 2023 03:45:09 +0000 (11:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:30:24 +0000 (17:30 +0100)
commit 571a2a50a8fc546145ffd3bf673547e9fe128ed2 upstream.

These functions are already marked as NOKPROBE to prevent recursion and
we have the same reason to blacklist them if rethook is used with fprobe,
since they are beyond the recursion-free region ftrace can guard.

Link: https://lore.kernel.org/all/20230517034510.15639-5-zegao@tencent.com/
Fixes: f3a112c0c40d ("x86,rethook,kprobes: Replace kretprobe with rethook on x86")
Signed-off-by: Ze Gao <zegao@tencent.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/kernel/probes/Makefile
arch/s390/kernel/Makefile
arch/x86/kernel/Makefile

index c40139e9ca4781e414946bd9e58648f15c89d25a..8265ff497977cffb5559f25a2bd6adcce2eb1a60 100644 (file)
@@ -4,3 +4,5 @@ obj-$(CONFIG_RETHOOK)           += rethook.o rethook_trampoline.o
 obj-$(CONFIG_KPROBES_ON_FTRACE)        += ftrace.o
 obj-$(CONFIG_UPROBES)          += uprobes.o decode-insn.o simulate-insn.o
 CFLAGS_REMOVE_simulate-insn.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_rethook.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_rethook_trampoline.o = $(CC_FLAGS_FTRACE)
index 8983837b3565914b19451546d7b5a1ff61511c95..6b2a051e1f8a2a7fec822ab5b287a9b25fd33a84 100644 (file)
@@ -10,6 +10,7 @@ CFLAGS_REMOVE_ftrace.o                = $(CC_FLAGS_FTRACE)
 
 # Do not trace early setup code
 CFLAGS_REMOVE_early.o          = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_rethook.o                = $(CC_FLAGS_FTRACE)
 
 endif
 
index dd61752f4c966bf0db57abb92472f8c4ae4c0c82..4070a01c11b72af04f429dee966c495275a7dfb6 100644 (file)
@@ -17,6 +17,7 @@ CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
 CFLAGS_REMOVE_head64.o = -pg
 CFLAGS_REMOVE_sev.o = -pg
+CFLAGS_REMOVE_rethook.o = -pg
 endif
 
 KASAN_SANITIZE_head$(BITS).o                           := n