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=-11.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,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 9DB9CC2D0E4 for ; Fri, 13 Nov 2020 00:54:19 +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 3629C20B80 for ; Fri, 13 Nov 2020 00:54:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lKDDzm08"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J5hJ054G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3629C20B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=9PyOI6RTcUGGwW9hBY8CcXE+0vJfZBr7m4vwTWg3NYs=; b=lKDDzm08GBtOeAKouGynkWMGN WCjfhZFsKAa+PjzflYnO+c7w95hazJ9N1eOnSQgHR6/Xgtg0jYAufZehz8sFnCcbWKRXrKkF+EImk /y+A8clzu0FPxmz+vQmgsdRN3izdoeNyfD1RYHhByGTQZFVJhsWpb6u8wZQIQQ4XXRmEEprbJtb2K GP+9bv3mwOXoY3tYVv0mR8SQb7hwuU9zHxWuBDljeVXbKuHFl+I8fvw1xkfGeNikqS8pbiybC8Tv6 HYmmcX03M2kjqlRIa/aQ4uUmmsMCeVJq2sq4RrIbzWu/HAzl9+kCmg4gHmBj6EAZycJ8B6Y9r14J1 C2llmIUJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdNLe-0004y5-CC; Fri, 13 Nov 2020 00:53:54 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdNLb-0004xO-Rk for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 00:53:52 +0000 Received: by mail-qk1-x743.google.com with SMTP id r7so7465359qkf.3 for ; Thu, 12 Nov 2020 16:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yh/YuTw0y4KR1MgkgIBehu19vz49jA8SsJy90VDwqGU=; b=J5hJ054G32wzCXh7R5D/WPjTqiomiHjOOgzNffvkR2KB9Gxxp1mCIg1Bpyh3ODjPtw fHM53tdVC7fJPJck2D2zbXqvZHDPltV/mUJYRTltz4towedQTSvpxMmV2o8rg8DHyX+K kCCNZvfbX9K+1R2sZCj1LbqarVu/LWF5m1ImklDLwEvTLfgopHlQz8ZE5PAwW3BewItc QLsYyt8JOVghe2br+L9VhWXFkCHaqs5jiVN9sRdz5HK1AVKkY0uFEz5asEE2z6uU245+ GHr4nYRS4k1fYK6afm4g+wRg0RtGYcS/tzD4BXLYCCB/S3clmd7s74O1dhvUFxgc9p5g 6qaw== 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=yh/YuTw0y4KR1MgkgIBehu19vz49jA8SsJy90VDwqGU=; b=RSDH2fSMBBrzqLGtRqGNELTQukgSbn5dsIZKhEU1Vqar16XxJK/20l6XW2o6kfwOB9 RHaKZsCHLiqoRnFV5kc8gt/4GEWaZxW9lnPE4U7TnLw76C3k9dQZ/YESc1j0p3uY2l9I xRwRVktr8fRoH5Ah2kFhqSrKiw3SGSjXcMusz2ug60iDrpLf+ijOWa41vWpD2vLw/MiB b7RuyK1IwftniGR+phJCk8OUlx9eCxI6qOg01cdmYW0jfZHLrzrBHYbLGUf/5PFeA8u1 BBWp7qQKaaJ0zLkgWGF0M8letYgzGeFCsMVTUOGQCTbvryPq321ICwYqIkP0dSR9ksRN RzoA== X-Gm-Message-State: AOAM533JpiBYWsroHuSD0i00X4AeRudq9XXtjbMaBNNvFOiJlBfvHZsL HgGxOlhYAEDOAJNWmBFKa+M= X-Google-Smtp-Source: ABdhPJxI6cxHqXTnL8iNUPyKAT3DdO12ers/lEE6XssOLoVGxQGUFwOgjoS54/qkoRdbXCzDQgS0OA== X-Received: by 2002:a37:b985:: with SMTP id j127mr2629060qkf.282.1605228830079; Thu, 12 Nov 2020 16:53:50 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id r190sm5941546qkf.101.2020.11.12.16.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 16:53:49 -0800 (PST) Date: Thu, 12 Nov 2020 17:53:47 -0700 From: Nathan Chancellor To: Nick Desaulniers Subject: Re: [PATCH] kbuild: Always link with '-z norelro' Message-ID: <20201113005347.GA3625030@ubuntu-m3-large-x86> References: <20201112183839.1009297-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_195351_967286_CE055BFE X-CRM114-Status: GOOD ( 22.98 ) 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 mailing list , Ard Biesheuvel , Catalin Marinas , Masahiro Yamada , Russell King , Jian Cai , Michal Marek , Linux ARM , Abbott Liu , Andrey Ryabinin , 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, 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. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/1189 > > Suggested-by: Nick Desaulniers > > Signed-off-by: Nathan Chancellor > > Why not add it additionally to KBUILD_LDFLAGS_MODULE a la > `--build-id=sha1` a few lines above? (or `LDFLAGS_MODULE`, but that > looks unused?) We probably don't want this for modules either. In > that case, you could add -z norelo to the two existing lines with > `--build-id=sha1` above? Yes, I can do that. I will send a v2 along tomorrow morning to let others comment. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel