Skip to contentSkip to conversation

riscv: add do_page_fault and do_trap_break into the kprobes blacklist

PATCH In review Jisheng Zhang 3 participants 3 messages Mar 29, 2021 – Apr 12, 2021 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: add do_page_fault and do_trap_break into the kprobes blacklist

From: Jisheng Zhang <[email protected]>

These two functions are used to implement the kprobes feature so they can't be kprobed.

Fixes c22b0bcb1dd0 ("riscv: Add kprobes supported")
---
 arch/riscv/kernel/traps.c | 1 +
 arch/riscv/mm/fault.c     | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/kernel/traps.c +1 -0
index 0879b5df11b9..1357abf79570 100644
@@ -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)
arch/riscv/mm/fault.c +1 -0
index 8f17519208c7..c5dbd55cbf7c 100644
@@ -328,3 +328,4 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
 	}
 	return;
 }
+NOKPROBE_SYMBOL(do_page_fault);
Signature · 1 line
2.31.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Tue, 30 Mar 2021 02:12:26 +0800 Jisheng Zhang <[email protected]>…

From: Jisheng Zhang <[email protected]>

These two functions are used to implement the kprobes feature so they can't be kprobed.

Looks good to me.

Thanks,

Quoted 32 lines
Fixes c22b0bcb1dd0 ("riscv: Add kprobes supported")
---
 arch/riscv/kernel/traps.c | 1 +
 arch/riscv/mm/fault.c     | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/kernel/traps.c +1 -0
index 0879b5df11b9..1357abf79570 100644
@@ -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)
arch/riscv/mm/fault.c +1 -0
index 8f17519208c7..c5dbd55cbf7c 100644
@@ -328,3 +328,4 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
 	}
 	return;
 }
+NOKPROBE_SYMBOL(do_page_fault);
Signature · 1 line
2.31.0
Signature · 6 lines
Masami Hiramatsu <[email protected]>

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
maintainer
#2 lore raw
In reply to Jisheng Zhang
Quoted 29 lines · On Mon, 29 Mar 2021 11:12:26 PDT (-0700), [email protected] wrote:

From: Jisheng Zhang <[email protected]>

These two functions are used to implement the kprobes feature so they can't be kprobed.

Fixes c22b0bcb1dd0 ("riscv: Add kprobes supported")
---
 arch/riscv/kernel/traps.c | 1 +
 arch/riscv/mm/fault.c     | 1 +
 2 files changed, 2 insertions(+)
arch/riscv/kernel/traps.c +1 -0
index 0879b5df11b9..1357abf79570 100644
@@ -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)
arch/riscv/mm/fault.c +0 -0
index 8f17519208c7..c5dbd55cbf7c 100644

arch/riscv/mm/fault.c asmlinkage void do_page_fault(struct pt_regs *regs) · line 331

Quoted 4 lines
arch/riscv/mm/fault.c +1 -0
@@ -328,3 +328,4 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
 	}
 	return;
 }
+NOKPROBE_SYMBOL(do_page_fault);

Thanks, this is on fixes.