Re: [patch 02/10] x86/mce: Disable tracing and kprobes on do_machine_check()

Borislav Petkov
2020-02-26T11:18:36Z

On Tue, Feb 25, 2020 at 10:36:38PM +0100, Thomas Gleixner wrote:
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -1213,8 +1213,14 @@ static void __mc_scan_banks(struct mce *
> * On Intel systems this is entered on all CPUs in parallel through
> * MCE broadcast. However some CPUs might be broken beyond repair,
> * so be always careful when synchronizing with others.
> + *
> + * Tracing and kprobes are disabled: if we interrupted a kernel context
> + * with IF=1, we need to minimize stack usage. There are also recursion
> + * issues: if the machine check was due to a failure of the memory
> + * backing the user stack, tracing that reads the user stack will cause
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Had to read this a couple of times to parse that formulation properly.
Make that

"... backing the user stack, tracing code which accesses same user stack
will potentially cause an infinite recursion."

With that:

Reviewed-by: Borislav Petkov <bp@suse.de>

Thx.

--
Regards/Gruss,
Boris.