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

Qais Yousef qais.yousef at arm.com
Fri Jan 22 10:29:21 EST 2021


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 at kernel.org>

Thanks!

> 
> > 
> > Fixes: ba090f9cafd5 ("arm64: kprobes: Remove redundant kprobe_step_ctx")
> > Signed-off-by: Qais Yousef <qais.yousef at arm.com>
> > ---
> > 
> > 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



More information about the linux-arm-kernel mailing list