Re: [PATCH] x86/kexec: Disable KCOV instrumentation after load_segments()

From: Aleksandr Nogikh

Date: Mon Mar 16 2026 - 06:12:42 EST


On Sun, Mar 15, 2026 at 1:19 PM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Mon, Feb 16, 2026 at 06:37:16PM +0100, Aleksandr Nogikh wrote:
> > Disabling instrumentation for the individual functions would be too
> > fragile, so let's fix the bug by disabling KCOV instrumentation for
> > the whole machine_kexec_64.c and physaddr.c.
>
> Seems like a whack-a-mole thing to me. Why not make KEXEC depend on !KCOV?

Some more context:
The problem I am trying to solve is enabling crash dump collection in
syzkaller. For this, the tool loads a panic kernel before fuzzing and
then calls makedumpfile after the panic (which fails due to the bug I
mentioned in the patch). It requires both KEXEC and KCOV.

The most whack-a-mole solution was to disable instrumentation for
several functions called after load_segments(); this particular patch
is more generic, but yes, it can still be fragile. Another approach
would be to add more checks to
__sanitizer_cov_trace_pc()/check_kcov_mode(), but this would also be
somewhat undesirable as it would slow KCOV down even further.

--
Aleksandr




>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette