Commit 829a23e6 authored by Douglas Anderson's avatar Douglas Anderson Committed by Khalid Elmously

kgdb: Prevent infinite recursive entries to the debugger

BugLink: https://bugs.launchpad.net/bugs/1884564

[ Upstream commit 3ca676e4 ]

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: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20200507130644.v4.6.I89de39f68736c9de610e6f241e68d8dbc44bc266@changeidSigned-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 0578696a
...@@ -443,6 +443,7 @@ static int kgdb_reenter_check(struct kgdb_state *ks) ...@@ -443,6 +443,7 @@ static int kgdb_reenter_check(struct kgdb_state *ks)
if (exception_level > 1) { if (exception_level > 1) {
dump_stack(); dump_stack();
kgdb_io_module_registered = false;
panic("Recursive entry to debugger"); panic("Recursive entry to debugger");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment