Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5608803imu; Mon, 26 Nov 2018 02:57:40 -0800 (PST) X-Google-Smtp-Source: AJdET5eUOErzZCifalA7WXMF89wez84hSoLCPeB+d5vvRkJ3sdxY6ml/vAt/PJK7gBMbpyopScJ7 X-Received: by 2002:a62:4e49:: with SMTP id c70mr26970301pfb.167.1543229860740; Mon, 26 Nov 2018 02:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543229860; cv=none; d=google.com; s=arc-20160816; b=zeDcsaSkNO3YEPfAAWI7Zp8N7oxiZQOL4jeYynd1ThEOZSMBJ0YVI4ak5+gB+8xc39 hacUrJJjTbjQ3rt7l43HarbOxpcG9PPaKxzn1sSyTkg3zFj9TLhd2hXGUq99dsn4BFse zhN/8k6PtdBeDLPq9Kao367rhsfsL3nW7FYXZRPeUGx7NuD2/BlobzXiHqAmpX3jLqCl 8tiW4qV87nNMcC7wxaqCZZjUcn4lo9EqU8ioEUijksy68xdrJfVxEEkbzpYfgJ4NFnGL WH54iR/EMWm9vIaBgnfHB6FzVCQGEo3r26ltNgKP37IWSrlkQO4OsOUxZ3hgYNyBPd7r x2Dw== 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=40CLWUTmaKM6Zxw6ihgqOP6/awuo38hjntVLDSLLqQo=; b=igQW4VuEctYVTxwv7FIZyYvWVq/s84bn/FY/mCTTQq0FE3m1Jzl0yj0rQU2NJEqfa2 c3CyEbujXBlIetH0zptg2T7lb2P+zDRGnZ990B39aoumfE+7YJmBLsy8xFr//s+WMOu7 hqS1ShWWDcbUcqfRO2dDRbRmC9Mo/Jy7iqPjPvRr3gOE6/6boChqurfS1hZfbIJKY77X SB0VQkctObfA+e3G3qCMEVXc5ae+S2TLWP/8Ss+326KFlUg2ed6plyoZmPJrAH2yMs+i d5paVtglEZx0k3lyExy8ArIHROixfYeeMrARzIABXB4Qh9kkMt2LT3Ikt7DQx7GeCKS6 0qwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IgCRal6B; 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 q5si28888020pgg.204.2018.11.26.02.57.26; Mon, 26 Nov 2018 02:57:40 -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=IgCRal6B; 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 S1727674AbeKZVsj (ORCPT + 99 others); Mon, 26 Nov 2018 16:48:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:57252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727661AbeKZVsi (ORCPT ); Mon, 26 Nov 2018 16:48:38 -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 A5F9820817; Mon, 26 Nov 2018 10:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229694; bh=TQe/gUsa1wS3vGYhqPCqcKA0JrpgvSD7X0+iqh/J1V4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IgCRal6BNR8u5DnfuvgbLJfb9vFiak9LqAofOZZ0OFUtSjI0+UW60TekZ44yb+bk7 x4U77m3aE0qpzp0Y0iUOY1EisyktBAEOIal6/evJb14hIgGOKZC4UZgBBHr7uJ0shY o4+aP7j45N0E/LiJN/qxQ7Gee1ztQQ0CdsyDytO4= 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 , Nathan Chancellor Subject: [PATCH 4.4 35/70] x86/boot: #undef memcpy() et al in string.c Date: Mon, 26 Nov 2018 11:50:50 +0100 Message-Id: <20181126105050.147832290@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@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.4-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: Nathan Chancellor 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) { u8 diff;