From: Jan Beulich Date: Fri, 5 Mar 2021 14:29:52 +0000 (+0100) Subject: x86/string: correct memmove()'s forwarding to memcpy() X-Git-Tag: archive/raspbian/4.14.2+25-gb6a8c4f72d-2+rpi1^2~47^2~64 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=72fc75d707ed1ab4b12189aacfcc237f8578590d;p=xen.git x86/string: correct memmove()'s forwarding to memcpy() With memcpy() expanding to the compiler builtin, we may not hand it overlapping source and destination. We strictly mean to forward to our own implementation (a few lines up in the same source file). Fixes: 78825e1c60fa ("x86/string: Clean up x86/string.h") Signed-off-by: Jan Beulich Acked-by: Andrew Cooper master commit: 7b93d92a35dc7c0a6e5f1f79b3c887aa3e66ddc0 master date: 2021-02-04 13:59:56 +0100 --- diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c index e2f84638c4..bda24b14ac 100644 --- a/xen/arch/x86/string.c +++ b/xen/arch/x86/string.c @@ -43,7 +43,8 @@ void *(memmove)(void *dest, const void *src, size_t n) return dest; if ( dest < src ) - return memcpy(dest, src, n); + /* Depends on Xen's implementation operating forwards. */ + return (memcpy)(dest, src, n); asm volatile ( " std ; "