Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp191424imu; Wed, 21 Nov 2018 17:58:00 -0800 (PST) X-Google-Smtp-Source: AJdET5eAp9c8qF+UUzLRirozmzLFGgfT60Y+1QwXr6rNGqVfCW9ZmZE6rwA1QAJXhteTctOWAAUy X-Received: by 2002:a63:2f07:: with SMTP id v7mr7691381pgv.368.1542851880708; Wed, 21 Nov 2018 17:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542851880; cv=none; d=google.com; s=arc-20160816; b=qeMYKRI8IjZGwe3Gcqv0uUDzZUR1i0kqid2LFzRM+eh7GO+X/6De1iaiZEE713W/fS Yk+5wD1zC9g6SWYDXKNgmq3mz43HSsS2JCTZ1S1qIfir0T0cwwq4Kl+b77ofYyR9LAOF 0w3gtd59jeAnE2po/6rmGhTnumFHVtZiNLMqwyxLlVN/MesFtu54Id2r6OM9LYkTai02 D2ruNYGQd5gTMO69/KLFnS8DPs/7mkWz8bWBKIhMjY3ShUAXtf+dQ/pPvWehqa77UlIl 7pkpQ4J77oXCFqKQxQq3GIJcQZsR4OQXqH+kibJJVmLiIWFKD/67B5LuUmLCOI1QlA8H OWyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4xu6szZk4D7KzZUj0nYfhiVhDLg4q5JdQ7EzFFrRCPs=; b=vyK0DAQLbMMWBJ+wAOvede+ZwcdOsqZBRR0ZNrttDGRClnRwYEHN2ROrpQctPIjMV5 HBJ2SQR5jR5gjIYbvKfhYXnAxCREOPAyvD3943TdtkxOh53zeorwChnztVNuKILqffV+ 81Gtal2mJMoN/2QT+80SbSB12Ci0BIBshwrWv0wxOlfn6WnQwSRqqzK6uou5Lx9sSmpC yqqXEpPNNnfnxiFlDnVyPBtr+tm+jrxJAVgtZAtEDLmrZ44DDtqhSS7WsG8Y1XPWZsVP e/Ugkheq7ZKVt9jSNPm1D81F5KXlqsIuSy7ObH0vx6DVV1GkSoihHBdCF9YSwQf9JaUv AZJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=spSqPFU+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e68-v6si33778750pfb.215.2018.11.21.17.57.45; Wed, 21 Nov 2018 17:58:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=spSqPFU+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731351AbeKVFuX (ORCPT + 99 others); Thu, 22 Nov 2018 00:50:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:41168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732351AbeKVFqD (ORCPT ); Thu, 22 Nov 2018 00:46:03 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 452FC214D9; Wed, 21 Nov 2018 19:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542827430; bh=nPDLVY1T9PKl7LayrFyTe3iJypB2hvPysZmhLJu4kkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=spSqPFU+0s0Hz6PrLGke/8EFxxRZ7Dk9WmEW7uWW6SDk/ShrfRVHwTatuLjWct2WC Gww5XNIgtAeF75s7ICieEROC0hBnhg4s2rjg+nWT1/3gns1Syj4CC6uvsPBOPdNh0o PZx12isAEvSAtMuuy6bK3XJ/ZvTiOQOLxnKK5vdI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Davidson , Matthias Kaehlcke , "H. Peter Anvin" , Arnd Bergmann , Bernhard.Rosenkranzer@linaro.org, Greg Hackmann , Kees Cook , Linus Torvalds , Nick Desaulniers , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.9 27/59] x86/boot: #undef memcpy() et al in string.c Date: Wed, 21 Nov 2018 20:06:42 +0100 Message-Id: <20181121183509.323347749@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181121183508.262873520@linuxfoundation.org> References: <20181121183508.262873520@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Davidson commit 18d5e6c34a8eda438d5ad8b3b15f42dab01bf05d upstream. undef memcpy() and friends in boot/string.c so that the functions defined here will have the correct names, otherwise we end up up trying to redefine __builtin_memcpy() etc. Surprisingly, GCC allows this (and, helpfully, discards the __builtin_ prefix from the function name when compiling it), but clang does not. Adding these #undef's appears to preserve what I assume was the original intent of the code. Signed-off-by: Michael Davidson Signed-off-by: Matthias Kaehlcke Acked-by: H. Peter Anvin Cc: Arnd Bergmann Cc: Bernhard.Rosenkranzer@linaro.org Cc: Greg Hackmann Cc: Kees Cook Cc: Linus Torvalds Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20170724235155.79255-1-mka@chromium.org Signed-off-by: Ingo Molnar Signed-off-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman --- arch/x86/boot/string.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -16,6 +16,15 @@ #include "ctype.h" #include "string.h" +/* + * Undef these macros so that the functions that we provide + * here will have the correct names regardless of how string.h + * may have chosen to #define them. + */ +#undef memcpy +#undef memset +#undef memcmp + int memcmp(const void *s1, const void *s2, size_t len) { bool diff;