Skip to content

Commit 4ec4190

Browse files
melverakpm00
authored andcommitted
kasan, x86: don't rename memintrinsics in uninstrumented files
Now that memcpy/memset/memmove are no longer overridden by KASAN, we can just use the normal symbol names in uninstrumented files. Drop the preprocessor redefinitions. Link: https://lkml.kernel.org/r/[email protected] Fixes: 69d4c0d ("entry, kasan, x86: Disallow overriding mem*() functions") Signed-off-by: Marco Elver <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Borislav Petkov (AMD) <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jakub Jelinek <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linux Kernel Functional Testing <[email protected]> Cc: Naresh Kamboju <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vincenzo Frascino <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 85f195b commit 4ec4190

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

arch/x86/include/asm/string_64.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,6 @@ char *strcpy(char *dest, const char *src);
8585
char *strcat(char *dest, const char *src);
8686
int strcmp(const char *cs, const char *ct);
8787

88-
#if (defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__))
89-
/*
90-
* For files that not instrumented (e.g. mm/slub.c) we
91-
* should use not instrumented version of mem* functions.
92-
*/
93-
94-
#undef memcpy
95-
#define memcpy(dst, src, len) __memcpy(dst, src, len)
96-
#undef memmove
97-
#define memmove(dst, src, len) __memmove(dst, src, len)
98-
#undef memset
99-
#define memset(s, c, n) __memset(s, c, n)
100-
101-
#ifndef __NO_FORTIFY
102-
#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
103-
#endif
104-
105-
#endif
106-
10788
#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
10889
#define __HAVE_ARCH_MEMCPY_FLUSHCACHE 1
10990
void __memcpy_flushcache(void *dst, const void *src, size_t cnt);

0 commit comments

Comments
 (0)