Skip to content

Commit a872fc8

Browse files
mhiramatctmarinas
authored andcommitted
arm64: kprobes: Move extable address check into arch_prepare_kprobe()
Move extable address check into arch_prepare_kprobe() from arch_within_kprobe_blacklist(). The blacklist is exposed via debugfs as a list of symbols. The extable entries are smaller, so must be filtered out by arch_prepare_kprobe(). Acked-by: Will Deacon <will.deacon@arm.com> Reviewed-by: James Morse <james.morse@arm.com> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 9e98c67 commit a872fc8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/arm64/kernel/probes/kprobes.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
102102

103103
if (in_exception_text(probe_addr))
104104
return -EINVAL;
105+
106+
if (search_exception_tables(probe_addr))
107+
return -EINVAL;
108+
105109
if (probe_addr >= (unsigned long) __start_rodata &&
106110
probe_addr <= (unsigned long) __end_rodata)
107111
return -EINVAL;
@@ -485,8 +489,7 @@ bool arch_within_kprobe_blacklist(unsigned long addr)
485489
(addr >= (unsigned long)__idmap_text_start &&
486490
addr < (unsigned long)__idmap_text_end) ||
487491
(addr >= (unsigned long)__hyp_text_start &&
488-
addr < (unsigned long)__hyp_text_end) ||
489-
!!search_exception_tables(addr))
492+
addr < (unsigned long)__hyp_text_end))
490493
return true;
491494

492495
if (!is_kernel_in_hyp_mode()) {

0 commit comments

Comments
 (0)