[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=X5Ro_MtGMJDCCjnB1_CPzRPHbZx5ovQ6L8JbpNNdyngA@mail.gmail.com>
Date: Mon, 28 Sep 2020 15:44:12 -0700
From: Doug Anderson <dianders@...omium.org>
To: Daniel Thompson <daniel.thompson@...aro.org>
Cc: Jason Wessel <jason.wessel@...driver.com>,
Peter Zijlstra <peterz@...radead.org>,
Sumit Garg <sumit.garg@...aro.org>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Will Deacon <will@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
kgdb-bugreport@...ts.sourceforge.net,
LKML <linux-kernel@...r.kernel.org>,
Patch Tracking <patches@...aro.org>
Subject: Re: [PATCH v3 2/3] kgdb: Add NOKPROBE labels on the trap handler functions
Hi,
On Sun, Sep 27, 2020 at 2:16 PM Daniel Thompson
<daniel.thompson@...aro.org> wrote:
>
> Currently kgdb honours the kprobe blocklist but doesn't place its own
> trap handling code on the list. Add labels to discourage attempting to
> use kgdb to debug itself.
>
> Not every functions that executes from the trap handler needs to be
> marked up: relatively early in the trap handler execution (just after
> we bring the other CPUs to a halt) all breakpoints are replaced with
> the original opcodes. This patch marks up code in the debug_core that
> executes between trap entry and the breakpoints being deactivated
> and, also, code that executes between breakpoint activation and trap
> exit.
>
> To be clear these changes are not sufficient to make recursive trapping
> impossible since cover all the library calls made during kgdb's
> entry/exit logic. However going much further whilst we are sharing the
> kprobe blocklist risks reducing the capabilities of kprobe and this
> would be a bad trade off (especially so given kgdb's users are currently
> conditioned to avoid recursive traps).
>
> Signed-off-by: Daniel Thompson <daniel.thompson@...aro.org>
> ---
> kernel/debug/debug_core.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
I didn't go on any more hunts for missing functions since this seems
fine to me. It's mostly just trying to make it a little harder for
someone to shoot themselves in the foot, after all. ;-)
Reviewed-by: Douglas Anderson <dianders@...omium.org>
-Doug
Powered by blists - more mailing lists