Re: mm/kmsan/instrumentation.c:41:26: warning: no previous prototype for function '__msan_metadata_ptr_for_load_n'

From: Alexander Potapenko
Date: Thu Jan 12 2023 - 04:26:47 EST


> > Would it also make sense to exclude KMSAN with CONFIG_SLUB_TINY?
>
> If the root causes are fixed, then it's not necessary? AFAIK SLUB_TINY only
> indirectly caused KMSAN to be newly enabled in some configs, but there's no
> fundamental incompatibility that I know of.

So far I couldn't manage to boot KMSAN with SLUB_TINY, it just dies
somewhere very early with the following stacktrace:

#0 0xffffffff9044134a in native_halt () at ./arch/x86/include/asm/irqflags.h:57
#1 halt () at ./arch/x86/include/asm/irqflags.h:98
#2 early_fixup_exception (regs=regs@entry=0xffffffff8fa03d08,
trapnr=trapnr@entry=14) at arch/x86/mm/extable.c:340
#3 0xffffffff903c23db in do_early_exception (regs=0xffffffff8fa03d08,
trapnr=14) at arch/x86/kernel/head64.c:424
#4 0xffffffff903c214f in early_idt_handler_common () at
arch/x86/kernel/head_64.S:483
#5 0x0000000000000000 in ?? ()

The same kernel boots (to some extent) without CONFIG_KMSAN, so my
guess is that we're instrumenting something that is not supposed to be
instrumented.
But SLUB_TINY doesn't add new source files, and it's also unlikely to
kick in before mm_init(), right?

--
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg