* [PATCH] x86: fix fortified memcpy
@ 2017-06-27 15:00 Arnd Bergmann
0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2017-06-27 15:00 UTC (permalink / raw)
To: Andrew Morton
Cc: Daniel Micay, Kees Cook, Arnd Bergmann, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, x86, linux-kernel
__memcpy3d is not available when CONFIG_FORTIFY_SOURCE is enabled,
leading to a link error on 32-bit kernels:
arch/x86/lib/memcpy_32.c: In function 'memcpy':
arch/x86/lib/memcpy_32.c:10:9: error: implicit declaration of function '__memcpy3d'; did you mean '__memcpy'? [-Werror=implicit-function-declaration]
This uses the same #ifdef around the use of the function that
now protects the definition.
Fixes: mmotm ("include/linux/string.h: add the option of fortified string.h functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/lib/memcpy_32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/lib/memcpy_32.c b/arch/x86/lib/memcpy_32.c
index cad12634d6bd..2eab7d0bfedd 100644
--- a/arch/x86/lib/memcpy_32.c
+++ b/arch/x86/lib/memcpy_32.c
@@ -6,7 +6,7 @@
__visible void *memcpy(void *to, const void *from, size_t n)
{
-#ifdef CONFIG_X86_USE_3DNOW
+#if defined(CONFIG_X86_USE_3DNOW) && !defined(CONFIG_FORTIFY_SOURCE)
return __memcpy3d(to, from, n);
#else
return __memcpy(to, from, n);
--
2.9.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-27 15:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 15:00 [PATCH] x86: fix fortified memcpy Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®