From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751614AbdE3N5C (ORCPT ); Tue, 30 May 2017 09:57:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbdE3N5B (ORCPT ); Tue, 30 May 2017 09:57:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5565812B8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=bhe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5565812B8 Date: Tue, 30 May 2017 21:56:56 +0800 From: Baoquan He To: Arnd Bergmann Cc: Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Kees Cook , Thomas Garnier , Dave Jiang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/KASLR: use the right memcpy Message-ID: <20170530135656.GA4627@x1> References: <20170530091446.1000183-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170530091446.1000183-1-arnd@arndb.de> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 30 May 2017 13:57:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/17 at 11:14am, Arnd Bergmann wrote: > The decompressor has its own implementation of the string functions, > but has to include the right header to get those, while implicitly > including linux/string.h may result in a link error: > > arch/x86/boot/compressed/kaslr.o: In function `choose_random_location': > kaslr.c:(.text+0xf51): undefined reference to `_mmx_memcpy' > > This has appeared now as kaslr started using memcpy. Other files in the > decompressor already do the same thing. > > Fixes: d52e7d5a952c ("x86/KASLR: Parse all 'memmap=' boot option entries") > Signed-off-by: Arnd Bergmann Thanks for this fix, Arnd! The linking error didn't happen when I tested the patch of d52e7d5a952c. Could you tell in what condition it will be triggered? Not sure if I should wait for this fix being merged and do a back porting, or can defer it if it's not risky. Thanks Baoquan > --- > arch/x86/boot/compressed/kaslr.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c > index e0eba12bffe7..fe318b44f7b8 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -30,6 +30,7 @@ > > #include "misc.h" > #include "error.h" > +#include "../string.h" > > #include > #include > -- > 2.9.0 >