linux-stable/arch/arm64/lib
Andrey Ryabinin 99b3146b79 arm64: lib: use C string functions with KASAN enabled
[ Upstream commit 19a2ca0fb5 ]

ARM64 has asm implementation of memchr(), memcmp(), str[r]chr(),
str[n]cmp(), str[n]len().  KASAN don't see memory accesses in asm code,
thus it can potentially miss many bugs.

Ifdef out __HAVE_ARCH_* defines of these functions when KASAN is enabled,
so the generic implementations from lib/string.c will be used.

We can't just remove the asm functions because efistub uses them.  And we
can't have two non-weak functions either, so declare the asm functions as
weak.

Link: http://lkml.kernel.org/r/20180920135631.23833-2-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reported-by: Kyeongdon Kim <kyeongdon.kim@lge.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:17:01 +01:00
..
atomic_ll_sc.c
clear_page.S
clear_user.S arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault 2019-11-24 08:19:14 +01:00
copy_from_user.S arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault 2019-11-24 08:19:14 +01:00
copy_in_user.S arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault 2019-11-24 08:19:14 +01:00
copy_page.S arm64/lib: copy_page: use consistent prefetch stride 2017-07-25 10:04:42 +01:00
copy_template.S scripts/spelling.txt: add "overwritting" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
copy_to_user.S arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault 2019-11-24 08:19:14 +01:00
delay.c arm64: use WFE for long delays 2017-10-13 18:56:15 +01:00
Makefile arm64: lse: remove -fcall-used-x0 flag 2018-11-13 11:08:54 -08:00
memchr.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
memcmp.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
memcpy.S arm64: add KASAN support 2015-10-12 17:46:36 +01:00
memmove.S arm64: add KASAN support 2015-10-12 17:46:36 +01:00
memset.S arm64: add KASAN support 2015-10-12 17:46:36 +01:00
strchr.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
strcmp.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
strlen.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
strncmp.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
strnlen.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
strrchr.S arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:17:01 +01:00
tishift.S arm64: export tishift functions to modules 2018-05-21 19:00:48 +01:00
uaccess_flushcache.c arm64: uaccess: Add the uaccess_flushcache.c file 2017-08-10 10:49:21 +01:00