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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 1A3EDC63697 for ; Tue, 17 Nov 2020 21:18:48 +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 5F26424248 for ; Tue, 17 Nov 2020 21:18:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0Dkn1D/E"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FPqXJr9i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F26424248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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=XpLfqsTugYH7FFrN+I4IExNRxsqBkfU6c2uZoWxyahU=; b=0Dkn1D/Ewr6gHI8pFrSBbKBuV grHNIBd7NAs6aAANHUT4IAeVX87YusAIxk7QZ3/bPqvrE/b5WwEfJ+LsschufNXsfAZ+DlMM9uJQM neA4879ld9KXj0pcOB7lKT+Vu5DEj+4n1zgn+5rZMw5o4ppf7U2UkIb/ZN/sOXMqB9/BcYrDloaYv dY0mCTz6GwjC5monQDcHBbkTeQYgoW8NUSfqXhuD1qOR+34Qcd6Mo9DdLaHpQ7XE4OXy3TVz7Zyha gPOBzKHhy6BGBVlDEoEAeIqXTjvjXbILI4+9EAJzDbVIAQEaH4F6Kq7zDYXwvEZUPziZVEJ7SAK+h QAODWSbuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf8M3-0006Xn-Ha; Tue, 17 Nov 2020 21:17:35 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf8M0-0006XQ-M7 for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 21:17:33 +0000 Received: by mail-lj1-x241.google.com with SMTP id p12so25944842ljc.9 for ; Tue, 17 Nov 2020 13:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I/hHF4xlcau8abUMMWWu9ZOPfLuX56SHUOKI4p/GLog=; b=FPqXJr9icDh9L7sI6ggEaWimg9DuZcX++8IlgUQAq4mXREd7/XhwpmygB9qKmqGvqN SgbZqbV8tybddAgk78HR7TYSHbwylUQzGkMaoaX8Un84MYCZ5QF3DXxAmnEV6pZf/g60 tNyL40rr2dqucYJetfJpcOCm9LHFMSF1y9AnHiL/5Po5NzezA3haTP/heFqC2oAsbS3j D9vdsy5PKYnI45n5K1+qUG97MU0q4SQnq1oZnXo6MIQihRQn0QRF3t3+EtlG1QduJniW +cRsHvzXQ8D3t2PmcksPlXKrcPcLwOBxN/Hd8u2jOyRMLnLNeJ78n8ZtuqKZDUofrVoN dZ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I/hHF4xlcau8abUMMWWu9ZOPfLuX56SHUOKI4p/GLog=; b=PP6R7dszo0g6y0zwS6Jgw5UILP5TLrDpoZdMFmWDbLSlekrE/7sAu/q4/xH84kNoo2 GTgXsj4nFhePEC7ltxpeRcar12EQP6Q0pPLtMgF53gES6lqbT4DGmAK0TneI/IqvuNLI c8Ij1kVqv1huAVEO5W9EfG/NXbFxq7sgjGVeb+dJiNyS3Ty0OvEvBG+5mq+wKAEpq1C6 p/PTGflmAucaNkVgQLhAvN6vPTcRfvgw/P1VhD6v7JDzGBvUOtpPYWlaHT1ui9OqUwRe nxnku5dmiw0mWQJFM6VtZvcEAJxyYmo2cWfgwweqbAhtwq4GU4XDaqsT0B0liUqaVXWo na4g== X-Gm-Message-State: AOAM5311xNtqBbYa1rRsQQLpFGpdSfNCbebfYtNXgXVNE19Hfabrsx5F MDR7IlWtHfxeQrSiXcxj9TIsQwWAekLXqP3JndnbLw== X-Google-Smtp-Source: ABdhPJwwYzjaEnUocguKy9WJ8dtjA20kmRVQYAgUyPCCmjjYxTPilv86jTYXLmDvrReOEOTbXTIGkyUopqHL2PSdFCc= X-Received: by 2002:a2e:95d2:: with SMTP id y18mr2899299ljh.286.1605647850397; Tue, 17 Nov 2020 13:17:30 -0800 (PST) MIME-Version: 1.0 References: <20201112183839.1009297-1-natechancellor@gmail.com> In-Reply-To: <20201112183839.1009297-1-natechancellor@gmail.com> From: Linus Walleij Date: Tue, 17 Nov 2020 22:17:19 +0100 Message-ID: Subject: Re: [PATCH] kbuild: Always link with '-z norelro' To: Nathan Chancellor X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_161732_806907_DAE145CE X-CRM114-Status: GOOD ( 16.56 ) 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: Florian Fainelli , Arnd Bergmann , linux-kbuild , Catalin Marinas , Masahiro Yamada , Nick Desaulniers , Russell King , Jian Cai , Michal Marek , Linux ARM , Abbott Liu , Andrey Ryabinin , Mike Rapoport , Will Deacon , Ard Biesheuvel , "linux-kernel@vger.kernel.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 Thu, Nov 12, 2020 at 7:41 PM 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. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1189 > Suggested-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor OK makes sense, FWIW: Reviewed-by: Linus Walleij Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel