Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1673504pxb; Fri, 20 Nov 2020 16:10:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIsQe6wHFnEOGIEAEkmrCYtwvAGAWVB9A1SZ1mAQtxCrHI56fu1ZVTTSnfDkBWWNYCI1Rt X-Received: by 2002:a17:906:e254:: with SMTP id gq20mr35566102ejb.520.1605917433082; Fri, 20 Nov 2020 16:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605917433; cv=none; d=google.com; s=arc-20160816; b=flvkwpIk46ecXVq5OCWCpB+rSjZnMJ0xO1ikomnwF3iTQULcRAN80URk5K9p3HBTno cFy/EQH2oOUXZijv2jb2n5sy5bI1ktfwrS7alszVolpIYz3Yj6zOZHeFw7KYkVhxbb2V pyXpntuf7n2PorXoPqi0ipZhCRxszalSJ0uFJXyiENVJcMJiO8z4IqDfWsKzcfjGlHwg D6Ux6/Ul45NrimWxLyLCJi/RDnbjJ9jxBRZXUQkIBboqKBpvvoyRvbWS3kaRB7Z3+35m +gvR4FiqwyzCnD9tWzzS0hAc6uMH/8YzfbOYgEJPUerVp9+ccirMXzDThgzlvYFrRvH8 KLug== 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=ZrI6T0ydbBGHVkvNAITM1/rIzBX4TKDzD+4JBPsjVAU=; b=xNLq4cTQcZ47FNnYpTYqBtBtAuZbOloxn/LkIncJhrQo2UY0ExLdpcJ4lb1HwryVAB T1aaFqkh3URq0/bBUtCQ64m/LOnbhkEPfaScJFjioMy4X3OnDLSjv36V3M/fhdbuvUO7 zGrXktC4mZ1m0ao/6a6cjchObEVEMGnUfvWvXOMp3jC6mkOOpxzF+R31BZn9lET+vEDL +j7T1H6ULttDRsOh9ROu4KmHpivcvK9fF6a+Dpk6QV/4xoy1lCOChF+WYGtJq7LngBlK s/CGs8zKuwaGejDnjOUdZLQxdCWBrK3tj+OUyGHLs281Brhx8I1swpHQmZ6keOOLnIYt C7yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jdjYaxbU; 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 hd40si2664907ejc.265.2020.11.20.16.10.10; Fri, 20 Nov 2020 16:10:33 -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=jdjYaxbU; 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 S1727417AbgKUAIr (ORCPT + 99 others); Fri, 20 Nov 2020 19:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgKUAIr (ORCPT ); Fri, 20 Nov 2020 19:08:47 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17ADC061A04 for ; Fri, 20 Nov 2020 16:08:45 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id a18so9442122pfl.3 for ; Fri, 20 Nov 2020 16:08:45 -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=ZrI6T0ydbBGHVkvNAITM1/rIzBX4TKDzD+4JBPsjVAU=; b=jdjYaxbUzlqk4snx5STJs9c411mkqGRvaAvaha/amTKXJU9fZPQWsoZ8Ed3KIQw4ja mBRbalwnztTkPDbdJI5G2sIfrSCr7If5HYlFrLCJbofKQbI0ZoWG8UUmNU8xPtQqLFiR RQcHeEoMBRUOZMePca3LRVAiz6fVXCeRkfjAQ= 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=ZrI6T0ydbBGHVkvNAITM1/rIzBX4TKDzD+4JBPsjVAU=; b=ZuUOIrSUwCLgLdQAyOJkU1lUywFu157xYZTX8WEbe4qTgr3CNSf71V77/f88ubojKv DznY6/zXhTP64hTlpEnFL2YAL+NiYLmH6KLr1Xi/AfiWBvuxE+aX6DEEKVO2Uh2hsFl5 y7gKm4LDz/yE5U/Z8FrbG+8h8r60cB52LTGvLb6SQtdd5iGJTk2scBJcUGzmmo88AaT8 jkjirPQOg+tJdbR2X9sbXvCrTxuQ5vs+4EWMhE5pFWcMVc1JeuMWZviO05xNU7ng9ieG 6TSngDsyTr3bOxhfVt1dMhs0ff6bxfkuBphdeZgPLwpZ9TCzvLNCFMLIkwxNWBCXi9p7 wuJw== X-Gm-Message-State: AOAM530eND3J9O3QG7VTAANuleq40pzi7cG+KmTUlvlD53cTDzX48H5K 4lX4rtYJIYgdoNT47jCT36HhCA== X-Received: by 2002:a62:cd0d:0:b029:18b:a1cc:a5be with SMTP id o13-20020a62cd0d0000b029018ba1cca5bemr16150890pfg.67.1605917325096; Fri, 20 Nov 2020 16:08:45 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id fu5sm5201126pjb.11.2020.11.20.16.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 16:08:44 -0800 (PST) Date: Fri, 20 Nov 2020 16:08:43 -0800 From: Kees Cook To: Masahiro Yamada Cc: Nathan Chancellor , 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 v2 1/2] kbuild: Hoist '--orphan-handling' into Kconfig Message-ID: <202011201607.75FA476@keescook> References: <20201113195553.1487659-1-natechancellor@gmail.com> <20201119204656.3261686-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201119204656.3261686-1-natechancellor@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 01:46:56PM -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 > Acked-by: Kees Cook > Acked-by: Michael Ellerman (powerpc) > Reviewed-by: Nick Desaulniers > Tested-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor Masahiro, do you want to take these to get them to Linus for v5.10? I can send them if you'd prefer. -Kees -- Kees Cook