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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 25D06C433E0 for ; Wed, 24 Jun 2020 15:38:07 +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 E911E206FA for ; Wed, 24 Jun 2020 15:38:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CnnqVoSN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="L87UOx1r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E911E206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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=EmX+ZzG3maf1NbchkdUyYWGVm/iDBty0AlueDDZL6KI=; b=CnnqVoSNCEo0F/G2/qQSkl2YD wTn7dhILc83//+/vTGJuKVp6kDDKwk/7oPty4OKZ72eyBpAYuWza6spNI/vrnh9IOKLaGKBAcfZJL m9fMU3+rCvZV2Y/3+nkoUi2NDv3HvhA+8m0VkVXc9jx6i6YSjL6WqJ3YcRRr50K0BOrOkcxXKk83X KYYaKjzXOU0r+Y9Z1mBXEbGgp28hGH0h1NogyZEugIFhpW/F6ZFavfXSJufvuuwmtQb8XyXcJ+xXR 4ZXV87NSXx+t3tYhq+aY7HRqFT+uR80yBdRd4ITYi6ICCq824byksSXQe0fw/6Ena6+g7bkmuys2d DyL8NYlKg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7Rv-0003cj-6h; Wed, 24 Jun 2020 15:36:31 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7Ro-0003aD-Hy for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 15:36:26 +0000 Received: by mail-pf1-x442.google.com with SMTP id j1so1321083pfe.4 for ; Wed, 24 Jun 2020 08:36:23 -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=XJUzgH5TgVAKrlAz/oLGoEzf+4q4DR2SPe5g3v8Hoz0=; b=L87UOx1rFbEBv6EAXMjq42JQm86UtPUvAjrSDFUjZV7/S2Fdwtz80FtkbJzD8kccUr iRuRTc98qsUUvW4wRLaZIRPNfFKjSXe1ODNggmES4VHyXOVp9NEfQINR136Asyjj1o/J v+lhjyzt2oK0bGeFeFUl+FR9FpGwVWyk6cXTQ= 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=XJUzgH5TgVAKrlAz/oLGoEzf+4q4DR2SPe5g3v8Hoz0=; b=e1r5GDAeE3QQ7E5/dlY2QhWQPtV48Th0dAf/8lVA4njFP+T7RqwsYqipmBP2USY/5m cPRVJpDwZxOkMgyu71pe7g3pzuVxP5AeZqa4k3ybmBYEStgdn7wN/Vx+qMSI8NyvFoLV djIRhMwOGQ/KS1r3Lx7wsqwmq2NOaHMpue2u/ZvXFs8H2k5oshYM9dSGQbJB6yqYgW3H TfVxYRd/hXvEYKkt5V9ZjZYyH7AUzUgacT6K3mfIDZ6vz2ySYDSz5CIKEkSL1lv36UmI XX7D4NAopCfhflB0PdGi/z/w5grqQFoxKhbw2XdoOeSTFsvK9vLKM1SHWhh58QuWfV0A yjgw== X-Gm-Message-State: AOAM5301PXK9Uv9GNremtWT6QEOUTZ7zom/E37mSTodloaZgryfDNe51 vy6ZVgAJdoTDGSTPjusr2Cuv5g== X-Google-Smtp-Source: ABdhPJzh0NIgxXcoqTxHGxMf5jIULfS15W7YCEH1YCRk0fdSR5z7SraN22S3afSROtaHxZ0aAd1AOA== X-Received: by 2002:a63:aa42:: with SMTP id x2mr21604671pgo.361.1593012982182; Wed, 24 Jun 2020 08:36:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j36sm17984549pgj.39.2020.06.24.08.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:36:21 -0700 (PDT) Date: Wed, 24 Jun 2020 08:36:20 -0700 From: Kees Cook To: Will Deacon Subject: Re: [PATCH v3 9/9] arm64/build: Warn on orphan section placement Message-ID: <202006240835.E474048BBF@keescook> References: <20200624014940.1204448-1-keescook@chromium.org> <20200624014940.1204448-10-keescook@chromium.org> <20200624075712.GB5853@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624075712.GB5853@willie-the-truck> 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 Wed, Jun 24, 2020 at 08:57:12AM +0100, Will Deacon wrote: > 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 ;) Yeah, this one patch did grow a bit. ;) I've split it up now. > You can also add my Ack on all the patches: > > Acked-by: Will Deacon Thanks! -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel