riscv: add do_page_fault and do_trap_break into the kprobes blacklist
authorJisheng Zhang <jszhang@kernel.org>
Mon, 29 Mar 2021 18:12:26 +0000 (02:12 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 16 Apr 2021 04:32:28 +0000 (21:32 -0700)
These two functions are used to implement the kprobes feature so they
can't be kprobed.

Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/traps.c
arch/riscv/mm/fault.c

index 0879b5d..1357abf 100644 (file)
@@ -178,6 +178,7 @@ asmlinkage __visible void do_trap_break(struct pt_regs *regs)
        else
                die(regs, "Kernel BUG");
 }
+NOKPROBE_SYMBOL(do_trap_break);
 
 #ifdef CONFIG_GENERIC_BUG
 int is_valid_bugaddr(unsigned long pc)
index 8f17519..c5dbd55 100644 (file)
@@ -328,3 +328,4 @@ good_area:
        }
        return;
 }
+NOKPROBE_SYMBOL(do_page_fault);