Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
kgdb: Prevent infinite recursive entries to the debugger
Browse files Browse the repository at this point in the history
[ Upstream commit 3ca676e ]

If we detect that we recursively entered the debugger we should hack
our I/O ops to NULL so that the panic() in the next line won't
actually cause another recursion into the debugger.  The first line of
kgdb_panic() will check this and return.

Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
Link: https://lore.kernel.org/r/20200507130644.v4.6.I89de39f68736c9de610e6f241e68d8dbc44bc266@changeid
Signed-off-by: Daniel Thompson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
dianders authored and gregkh committed Jun 22, 2020
1 parent 1343e0a commit 308c209
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/debug/debug_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static int kgdb_reenter_check(struct kgdb_state *ks)

if (exception_level > 1) {
dump_stack();
kgdb_io_module_registered = false;
panic("Recursive entry to debugger");
}

Expand Down

0 comments on commit 308c209

Please sign in to comment.