From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932251AbbJSQxk (ORCPT ); Mon, 19 Oct 2015 12:53:40 -0400 Received: from mail.skyhub.de ([78.46.96.112]:33819 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbbJSQxO (ORCPT ); Mon, 19 Oct 2015 12:53:14 -0400 Date: Mon, 19 Oct 2015 18:53:06 +0200 From: Borislav Petkov To: Andrey Ryabinin Cc: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org, Andy Lutomirski , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86, kasan: Fix build failure on KASAN=y && KMEMCHECK=y kernels Message-ID: <20151019165306.GB19953@pd.tnic> References: <20151014214758.GG8218@pd.tnic> <1444994933-28328-1-git-send-email-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1444994933-28328-1-git-send-email-aryabinin@virtuozzo.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 16, 2015 at 02:28:53PM +0300, Andrey Ryabinin wrote: > Declaration of memcpy is hidden under #ifndef CONFIG_KMEMCHECK. > In asm/efi.h we under #ifdef CONFIG_KASAN we #undef memcpy > thus following happens: > > In file included from arch/x86/kernel/setup.c:96:0: > ./arch/x86/include/asm/desc.h: In function ‘native_write_idt_entry’: > ./arch/x86/include/asm/desc.h:122:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration] > memcpy(&idt[entry], gate, sizeof(*gate)); > ^ > cc1: some warnings being treated as errors > make[2]: *** [arch/x86/kernel/setup.o] Error 1 > > We will get rid of that #undef in asm/efi.h eventually. > But in the meanwhile move memcpy() declaration out ifdefs > to fix build. > Looks ok to me. I guess this should go together with the efi.h fix. > Reported-by: Borislav Petkov ...-and-tested-by: me > Signed-off-by: Andrey Ryabinin > --- > arch/x86/include/asm/string_64.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h > index e466119..ff8b9a1 100644 > --- a/arch/x86/include/asm/string_64.h > +++ b/arch/x86/include/asm/string_64.h > @@ -27,12 +27,11 @@ static __always_inline void *__inline_memcpy(void *to, const void *from, size_t > function. */ > > #define __HAVE_ARCH_MEMCPY 1 > +extern void *memcpy(void *to, const void *from, size_t len); > extern void *__memcpy(void *to, const void *from, size_t len); > > #ifndef CONFIG_KMEMCHECK > -#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 > -extern void *memcpy(void *to, const void *from, size_t len); > -#else > +#if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4 > #define memcpy(dst, src, len) \ > ({ \ > size_t __len = (len); \ > -- > 2.4.9 Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.