Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1893777pxk; Tue, 1 Sep 2020 10:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZrjag9lkbWDpLDZI/gtPQRvdIiSb4p9BFGvp2R4fNeXMRgeUZ/405K6oIlMALxKuCdpYW X-Received: by 2002:a17:906:a43:: with SMTP id x3mr2378493ejf.321.1598980296718; Tue, 01 Sep 2020 10:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598980296; cv=none; d=google.com; s=arc-20160816; b=Fj12tY1NVKPmwGeQ7aUoSnfAFyQ4lx1ufcXMNPg4Bjp+x+e5ZqQo2umaO94TkE1Dfx /0iOsbLv9wmzfBFteZf6qknG80YG9/L/NXTkNyE0etocmwV5OoS9tpU9HESyEMEBtLgJ 1shoY8yKTk5ng/TgCOHBwGWnl17hUewo8bW+QMO2G2mTcMzLFkME6S9a5AuBkqXsey/r buQsVLiIACg6sFcHlVzGsgq+TvywBI4jzaJPS/jPmcDdn4hdXMj5/FzLcSjhNfY2mM1D vCpJC6yeIJN9Zjqz22N4pO6sF4eEs9ssVmW7PGxdCflGJHWo7w1j6SY7jgYApCRX3K6Z wxWA== 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=jN9lhIYk+vgw0Ck0cVCcWxfdMAHspCt08b10OTqq50Y=; b=zV9QICp7iXzEsI0nLaE99Qw0YqmTWhgplN7aln5IEPvUxeP0a5KsQWTmtUdH/346JE 02j4AnUIFOuw/6qRzqSOMVYmhsPpZ9L5aialcDSdHwNhoAsw/RMQnGflDFqy/EJguyPt 9b7TgaXhjUTeoCQQ3oLjlW45kLxitzGs0MzAf9fDEn270W/Tte170ipfbVtCW9hWmZ6o 1Y2jbh9lAHJA8PctFWk1xjP2mQ39oARXDV4fuYtPn5m0sAic3b91g1maYnq9bXBHgDbF r6LALaHQIqakCL7IyvbojB3gtLcHASBn2HNW9nGATWvQxvHBGexzJObfWK4iqy2fxcHf A9aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QNwyUWGq; 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 r9si931485edv.400.2020.09.01.10.11.13; Tue, 01 Sep 2020 10:11:36 -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=QNwyUWGq; 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 S1729439AbgIARIy (ORCPT + 99 others); Tue, 1 Sep 2020 13:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729442AbgIAPSA (ORCPT ); Tue, 1 Sep 2020 11:18:00 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D43C061245 for ; Tue, 1 Sep 2020 08:17:57 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id nv17so779921pjb.3 for ; Tue, 01 Sep 2020 08:17:57 -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=jN9lhIYk+vgw0Ck0cVCcWxfdMAHspCt08b10OTqq50Y=; b=QNwyUWGqs9owKFllSjci/t28I81jLcjvgiBtzPpNMRmB+M2e4JBvG3SftYAgE8DETw A5b6HYulpcZeseDvZnxy5DImevpZ81cF8dcEq9K+/+/1l71Pmted5STlCijieeHbus5d vU2UHyXJC6TyBYorxv12caOk04LJayZkpsHkE= 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=jN9lhIYk+vgw0Ck0cVCcWxfdMAHspCt08b10OTqq50Y=; b=n2/u/kX0d08hxbPa48/CPUpm/HoqypJOGRGfrOHOgJWq2V9wfkob0wSUWDLzCry97K 0Pu722sy2p6XHHl5JuDGRz5vj911cDxujlx37cSzWTDYwGMGz3C5qLlNxKmo7KtZpcYc isDVpObXL/DqBhMbY1Mzb5ZC9CFzlGAKMHwDlyVKujNUnvKveKUcDHpjP2uDf+YgdrzF K65Ub/S6ZArUnCsZk5HZKICWY9UjQEg81Z0h2LRhRDo0UN6qdSatq2RZ90Rpjk/28Kbs vwAUmKGx5Acd3O2VfwyiVrSoxd00lNK/KQxOC5qzsa9DWGvPQur8V58AI1XXQxjnazkN hKiw== X-Gm-Message-State: AOAM530CgUcJGYwpUnVq/jm3XyJ1Ic5ux1RzExoGSDJSKTLLQTZDOMI3 uLmgepCprZepHZ8E5aBOrDMrNg== X-Received: by 2002:a17:90a:8a0d:: with SMTP id w13mr2008556pjn.218.1598973476573; Tue, 01 Sep 2020 08:17:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a12sm2324629pfr.217.2020.09.01.08.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 08:17:55 -0700 (PDT) Date: Tue, 1 Sep 2020 08:17:53 -0700 From: Kees Cook To: Ingo Molnar Cc: Borislav Petkov , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 00/29] Warn on orphan section placement Message-ID: <202009010816.80F4692@keescook> References: <20200821194310.3089815-1-keescook@chromium.org> <202008311240.9F94A39@keescook> <20200901071133.GA3577996@gmail.com> <20200901075937.GA3602433@gmail.com> <20200901081647.GB3602433@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901081647.GB3602433@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2020 at 10:16:47AM +0200, Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > > > * Ingo Molnar wrote: > > > > > > > > * Kees Cook wrote: > > > > > > > On Fri, Aug 21, 2020 at 12:42:41PM -0700, Kees Cook wrote: > > > > > Hi Ingo, > > > > > > > > > > Based on my testing, this is ready to go. I've reviewed the feedback on > > > > > v5 and made a few small changes, noted below. > > > > > > > > If no one objects, I'll pop this into my tree for -next. I'd prefer it > > > > go via -tip though! :) > > > > > > > > Thanks! > > > > > > I'll pick it up today, it all looks very good now! > > > > One thing I found in testing is that it doesn't handler older LD > > versions well enough: > > > > ld: unrecognized option '--orphan-handling=warn' Oh! Uhm, yikes. Thanks for noticing this. > > Could we just detect the availability of this flag, and emit a warning > > if it doesn't exist but otherwise not abort the build? Yeah, I'll respin those patches. > > This is with: > > > > GNU ld version 2.25-17.fc23 (At best, this is from 2015 ... but yes, min binutils in 2.23.) > > I've resolved this for now by not applying the 5 patches that add the > actual orphan section warnings: > > arm64/build: Warn on orphan section placement > arm/build: Warn on orphan section placement > arm/boot: Warn on orphan section placement > x86/build: Warn on orphan section placement > x86/boot/compressed: Warn on orphan section placement > > The new asserts plus the actual fixes/enhancements are enough changes > to test for now in any case. :-) Yup! I'll respin the enabling patches. Thanks again! -- Kees Cook