kgdb_breakpoint() usage leads to kernel panic
Takashi Iwai
tiwai at suse.de
Fri Oct 23 07:45:10 UTC 2020
On Thu, 22 Oct 2020 11:03:43 +0200,
Takashi Iwai wrote:
>
> Hi,
>
> we recently stumbled on a kernel crash in amdgpu [*], and the kernel
> messages indicated that it's from kgdb_breakpoint() call in
> ASSERT_CRITICAL() macro.
>
> Since CONFIG_KGDB=y is set on the openSUSE distro kernels, the
> breakpoint is enabled even though CONFIG_DEBUG_KERNEL_DC=n, and this
> leads to a kernel panic because of INT3. Unfortunately there is no
> dynamical control to disable it.
>
> I guess the kernel panic isn't intended for end-users, right? If so,
> shouldn't we cover kgdb_breakpoint() in ASSERT_CRITICAL() also with
> CONFIG_DEBUG_KERNEL_DC?
>
> Also, taking a quick glance at the code, I noticed a few things:
>
> - What's the difference of ASSERT() and ASSERT_CRITICAL()?
> Why ASSERT() uses WARN_ON() and WARN_ON_ONCE() conditionally?
>
> - I couldn't see CONFIG_HAVE_KGDB anywhere else. Is this superfluous?
>
> - CONFIG_DEBUG_KERNEL_DC can have "depends on KGDB" in Kconfig.
> Then the ifdefs can be much simplified.
>
>
> [*] https://bugzilla.suse.com/show_bug.cgi?id=1177973
As there's no reply, I'm going to submit the fix patches.
Takashi
More information about the amd-gfx
mailing list