[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201207182202.59c8cdeb@gandalf.local.home>
Date: Mon, 7 Dec 2020 18:22:02 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, tglx@...utronix.de,
luto@...nel.org, me@...ehuey.com, x86@...nel.org,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
rocallahan@...il.com, alexandre.chartre@...cle.com,
paulmck@...nel.org, frederic@...nel.org, pbonzini@...hat.com,
sean.j.christopherson@...el.com, pmladek@...e.com,
joel@...lfernandes.org, boris.ostrovsky@...cle.com,
jgross@...e.com, brgerst@...il.com, jpoimboe@...hat.com,
daniel.thompson@...aro.org, julliard@...ehq.org,
pgofman@...eweavers.com
Subject: Re: [PATCH] x86/kprobes: Restore BTF if the single-stepping is
cancelled
Did this patch fall through the cracks?
-- Steve
On Wed, 28 Oct 2020 23:31:10 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> Fix to restore BTF if single-stepping causes a page fault and
> it is cancelled.
>
> Usually the BTF flag was restored when the single stepping is done
> (in resume_execution()). However, if a page fault happens on the
> single stepping instruction, the fault handler is invoked and
> the single stepping is cancelled. Thus, the BTF flag is not
> restored.
>
> Fixes: 1ecc798c6764 ("x86: debugctlmsr kprobes")
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
> arch/x86/kernel/kprobes/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index 547c7abb39f5..39f7d8c3c064 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -937,6 +937,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
> * So clear it by resetting the current kprobe:
> */
> regs->flags &= ~X86_EFLAGS_TF;
> + /*
> + * Since the single step (trap) has been cancelled,
> + * we need to restore BTF here.
> + */
> + restore_btf();
>
> /*
> * If the TF flag was set before the kprobe hit,
Powered by blists - more mailing lists