lkml.org 
[lkml]   [2021]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] arm64: kprobes: Fix Uexpected kernel BRK exception at EL1
On Fri, Jan 22, 2021 at 11:09:09AM +0000, Qais Yousef wrote:
> I was hitting the below panic continuously when attaching kprobes to
> scheduler functions

[...]

> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index 89c64ada8732..66aac2881ba8 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -352,8 +352,8 @@ kprobe_breakpoint_ss_handler(struct pt_regs *regs, unsigned int esr)
> unsigned long addr = instruction_pointer(regs);
> struct kprobe *cur = kprobe_running();
>
> - if (cur && (kcb->kprobe_status == KPROBE_HIT_SS)
> - && ((unsigned long)&cur->ainsn.api.insn[1] == addr)) {
> + if (cur && (kcb->kprobe_status & (KPROBE_HIT_SS | KPROBE_REENTER)) &&
> + ((unsigned long)&cur->ainsn.api.insn[1] == addr)) {
> kprobes_restore_local_irqflag(kcb, regs);
> post_kprobe_handler(cur, kcb, regs);

Acked-by: Will Deacon <will@kernel.org>

Catalin can pick this up for 5.11.

Will

\
 
 \ /
  Last update: 2021-01-22 18:37    [W:2.226 / U:2.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site