On Sat, May 18, 2019 at 06:11:13PM +0200, Ard Biesheuvel wrote: > The KASAN subsystem wraps calls to memcpy(), memset() and memmove() > to sanitize the arguments before invoking the actual routines, which > have been renamed to __memcpy(), __memset() and __memmove(), > respectively. When CONFIG_KASAN is enabled for the kernel build but > KASAN code generation is disabled for the compilation unit (which is > needed for things like the EFI stub or the decompressor), the string > routines are just #define'd to their __ prefixed names so that they > are simply invoked directly. > > This does however rely on those __ prefixed names to exist in the > symbol namespace, which is not currently the case for the x86 > decompressor, which may lead to errors like > > drivers/firmware/efi/libstub/tpm.o: In function `efi_retrieve_tpm2_eventlog': > tpm.c:(.text+0x2a8): undefined reference to `__memcpy' > > So let's expose the __ prefixed symbols in the decompressor when > KASAN is enabled. > > Cc: Andrey Konovalov <andreyknvl@xxxxxxxxxx> > Cc: Matthew Garrett <matthewgarrett@xxxxxxxxxx> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> Acked-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx> /Jarkko