diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-06-02 14:10:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-06-02 14:10:01 -0400 |
commit | 7bd1d5edd0160b615ab8748cf94dabcab1fb01cb (patch) | |
tree | 377c23ab160b7f5770b9c3a1b232359b30fa004b /arch/x86/boot/compressed/string.c | |
parent | 6751b8d91af515a5dc5196fe305eee0a635e2ea2 (diff) | |
parent | 2ac44ab608705948564791ce1d15d43ba81a1e38 (diff) |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
"Two fixes: a quirk for KVM guests running on certain AMD CPUs, and a
KASAN related build fix"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor
x86/boot: Provide KASAN compatible aliases for string routines
Diffstat (limited to 'arch/x86/boot/compressed/string.c')
-rw-r--r-- | arch/x86/boot/compressed/string.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c index 19dbbcdd1a53..81fc1eaa3229 100644 --- a/arch/x86/boot/compressed/string.c +++ b/arch/x86/boot/compressed/string.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include "../string.c" | 11 | #include "../string.c" |
12 | 12 | ||
13 | #ifdef CONFIG_X86_32 | 13 | #ifdef CONFIG_X86_32 |
14 | static void *__memcpy(void *dest, const void *src, size_t n) | 14 | static void *____memcpy(void *dest, const void *src, size_t n) |
15 | { | 15 | { |
16 | int d0, d1, d2; | 16 | int d0, d1, d2; |
17 | asm volatile( | 17 | asm volatile( |
@@ -25,7 +25,7 @@ static void *__memcpy(void *dest, const void *src, size_t n) | |||
25 | return dest; | 25 | return dest; |
26 | } | 26 | } |
27 | #else | 27 | #else |
28 | static void *__memcpy(void *dest, const void *src, size_t n) | 28 | static void *____memcpy(void *dest, const void *src, size_t n) |
29 | { | 29 | { |
30 | long d0, d1, d2; | 30 | long d0, d1, d2; |
31 | asm volatile( | 31 | asm volatile( |
@@ -56,7 +56,7 @@ void *memmove(void *dest, const void *src, size_t n) | |||
56 | const unsigned char *s = src; | 56 | const unsigned char *s = src; |
57 | 57 | ||
58 | if (d <= s || d - s >= n) | 58 | if (d <= s || d - s >= n) |
59 | return __memcpy(dest, src, n); | 59 | return ____memcpy(dest, src, n); |
60 | 60 | ||
61 | while (n-- > 0) | 61 | while (n-- > 0) |
62 | d[n] = s[n]; | 62 | d[n] = s[n]; |
@@ -71,5 +71,11 @@ void *memcpy(void *dest, const void *src, size_t n) | |||
71 | warn("Avoiding potentially unsafe overlapping memcpy()!"); | 71 | warn("Avoiding potentially unsafe overlapping memcpy()!"); |
72 | return memmove(dest, src, n); | 72 | return memmove(dest, src, n); |
73 | } | 73 | } |
74 | return __memcpy(dest, src, n); | 74 | return ____memcpy(dest, src, n); |
75 | } | 75 | } |
76 | |||
77 | #ifdef CONFIG_KASAN | ||
78 | extern void *__memset(void *s, int c, size_t n) __alias(memset); | ||
79 | extern void *__memmove(void *dest, const void *src, size_t n) __alias(memmove); | ||
80 | extern void *__memcpy(void *dest, const void *src, size_t n) __alias(memcpy); | ||
81 | #endif | ||