External kmod build failed on KASAN-enabled kernel

From: richard clark
Date: Tue Jun 30 2020 - 04:34:32 EST


Hi,

The same kmod source code can be built on KASAN-disabled kernel
(5.7.0), but after enable it with CONFIG_KASAN=y, the kmod can't build
on the new installed KASAN-enabled kernel with below error message,
seems no relevant answers for this issue with google:

root@build-ws:/home/mm/slab# make

make -C /lib/modules/5.7.0/build M=/home/mm/slab modules

make[1]: Entering directory '/home/linux-5.7'

CC [M] /home/mm/slab/tap_slab.o

MODPOST 1 modules

ERROR: modpost: "__asan_register_globals" [/home/mm/slab/tap_slab.ko] undefined!

ERROR: modpost: "__asan_unregister_globals"
[/home/mm/slab/tap_slab.ko] undefined!

ERROR: modpost: "__asan_load8_noabort" [/home/mm/slab/tap_slab.ko] undefined!

scripts/Makefile.modpost:94: recipe for target '__modpost' failed

make[2]: *** [__modpost] Error 1

Makefile:1642: recipe for target 'modules' failed

make[1]: *** [modules] Error 2

make[1]: Leaving directory '/home/linux-5.7'

Makefile:6: recipe for target 'default' failed

make: *** [default] Error 2
===
Regards,
Richard