Skip to content

Commit 6e08af0

Browse files
mhiramatctmarinas
authored andcommitted
arm64: kprobes: Move exception_text check in blacklist
Move exception/irqentry text address check in blacklist, since those are symbol based rejection. If we prohibit probing on the symbols in exception_text, those should be blacklisted. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b558616 commit 6e08af0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/arm64/kernel/probes/kprobes.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
9898
/* copy instruction */
9999
p->opcode = le32_to_cpu(*p->addr);
100100

101-
if (in_exception_text(probe_addr))
102-
return -EINVAL;
103-
104101
if (search_exception_tables(probe_addr))
105102
return -EINVAL;
106103

@@ -483,7 +480,8 @@ bool arch_within_kprobe_blacklist(unsigned long addr)
483480
(addr >= (unsigned long)__idmap_text_start &&
484481
addr < (unsigned long)__idmap_text_end) ||
485482
(addr >= (unsigned long)__hyp_text_start &&
486-
addr < (unsigned long)__hyp_text_end))
483+
addr < (unsigned long)__hyp_text_end) ||
484+
in_exception_text(addr))
487485
return true;
488486

489487
if (!is_kernel_in_hyp_mode()) {

0 commit comments

Comments
 (0)