[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 2/3] kgdb: Add NOKPROBE labels on the trap handler functions

On Sun, Sep 27, 2020 at 2:16 PM Daniel Thompson
<> 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 <>
> ---
> 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 <>


 \ /
  Last update: 2020-09-29 01:25    [W:0.048 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site