summaryrefslogtreecommitdiffstats
path: root/arch/arm64/lib/strncmp.S
diff options
context:
space:
mode:
authorAndrey Ryabinin2018-10-27 00:02:30 +0200
committerLinus Torvalds2018-10-27 01:25:18 +0200
commit19a2ca0fb560fd7be7b5293c6b652c6d6078dcde (patch)
treec4ed897c25ef86a5b04565027e6f7e65ff3d7f45 /arch/arm64/lib/strncmp.S
parentinclude/linux/linkage.h: align weak symbols (diff)
downloadkernel-qcow2-linux-19a2ca0fb560fd7be7b5293c6b652c6d6078dcde.tar.gz
kernel-qcow2-linux-19a2ca0fb560fd7be7b5293c6b652c6d6078dcde.tar.xz
kernel-qcow2-linux-19a2ca0fb560fd7be7b5293c6b652c6d6078dcde.zip
arm64: lib: use C string functions with KASAN enabled
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>
Diffstat (limited to 'arch/arm64/lib/strncmp.S')
-rw-r--r--arch/arm64/lib/strncmp.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/lib/strncmp.S b/arch/arm64/lib/strncmp.S
index e267044761c6..66bd145935d9 100644
--- a/arch/arm64/lib/strncmp.S
+++ b/arch/arm64/lib/strncmp.S
@@ -64,7 +64,7 @@ limit_wd .req x13
mask .req x14
endloop .req x15
-ENTRY(strncmp)
+WEAK(strncmp)
cbz limit, .Lret0
eor tmp1, src1, src2
mov zeroones, #REP8_01