Re: [PATCH] arm64: kprobes: Fix Uexpected kernel BRK exception at EL1

From: Qais Yousef
Date: Fri Jan 22 2021 - 10:30:57 EST


On 01/22/21 22:36, Masami Hiramatsu wrote:
> > Further analysis showed that kcb->kprobe_status is set to
> > KPROBE_REENTER when the error occurs. By teaching
> > kprobe_breakpoint_ss_handler() to handle this status I can no longer
> > reproduce the problem.
>
> Very good catch! Yes, this missed the reentered kprobe case.
>
> Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

Thanks!

>
> >
> > Fixes: ba090f9cafd5 ("arm64: kprobes: Remove redundant kprobe_step_ctx")
> > Signed-off-by: Qais Yousef <qais.yousef@xxxxxxx>
> > ---
> >
> > Another change in behavior I noticed is that before ba090f9cafd5 ("arm64:
> > kprobes: Remove redundant kprobe_step_ctx") if 'cur' was NULL we wouldn't
> > return DBG_HOOK_ERROR, but after the change we do.
>
> It should not happen, since the KPROBES_BRK_SS_IMM must be used only for
> kprobes's second break which must happen on the trampoline instruction
> buffer, which must set current kprobes before execution.

I see. Thanks for the explanation!

Cheers

--
Qais Yousef