Skip to content

Commit b558616

Browse files
mhiramatctmarinas
authored andcommitted
arm64: kprobes: Remove unneeded RODATA check
Remove unneeded RODATA check from arch_prepare_kprobe(). Since check_kprobe_address_safe() already ensured that the probe address is in kernel text, we don't need to check whether the address in RODATA or not. That must be always false. 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 a872fc8 commit b558616

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

arch/arm64/kernel/probes/kprobes.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs)
9191
int __kprobes arch_prepare_kprobe(struct kprobe *p)
9292
{
9393
unsigned long probe_addr = (unsigned long)p->addr;
94-
extern char __start_rodata[];
95-
extern char __end_rodata[];
9694

9795
if (probe_addr & 0x3)
9896
return -EINVAL;
@@ -106,10 +104,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
106104
if (search_exception_tables(probe_addr))
107105
return -EINVAL;
108106

109-
if (probe_addr >= (unsigned long) __start_rodata &&
110-
probe_addr <= (unsigned long) __end_rodata)
111-
return -EINVAL;
112-
113107
/* decode instruction */
114108
switch (arm_kprobe_decode_insn(p->addr, &p->ainsn)) {
115109
case INSN_REJECTED: /* insn not supported */

0 commit comments

Comments
 (0)