powerpc: prepare string/mem functions for KASAN
CONFIG_KASAN implements wrappers for memcpy() memmove() and memset() Those wrappers are doing the verification then call respectively __memcpy() __memmove() and __memset(). The arches are therefore expected to rename their optimised functions that way. For files on which KASAN is inhibited, #defines are used to allow them to directly call optimised versions of the functions without going through the KASAN wrappers. See commit 393f203f ("x86_64: kasan: add interceptors for memset/memmove/memcpy functions") for details. Other string / mem functions do not (yet) have kasan wrappers, we therefore have to fallback to the generic versions when KASAN is active, otherwise KASAN checks will be skipped. Signed-off-by:Christophe Leroy <christophe.leroy@c-s.fr> [mpe: Fixups to keep selftests working] Signed-off-by:
Michael Ellerman <mpe@ellerman.id.au>
Showing
- arch/powerpc/include/asm/kasan.h 15 additions, 0 deletionsarch/powerpc/include/asm/kasan.h
- arch/powerpc/include/asm/string.h 29 additions, 3 deletionsarch/powerpc/include/asm/string.h
- arch/powerpc/kernel/prom_init_check.sh 9 additions, 1 deletionarch/powerpc/kernel/prom_init_check.sh
- arch/powerpc/lib/Makefile 8 additions, 3 deletionsarch/powerpc/lib/Makefile
- arch/powerpc/lib/copy_32.S 9 additions, 3 deletionsarch/powerpc/lib/copy_32.S
- arch/powerpc/lib/mem_64.S 7 additions, 2 deletionsarch/powerpc/lib/mem_64.S
- arch/powerpc/lib/memcpy_64.S 3 additions, 1 deletionarch/powerpc/lib/memcpy_64.S
- tools/testing/selftests/powerpc/copyloops/asm/export.h 1 addition, 0 deletionstools/testing/selftests/powerpc/copyloops/asm/export.h
- tools/testing/selftests/powerpc/copyloops/asm/kasan.h 0 additions, 0 deletionstools/testing/selftests/powerpc/copyloops/asm/kasan.h
- tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h 1 addition, 0 deletionstools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
Loading
Please register or sign in to comment