diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2022-05-06 19:02:03 +0800 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2022-05-12 18:00:51 +0200 |
commit | f5e2d8186d5eafc809704fa1b25b5b753f50617c (patch) | |
tree | c8982a34789af2f348368801e36ea8fa2210b4a4 /arch/mips/mm | |
parent | eab691b1a6841813e84abfc8cef392b67efdaede (diff) | |
download | linux-stable-f5e2d8186d5eafc809704fa1b25b5b753f50617c.tar.gz linux-stable-f5e2d8186d5eafc809704fa1b25b5b753f50617c.tar.bz2 linux-stable-f5e2d8186d5eafc809704fa1b25b5b753f50617c.zip |
MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation
If define CONFIG_KPROBES, __kprobes annotation forces the whole function
into the ".kprobes.text" section, NOKPROBE_SYMBOL() only stores the given
function address in the "_kprobe_blacklist" section which is introduced
to maintain kprobes blacklist.
Modify the related code to use NOKPROBE_SYMBOL() to protect functions from
kprobes instead of __kprobes annotation under arch/mips.
No obvious functional change in this patch, some more work needs to be done
to fix the kernel panic when execute the following testcase on mips:
# cd tools/testing/selftests/ftrace
# ./ftracetest test.d/kprobe/multiple_kprobes.tc
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/fault.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 44f98100e84e..b08bc556d30d 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -35,7 +35,7 @@ int show_unhandled_signals = 1; * and the problem, and then passes it off to one of the appropriate * routines. */ -static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write, +static void __do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address) { struct vm_area_struct * vma = NULL; @@ -322,8 +322,9 @@ vmalloc_fault: } #endif } +NOKPROBE_SYMBOL(__do_page_fault); -asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, +asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address) { enum ctx_state prev_state; @@ -332,3 +333,4 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, __do_page_fault(regs, write, address); exception_exit(prev_state); } +NOKPROBE_SYMBOL(do_page_fault); |