Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3332631pxa; Tue, 18 Aug 2020 12:26:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrh16FkyhM2pG/tj99QZvpej2vqU+riy7upef58dvbR1YyPXWOv2X8y4bhhYT5IQVZxJQS X-Received: by 2002:a17:906:3816:: with SMTP id v22mr21251677ejc.105.1597778768748; Tue, 18 Aug 2020 12:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597778768; cv=none; d=google.com; s=arc-20160816; b=i/vJ+Pea6HYyYtN3Ek+Du15F2UqwqkkWLbNwtMM5nMlrLJqio4Ys74TEMxkR6J5HLR Ngffij2QpK3sBXG/Pl1hqKeUwO5jXLj2m3fikARfZDvd6bCtj6OgC1Y5f0dQGLkkzNpz AGh8MXQhQRgXk/4HWQLJ9BapaSOosgBVAF6Nz/WeN44PuO5WROpm3nPgXmBaJyurhNiY 34kHtyaRMlvXiUFzEQ/m11pEkauK8cfDTpjiabdaA0WTMckUOeXV5XylK5rbLVwKtHGm TRYQBxb/pInom7WB/Hf4WDx2G3QL3pT9Cc0vkyE05L0VRF45Bie5rW+fYibfEAS+r6fG WkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6hayTTGEbr1/YdVLWNP0d/mHo2iUAS7x2PZOqNynkQk=; b=p+o7r4HVbXJ33TSk17cxWlA+rvy3LwsObLD5g7/lNIphzdxh4jY85rPDjIsGL9Kumo Pyx9qSRWhwGdzHjVuMaEApQO0/i/Sk7jt0K5/QGXTXgHazFkJmgVhe9uI9w/UMWc44vf JcxJpYB98D3j2WApTMd0PX4A5kkf5FfsLnJqTT98SWpXf2FhGC9s8/C3S0LXDMUK7cbU 8Esv6vlbFVqxbhe+Tff0pjF9c3oKr+8NAWAoB2vfZcGPrQK/Tsw7Areg5plf8mbITCJb Z1w4UCTO7gEznUDwj/Ok7G3/fC6xaiTUbp0DlK0+3F2S5wjd1oTvTWjgbtP54B/vtHQp a3Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NaEJCuH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay17si15316334ejb.345.2020.08.18.12.25.44; Tue, 18 Aug 2020 12:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NaEJCuH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbgHRTYs (ORCPT + 99 others); Tue, 18 Aug 2020 15:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgHRTYn (ORCPT ); Tue, 18 Aug 2020 15:24:43 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA67C061342 for ; Tue, 18 Aug 2020 12:24:43 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 128so10205981pgd.5 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=UTpDTw3RjM5CdJnZVXkg+D+VfG+fnOxeMOm9vePowVAnXeKrPHIOiRYLypa/yFFkTb k6AzlCgWkksGg/tIAnL/5r9t7SWKxlKMYFDujXwe6h2EDqoh/nDw/JS14UJ7xQ8G1ZeB 9XsR1JR7cd81l9SN2uNYvmXq9Xbfg3jH11Ykc+Sx1AvqP3PZ7nsurfldgnV1Ck+JKVYA MVEIYU/FtnWbdd91HX4OYWyOSPlhg7+sD0Vrpn4LnRz3OgpnzE5Nkl4KONBWCozlu7fq ynwtGJKrkaTlwjX42e2JkP2RVOkzk8gjpDXE5/0Gk3UQ/f7JGSnsRr4T8uln7KRHqGEc Jywg== X-Gm-Message-State: AOAM530xnMAAbgBDCOZfmyWnKDvDX2fpgllTP0KZbzoWn4xXMHIZBSh6 nOyk+aPQxSh/DLDDbahlOdJFmQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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