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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 06FF6C433E0 for ; Wed, 24 Jun 2020 07:58:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C79792088E for ; Wed, 24 Jun 2020 07:58:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U5XtGpJC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hwS5MOXO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C79792088E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=up3lZIdZjZahjr6x7YzUeujaS7VlEMhM9h0Swi9yXiE=; b=U5XtGpJCbE6N9NXhgyfoCq0HL b/2mQxePI+xWkRWUrCrK7gYuJMKLQbRZgc7SscrPvfUO/jvs7EaPCDkNIX+aE3XSHXo5LC0rucjXK 0zRUt+7KB3whPr9V1MXM/ieGoC6VCVddJ1VnYAYofQ/acQlOTBcCHRpZalUQ1gksoRYt2WS6x/bA3 hFxq0vNqUmWj2LOBip7jhrZSsmF5lOEdosajwSBYT8uPoUBv7OK+OB/qmnut1Yh1eJOciHdx2rWAg ZHr9T/b0ne8BpVICpgPhBTaXfI8gXwx5MrKK6gpQnDdQ9LtnTVCc/Z2QgDDVWc7KBV2HfJla5O/MM f6KbjiA8w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo0Hb-0007OD-7L; Wed, 24 Jun 2020 07:57:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo0HX-0007Mu-H5 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 07:57:20 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4AC72085B; Wed, 24 Jun 2020 07:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592985438; bh=l3Q0LyzeB2AgJKEMBDOo81ibmsUKTKJ9tglIeoVn5pI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hwS5MOXOPRnpdHOI74XHFaf2FIoxBL8vat/VMF/rsK7OudnwwsqyaUMDA1AwNDq5I 5MFpl+o0l6bMIGSTBS4TLc5oi5hGBQK8kQGQwgMIkCdavlfrFxZaZtDRJVxoOiu8zg tP7o7yRWzq2oR+WUQFOZXEJQrECP14c31Q5KiLQk= Date: Wed, 24 Jun 2020 08:57:12 +0100 From: Will Deacon To: Kees Cook Subject: Re: [PATCH v3 9/9] arm64/build: Warn on orphan section placement Message-ID: <20200624075712.GB5853@willie-the-truck> References: <20200624014940.1204448-1-keescook@chromium.org> <20200624014940.1204448-10-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624014940.1204448-10-keescook@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, Arnd Bergmann , Catalin Marinas , Masahiro Yamada , x86@kernel.org, Nick Desaulniers , Russell King , linux-kernel@vger.kernel.org, Nathan Chancellor , clang-built-linux@googlegroups.com, Arvind Sankar , Ingo Molnar , James Morse , Thomas Gleixner , Borislav Petkov , Peter Collingbourne , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 23, 2020 at 06:49:40PM -0700, Kees Cook wrote: > We don't want to depend on the linker's orphan section placement > heuristics as these can vary between linkers, and may change between > versions. All sections need to be explicitly named in the linker > script. > > Avoid .eh_frame* by making sure both -fno-asychronous-unwind-tables and > -fno-unwind-tables are present in both CFLAGS and AFLAGS. Remove one > last instance of .eh_frame by removing the needless Call Frame Information > annotations from arch/arm64/kernel/smccc-call.S. > > Add .plt, .data.rel.ro, .igot.*, and .iplt to discards as they are not > actually used. While .got.plt is also not used, it must be included > otherwise ld.bfd will fail to link with the error: > > aarch64-linux-gnu-ld: discarded output section: `.got.plt' > > However, as it'd be better to validate that it stays effectively empty, > add an assert. > > Explicitly include debug sections when they're present. > > Fix a case of needless quotes in __section(), which Clang doesn't like. > > Finally, enable orphan section warnings. > > Thanks to Ard Biesheuvel for many hints on correct ways to handle > mysterious sections. :) Sorry to be a pain, but this patch is doing 3 or 4 independent things at once. Please could you split it up a bit? e.g. - Removal of cfi directives from smccc macro - Removal of quotes around section name for clang - Avoid generating .eh_frame - Ensure all sections are accounted for in linker script and warn on orphans That way it's a bit easier to manage, we can revert/backport bits later if necessary and you get more patches in the kernel ;) You can also add my Ack on all the patches: Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel