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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 BF49BC5519F for ; Wed, 18 Nov 2020 23:07:50 +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 3FA9D22255 for ; Wed, 18 Nov 2020 23:07:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cCMdxBYQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GyVmbiub" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FA9D22255 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Kmdb5Rkz8DSqufJWbXgMrj+jgwFhhI1L+Xz21NJenag=; b=cCMdxBYQrz9D6FkwWg3Z0BbHQ PbINGnfVARIM7/ItoLCtPuAiQoCp6oOK+/8XW0HL4zGcVUL6YlRuHlkQf7LCzHdhCwhC5MDBPn8XB VoxbgmLH39DWU9lL51kmiTo6lY8OsyV32OuxGnH9GO90zebkwrqrFMy8wL8HSrnZPZCDZAe+hxmwb NmLFOKucF8wPMyNKQOlB5TrxV26RrL/h1b8Az8WNa9buTofP/2tMABiwHUiHQmDGDAcmOulYklK3t TzAhlL0DOk2ves7S1Ic8wyJBDH438fRZY6rCeS3R/VWR12uZrSQBRihTX2oXCcQ+eWjmH0dwHuKYh mTU1bpjQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfWXl-00077X-OG; Wed, 18 Nov 2020 23:07:17 +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 1kfWXh-00076I-UP for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2020 23:07:15 +0000 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EAE9246E8 for ; Wed, 18 Nov 2020 23:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605740832; bh=ozEp87BLC35xPyBVmDNmQ6DkEOrGPDG+EAMmXG54HQ4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GyVmbiubYH+DB+w+71RKjxb6bgYshMPjCmqYnRga9x1cUqzxDer+7gQRWsW6gCe69 8mzHYvJ8kjyuf0y5YpTNGejuVc1JiflOf2lFlJXG0CqH8vLKCUbATja58auHlmBkas 4pPw3fiMcY8MbqZJo6iCOOW0bXOgGEyDtip+0hWs= Received: by mail-oo1-f53.google.com with SMTP id l10so873157oom.6 for ; Wed, 18 Nov 2020 15:07:12 -0800 (PST) X-Gm-Message-State: AOAM532svNVXUTsUeNfd29+rODY4KhgQl5UtdSAZTInWVoG3p6/ctSre L6VsfVTc2+I1jOHEinD1F0/iHGazQTywjYUt9b4= X-Google-Smtp-Source: ABdhPJzhjKMJ9WU+vCAYaN4v+U+O1urFrWl4AEKRcYEc6mJ61WIU8kTJrw45Rs9k7wUhrxisrmJIXMm3W8M1tsGJgL4= X-Received: by 2002:a4a:844f:: with SMTP id m15mr8299508oog.41.1605740831825; Wed, 18 Nov 2020 15:07:11 -0800 (PST) MIME-Version: 1.0 References: <20201112183839.1009297-1-natechancellor@gmail.com> <20201113005347.GA3625030@ubuntu-m3-large-x86> In-Reply-To: From: Ard Biesheuvel Date: Thu, 19 Nov 2020 00:06:59 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: Always link with '-z norelro' To: Nick Desaulniers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201118_180714_278557_68239279 X-CRM114-Status: GOOD ( 24.49 ) 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: Dan Rue , Michal Marek , Fangrui Song , Arnd Bergmann , Linux Kbuild mailing list , Catalin Marinas , Masahiro Yamada , Russell King , Jian Cai , Florian Fainelli , Mark Brown , Linux ARM , Abbott Liu , Andrey Ryabinin , Nathan Chancellor , Mike Rapoport , Will Deacon , Linus Walleij , LKML 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 Thu, 19 Nov 2020 at 00:05, Nick Desaulniers wrote: > > On Fri, Nov 13, 2020 at 11:34 AM Nick Desaulniers > wrote: > > > > On Thu, Nov 12, 2020 at 10:06 PM Ard Biesheuvel wrote: > > > > > > On Fri, 13 Nov 2020 at 01:53, Nathan Chancellor > > > wrote: > > > > > > > > On Thu, Nov 12, 2020 at 04:44:46PM -0800, Nick Desaulniers wrote: > > > > > On Thu, Nov 12, 2020 at 10:41 AM Nathan Chancellor > > > > > wrote: > > > > > > > > > > > > Commit 3bbd3db86470 ("arm64: relocatable: fix inconsistencies in linker > > > > > > script and options") added '-z norelro' to the arm64 Makefile when > > > > > > CONFIG_RELOCATABLE was set to help support ld.lld because ld.lld > > > > > > defaults to '-z relro' but the kernel does not use program headers or > > > > > > adhere to the section layout that is required for RELRO to work. > > > > > > > > > > > > Commit 3b92fa7485eb ("arm64: link with -z norelro regardless of > > > > > > CONFIG_RELOCATABLE") unconditionally added it to LDFLAGS_vmlinux because > > > > > > an error occurs with CONFIG_KASAN set even when CONFIG_RELOCATABLE is > > > > > > unset. > > > > > > > > > > > > As it turns out, ARM experiences the same error after CONFIG_KASAN was > > > > > > implemented, meaning that '-z norelro' needs to be added to that > > > > > > Makefile as well (multi_v7_defconfig + CONFIG_KASAN=y + LD=ld.lld): > > > > > > > > > > > > $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 zImage > > > > > > ld.lld: error: section: .exit.data is not contiguous with other relro sections > > > > > > > > > > > > To avoid playing whack-a-mole with different architectures over time, > > > > > > hoist '-z norelro' into the main Makefile. This does not affect ld.bfd > > > > > > because '-z norelro' is the default for it. > > Fangrui pointed out off list that this might need an ld-option wrapper > for older versions of GNU binutils. Dan was showing me some build > logs today, and I thought I spotted such warnings about `-z norelro > will be ignored`. Does ld-option catch options that cause warnings but no errors? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel