Skip to content

Commit 3ca676e

Browse files
diandersDaniel Thompson
authored andcommitted
kgdb: Prevent infinite recursive entries to the debugger
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]>
1 parent b1a57bb commit 3ca676e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/debug/debug_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ static int kgdb_reenter_check(struct kgdb_state *ks)
530530

531531
if (exception_level > 1) {
532532
dump_stack();
533+
kgdb_io_module_registered = false;
533534
panic("Recursive entry to debugger");
534535
}
535536

0 commit comments

Comments
 (0)