Re: [PATCH 13/43] kmsan: add KMSAN runtime core

From
Alexander Potapenko <glider@google.com>
Date
2021-12-16 10:34:39
Also in
linux-mm, lkml
Reply to
Greg Kroah-Hartman, 2021-12-14
On Tue, Dec 14, 2021 at 5:34 PM Greg Kroah-Hartman
[off-list ref] wrote:
On Tue, Dec 14, 2021 at 05:20:20PM +0100, Alexander Potapenko wrote:
quoted
This patch adds the core parts of KMSAN runtime and associated files:

  - include/linux/kmsan-checks.h: user API to poison/unpoison/check
    the kernel memory;
  - include/linux/kmsan.h: declarations of KMSAN hooks to be referenced
    outside of KMSAN runtime;
  - lib/Kconfig.kmsan: CONFIG_KMSAN and related declarations;
  - Makefile, mm/Makefile, mm/kmsan/Makefile: boilerplate Makefile code;
  - mm/kmsan/annotations.c: non-inlineable implementation of KMSAN_INIT();
  - mm/kmsan/core.c: core functions that operate with shadow and origin
    memory and perform checks, utility functions;
  - mm/kmsan/hooks.c: KMSAN hooks for kernel subsystems;
  - mm/kmsan/init.c: KMSAN initialization routines;
  - mm/kmsan/instrumentation.c: functions called by KMSAN instrumentation;
  - mm/kmsan/kmsan.h: internal KMSAN declarations;
  - mm/kmsan/shadow.c: routines that encapsulate metadata creation and
    addressing;
  - scripts/Makefile.kmsan: CFLAGS_KMSAN
  - scripts/Makefile.lib: KMSAN_SANITIZE and KMSAN_ENABLE_CHECKS macros

That's an odd way to write a changelog, don't you think?
Agreed. I'll try to concentrate on the functionality instead. Sorry about that.
You need to describe what you are doing here and why you are doing it.
Not a list of file names, we can see that in the diffstat.

Also, you don't mention you are doing USB stuff here at all.  And why
are you doing it here?  That should be added in a later patch.
You are right, USB is a good example of a stand-alone feature that can
be moved to a separate patch.
Break this up into smaller, logical, pieces that add the infrastructure
and build on it.  Don't just chop your patches up on a logical-file
boundry, as you are adding stuff in this patch that you do not need for
many more later on, which means it was not needed here.
Just to make sure I don't misunderstand - for example for "kmsan: mm:
call KMSAN hooks from SLUB code", would it be better to pull the code
in mm/kmsan/core.c implementing kmsan_slab_alloc() and
kmsan_slab_free() into that patch?
I thought maintainers would prefer to have patches to their code
separated from KMSAN code, but if it's not true, I can surely fix
that.
thanks,

greg k-h


-- 
Alexander Potapenko
Software Engineer

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

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Thread (74 messages) 74 messages, 7 authors, last reply 2022-03-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help