Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4190118pxb; Tue, 17 Nov 2020 13:54:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqY14ous5beQtnpGxUIKpwJOUIjRLsD9MBSgqZSVkKEeTmM3t+fwyob/jG4w0hZoEN+Cjt X-Received: by 2002:a17:906:7aca:: with SMTP id k10mr20626832ejo.215.1605650075932; Tue, 17 Nov 2020 13:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605650075; cv=none; d=google.com; s=arc-20160816; b=CaJJIW9S/DrlMfKs33Vz/mDcBQsOltoqHR7dROcwrmKsDjyWyjpoTxm2TSO2NIDGkP 7jzVL0d7d8fQ4T4HS7MXFYNTcEAQ2cyLnrGql++VcXu+qivq2yiw0zOqjP3Rr9IYQMhk xSrQCoirzf2XZgvDHG/wV4d+r6hCeR4nyxHWYzAnj4aIcO2QZZOlacGc2Zg9OLvY1f/C CXF1YbcZiCdzTf6U5hhS+oOjfUIo7AXsaOEgOoUfFa/SBTJsRPZB0e653gore7/W9bpn 8xEfBagZsvgN3Rk+OW+7bMOUKZWO/CmKrBcA2DOAvB/eR6exlYimJEejZE12shFdOrhV 7bKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4XjG60ocQx4PkwGgrAEoZIyPUhnxDgPZrMBdqiIZG+4=; b=me5pafR4ArI+qq0Z4jW+4hMX/vdfcNQRvkIII7W5o4bM502RPX9wZp15sc4Y1OKP3Z 6DxOxm+r+VAz/9kw3KgJ7xyYuteatiBKof/YWRzFw5Ukj/M36LpsjYY91Dd/dW9T37fJ 5JZ1quGYk7LZY/1HF6s+4I0hv1pHg/3AjNatsRW45NqjfeQ7BT3is2MOjksFVcrn4BPK KnPKGBdxYkzdOFSkSm9/IPjm3ADjqutwpTt7OEixytwi3Ps3Q9xKokXPadtC/whN1mgd /W9vqwgGUH2JSY9H1wNPZuuZ35xmPknGgw4Ohvc9kmx6+Ep8PTACJrsg+j5pmoCj7wuQ zv2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FumCDSza; 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 k7si15183931edr.388.2020.11.17.13.54.13; Tue, 17 Nov 2020 13:54:35 -0800 (PST) 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=FumCDSza; 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 S1728195AbgKQVw0 (ORCPT + 99 others); Tue, 17 Nov 2020 16:52:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726297AbgKQVw0 (ORCPT ); Tue, 17 Nov 2020 16:52:26 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28030C0617A6 for ; Tue, 17 Nov 2020 13:52:26 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id i13so16923424pgm.9 for ; Tue, 17 Nov 2020 13:52:26 -0800 (PST) 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=4XjG60ocQx4PkwGgrAEoZIyPUhnxDgPZrMBdqiIZG+4=; b=FumCDSzaVj4k7q4V2p0oNKAIKu0GYbAFc2SyCI1aqTxJUFpFoUH6T8PWWxOryTG19/ Q1zlGV6Di3ZGEwaZIfQcQ4NcdAXg07SmAHCYzmm4aemVr6P+UEqs5yTGo761PszGobNa LiUwMgr6+SbWyc3qbTPN/Ai3ee1ReodEOFMas= 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=4XjG60ocQx4PkwGgrAEoZIyPUhnxDgPZrMBdqiIZG+4=; b=oSLwStnjXfSxgPDDFMV/AhDTKfKqo/+kTQkQPWC0osrZ5xK/SJ9R2IAJGhg89JVkWi 2b2u8yXUF4n+JS+vnXEUTy3LWCohcPruLqIqnT4W8j0Nn8koIIxVr4YSk7ewN+YUocnn S3DfJy41xRFxZ7DDQdKoGquIor9cMP4c41d3pC50VTF6IDTbyIicfCLfQTjHHbo+igoH e0IBcCFcyjNRnGA34h69n+vWYk2hkX6O6DB7purvOujMMs6Td6Ok2CVn9bxCQ+GHT5Cs rP8PbFr6in3NjmS8gCK4HH+PxSwNcvWn4Uf5+woLAHr/6rmxSKLxea79fGQOSSmbKDoC oTSw== X-Gm-Message-State: AOAM5305xqoouuypz3O6r+sQvMBdWgiheKye8G1scnObb/dinQJHM+Y7 kx1rnMCJ7GB5HY+/tZWHLO1AzQ== X-Received: by 2002:a63:1445:: with SMTP id 5mr5119858pgu.357.1605649945756; Tue, 17 Nov 2020 13:52:25 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b29sm1039089pgn.87.2020.11.17.13.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 13:52:24 -0800 (PST) Date: Tue, 17 Nov 2020 13:52:23 -0800 From: Kees Cook To: Nathan Chancellor Cc: Masahiro Yamada , Michal Marek , Russell King , Catalin Marinas , Will Deacon , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Nick Desaulniers , Arvind Sankar , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 1/2] kbuild: Hoist '--orphan-handling' into Kconfig Message-ID: <202011171351.728E1194EF@keescook> References: <20201113195553.1487659-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201113195553.1487659-1-natechancellor@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2020 at 12:55:52PM -0700, Nathan Chancellor wrote: > Currently, '--orphan-handling=warn' is spread out across four different > architectures in their respective Makefiles, which makes it a little > unruly to deal with in case it needs to be disabled for a specific > linker version (in this case, ld.lld 10.0.1). > > To make it easier to control this, hoist this warning into Kconfig and > the main Makefile so that disabling it is simpler, as the warning will > only be enabled in a couple places (main Makefile and a couple of > compressed boot folders that blow away LDFLAGS_vmlinx) and making it > conditional is easier due to Kconfig syntax. One small additional > benefit of this is saving a call to ld-option on incremental builds > because we will have already evaluated it for CONFIG_LD_ORPHAN_WARN. > > To keep the list of supported architectures the same, introduce > CONFIG_ARCH_WANT_LD_ORPHAN_WARN, which an architecture can select to > gain this automatically after all of the sections are specified and size > asserted. A special thanks to Kees Cook for the help text on this > config. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1187 > Signed-off-by: Nathan Chancellor Looks good to me. With the other suggestions from the thread added, please consider it: Acked-by: Kees Cook -- Kees Cook