The patch titled Subject: lib/stackdepot.c: build with -fno-builtin has been added to the -mm tree. Its filename is stackdepot-build-with-fno-builtin.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/stackdepot-build-with-fno-builtin.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/stackdepot-build-with-fno-builtin.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Alexander Potapenko <glider@xxxxxxxxxx> Subject: lib/stackdepot.c: build with -fno-builtin Clang may replace stackdepot_memcmp() with a call to instrumented bcmp(), which is exactly what we wanted to avoid creating stackdepot_memcmp(). Building the file with -fno-builtin prevents such optimizations. This patch has been previously mailed as part of KMSAN RFC patch series. Link: http://lkml.kernel.org/r/20200220141916.55455-2-glider@xxxxxxxxxx Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx> Cc: Vegard Nossum <vegard.nossum@xxxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Marco Elver <elver@xxxxxxxxxx> Cc: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Cc: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/Makefile | 4 ++++ 1 file changed, 4 insertions(+) --- a/lib/Makefile~stackdepot-build-with-fno-builtin +++ a/lib/Makefile @@ -222,6 +222,10 @@ obj-$(CONFIG_MEMREGION) += memregion.o obj-$(CONFIG_STMP_DEVICE) += stmp_device.o obj-$(CONFIG_IRQ_POLL) += irq_poll.o +# stackdepot.c should not be instrumented or call instrumented functions. +# Prevent the compiler from calling builtins like memcmp() or bcmp() from this +# file. +CFLAGS_stackdepot.o += -fno-builtin obj-$(CONFIG_STACKDEPOT) += stackdepot.o KASAN_SANITIZE_stackdepot.o := n KCOV_INSTRUMENT_stackdepot.o := n _ Patches currently in -mm which might be from glider@xxxxxxxxxx are lib-stackdepot-fix-global-out-of-bounds-in-stack_slabs.patch stackdepot-check-depot_index-before-accessing-the-stack-slab.patch stackdepot-build-with-fno-builtin.patch kasan-stackdepot-move-filter_irq_stacks-to-stackdepotc.patch