[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210525232103.9d79ff5e396cddd2a9eb818f@kernel.org>
Date: Tue, 25 May 2021 23:21:03 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
rostedt@...dmis.org, naveen.n.rao@...ux.vnet.ibm.com,
ananth@...ux.ibm.com, x86@...nel.org
Subject: Re: [PATCH 2/2] x86,kprobes: WARN if kprobes tries to handle a
fault
On Tue, 25 May 2021 09:25:20 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> With the removal of kprobe::handle_fault there is no reason left that
> kprobe_page_fault() would ever return true on x86, make sure it
> doesn't happen by accident.
OK, this is reasonable to me.
Acked-by: Masami Hiramatsu <mhiramat@...nel.org>
Thank you!
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> arch/x86/mm/fault.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -1186,7 +1186,7 @@ do_kern_addr_fault(struct pt_regs *regs,
> return;
>
> /* kprobes don't want to hook the spurious faults: */
> - if (kprobe_page_fault(regs, X86_TRAP_PF))
> + if (WARN_ON_ONCE(kprobe_page_fault(regs, X86_TRAP_PF)))
> return;
>
> /*
> @@ -1239,7 +1239,7 @@ void do_user_addr_fault(struct pt_regs *
> }
>
> /* kprobes don't want to hook the spurious faults: */
> - if (unlikely(kprobe_page_fault(regs, X86_TRAP_PF)))
> + if (WARN_ON_ONCE(kprobe_page_fault(regs, X86_TRAP_PF)))
> return;
>
> /*
>
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists