From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F4F1C433DF for ; Tue, 18 Aug 2020 19:24:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50FB420786 for ; Tue, 18 Aug 2020 19:24:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NaEJCuH9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgHRTYs (ORCPT ); Tue, 18 Aug 2020 15:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbgHRTYn (ORCPT ); Tue, 18 Aug 2020 15:24:43 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA0EC061389 for ; Tue, 18 Aug 2020 12:24:43 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id f193so10439635pfa.12 for ; Tue, 18 Aug 2020 12:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6hayTTGEbr1/YdVLWNP0d/mHo2iUAS7x2PZOqNynkQk=; b=NaEJCuH9gbmOM5fin2j7WXtbMmkBDrhuG7HtZ/z20dwk7dxw3hxcsGAbq0Zs7NDcLn r4oH+YkgiaBZs3qHpQNy8seqFrsOBGaiNMQgBTxu2M1WnB+Eh6gbb4VEHpQx7y0RS4so VDF2GTC3rXza7Mh/mAMNu0CDReeyjyK4GPT0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6hayTTGEbr1/YdVLWNP0d/mHo2iUAS7x2PZOqNynkQk=; b=lMWc+htZFug06nRipH+qAvA6dUpcwtRiYLNpk22i6fj0u9RmFASYF+YVqfyFQiA8JX Qlbw08/6Ed8oEMlqb18DIRUEClI/UcFN1t/hJpvq1f8hLvDCbuBoNZGZBBvhQXj8LNnx HCsnac5yvavRO7Ok+jumsxZo4LwGk41HDg/x32/V0uFPKHX+wcYY7B6sHruzZVCzibO4 DC0z2/1nXF6aZRyn4x9P1QWYkUY5vw2vAyKzEu5BRM/zNo9xVaHe2yG/0QPUZV6ArZXb hFcoErTWqMjfI/k5d7xmISIeUMbtFkhcHPSJ0zAR55gByqX/fVCbcPdHMYw/G6iW1hrG HnYg== X-Gm-Message-State: AOAM532IdaNWyZcdgTLvIDVDm0N05JFHp7tZiwrRO3JakGzmFk2OWuvB AFbiVeWAyFv3dmCBuo2p6134Cg== X-Google-Smtp-Source: ABdhPJxROH1AJL8y95bXyAdrCrDPPEfnq6nYi8o0CBmaUfSkJDB2y+UuzO66imuSYjuDnkJBfKQ4xg== X-Received: by 2002:a63:4955:: with SMTP id y21mr13917271pgk.180.1597778682761; Tue, 18 Aug 2020 12:24:42 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c10sm25101551pfc.62.2020.08.18.12.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:24:41 -0700 (PDT) Date: Tue, 18 Aug 2020 12:24:40 -0700 From: Kees Cook To: Nick Desaulniers Cc: Masahiro Yamada , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Luck , Dmitry Vyukov , Michael Ellerman , Joe Perches , Joel Fernandes , Daniel Axtens , Arvind Sankar , Andy Shevchenko , Alexandru Ardelean , Yury Norov , x86@kernel.org, "H . Peter Anvin" , Ard Biesheuvel , "Paul E . McKenney" , Daniel Kiper , Bruce Ashfield , Marco Elver , Vamshi K Sthambamkadi , Andi Kleen , Linus Torvalds , =?iso-8859-1?Q?D=E1vid_Bolvansk=FD?= , Eli Friedman Subject: Re: [PATCH 3/4] x86/boot: use -fno-builtin-bcmp Message-ID: <202008181224.4C682B38@keescook> References: <20200817220212.338670-1-ndesaulniers@google.com> <20200817220212.338670-4-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817220212.338670-4-ndesaulniers@google.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On Mon, Aug 17, 2020 at 03:02:11PM -0700, Nick Desaulniers wrote: > We're reverting > commit 5f074f3e192f ("lib/string.c: implement a basic bcmp") > in favor of -fno-builtin-bcmp. Remove the additional definition here, > too. > > arch/x86/purgatory/Makefile uses -ffreestanding, so there's no risk of > this libcall optimization occurring for arch/x86/boot/purgatory.ro. > > arch/x86/boot/Makefile resets KBUILD_CFLAGS, so make sure to reset this > flag that was set for the top level Makefile. > > Fixes: 4ce97317f41d ("x86/purgatory: Do not use __builtin_memcpy and __builtin_memset") > Signed-off-by: Nick Desaulniers Reviewed-by: Kees Cook -- Kees Cook