From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbcD1JCW (ORCPT ); Thu, 28 Apr 2016 05:02:22 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33635 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbcD1JCT (ORCPT ); Thu, 28 Apr 2016 05:02:19 -0400 Date: Thu, 28 Apr 2016 11:02:14 +0200 From: Ingo Molnar To: Kees Cook Cc: Yinghai Lu , Baoquan He , Borislav Petkov , Ingo Molnar , "x86@kernel.org" , Andrew Morton , Andrey Ryabinin , Dmitry Vyukov , "H.J. Lu" , Josh Poimboeuf , Andy Lutomirski , LKML Subject: Re: [PATCH v2] x86/boot: Rename overlapping memcpy() to memmove() Message-ID: <20160428090214.GA5773@gmail.com> References: <20160426214606.GA5758@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160426214606.GA5758@www.outflux.net> 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 * Kees Cook wrote: > Instead of having non-standard memcpy() behavior, explicitly call the new > function memmove(), make it available to the decompressors, and switch > the two overlap cases (screen scrolling and ELF parsing) to use memmove(). > Additionally documents the purpose of compressed/string.c. > > Suggested-by: Lasse Collin > Signed-off-by: Kees Cook > --- > Applies on top of tip:x86/boot > --- > arch/x86/boot/compressed/misc.c | 6 ++++-- > arch/x86/boot/compressed/string.c | 19 +++++++++++-------- > 2 files changed, 15 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c > index c57d785ff955..6dde6ccdf00e 100644 > --- a/arch/x86/boot/compressed/misc.c > +++ b/arch/x86/boot/compressed/misc.c > @@ -32,9 +32,11 @@ > #undef memcpy > #undef memset > #define memzero(s, n) memset((s), 0, (n)) > +#define memmove memmove Btw., what's the purpose of this define? If it's already defined then we should get a build warning. If it's not, we won't. Anyway, applied it, just curious. Thanks, Ingo