lkml.org 
[lkml]   [2020]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 04/23] arm64: kprobes: Use generic kretprobe trampoline handler
Hi,

On Fri, Aug 28, 2020 at 09:27:22PM +0900, Masami Hiramatsu wrote:
> Use the generic kretprobe trampoline handler, and use the
> kernel_stack_pointer(regs) for framepointer verification.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> arch/arm64/kernel/probes/kprobes.c | 78 +-----------------------------------
> 1 file changed, 3 insertions(+), 75 deletions(-)

> + return (void *)kretprobe_trampoline_handler(regs, &kretprobe_trampoline,
> + (void *)kernel_stack_pointer(regs));
> }
>
> void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
> struct pt_regs *regs)
> {
> ri->ret_addr = (kprobe_opcode_t *)regs->regs[30];
> + ri->fp = (void *)kernel_stack_pointer(regs);

This is probably a nomenclature problem, but what exactly is
kretprobe_instance::fp used for?

I ask because arm64's frame pointer lives in x29 (and is not necessarily
the same as the stack pointer at function boundaries), so the naming
is potentially misleading and possibly worth a comment or rename.

Thanks,
Mark.

\
 
 \ /
  Last update: 2020-08-28 15:46    [W:0.255 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site