Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp704665pxb; Thu, 19 Nov 2020 11:38:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJWgvP6goSWLsI1EkEcc3/TbJxTpZq7o2NMyT6fX0reqNtvy5Ngi6b9SJ1ldCyCbwrlwGX X-Received: by 2002:a17:906:86c7:: with SMTP id j7mr29534661ejy.301.1605814725160; Thu, 19 Nov 2020 11:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605814725; cv=none; d=google.com; s=arc-20160816; b=07VS7LY9UMCVs6GLV10m88lXKO7ubcliqPd1zru1E7FZUOU9WWODu5uI1Xsfn5P4h1 bMB46q6My5+5gc8FGobtcNyHM7mSsElCPB40ka7ZGNahLX4HkKxDvL4vctOeEMor3n4c t7fjmZBM0Fe7jx0ruCP2ReTcqb9ohwh6p0TL3AIYaIBMOqmBZ5q8tX4oB5EfyrzeqRFD Nkyq26LiENRBrgM82zKNlIfyJULfkipntDEY0G8wEAAIVwl48qccF9GcaKQcQz+ImFYg YkZHmrqrcvLrBEK9jslVoXe/FvOc6m8PHotkNc1n1v32cTQhdIBxas1ahbI3ClawSI32 cOkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gziYjKkMg0T3fda4PLPmPFitx5z4Cip2iKsXyoEML/s=; b=qUIi34Mq9pmEInKKNnn8Kly8PX/qnJmJKA9rzSFc3LcC5RPonhsvaETVch/hxTxeqe nnvOSCABOwbxNG1gvK7Tf+O8T70QgIToZmatkgRjhCDHx81vQG57uDm7PchL3QAnIswn zITvFFN+VwbPTXBUK/roSHV+GnWL/gvNs0pIAEXnAcfg6/rQW6J9nIkAL8+oO+gF0x5f CI4deGWoXxHIXCjKRvDiCK0jlN9XDVA9sUrLVSSPG4ybpfgHpCP5yPPDnuL9px3kITjj BbnaMDEKfHYLM2B5Z5sZGbjwAACtefPCuKztll/829vihYvRbR7su0zgvnYaGjP+5cxu t3Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fEILrQsu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zp26si405238ejb.359.2020.11.19.11.38.22; Thu, 19 Nov 2020 11:38:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fEILrQsu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728214AbgKSTd7 (ORCPT + 99 others); Thu, 19 Nov 2020 14:33:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbgKSTd6 (ORCPT ); Thu, 19 Nov 2020 14:33:58 -0500 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FE7C0613CF; Thu, 19 Nov 2020 11:33:58 -0800 (PST) Received: by mail-qv1-xf44.google.com with SMTP id 63so3465218qva.7; Thu, 19 Nov 2020 11:33:58 -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:content-transfer-encoding:in-reply-to; bh=gziYjKkMg0T3fda4PLPmPFitx5z4Cip2iKsXyoEML/s=; b=fEILrQsuqmm7C3jki72PWAuLo9yXZKuY+NTeUlUHEiKXyiEUvI4TuXBuiFrIoUzwf2 rJ7gq8g1lcO/jKDCjcRC9J9ajbXNVLZysRxXzX4Vr+Fce4d2oMTpsJsB5oh7/RODJt4r GmdRFWZUCw8LJMeTSnk6JSsz0sJoLZqnNfRnSPjYyswiTd7oFb4rdTA9mH+I99wgymmV 9PRxhvYjQQ/313sey0FkoXOqTQwWb/nxGUR1C6BGwG1fakx7JNIsPKS4Q27J2go1RdqO M3Xsa3dtr3AVeMvUgNfFlQUjVSUYgYjaTQ7GYGw5sA4oGzZ0sZCrU1ihwpn2LYvKtLaa Eg7Q== 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:content-transfer-encoding :in-reply-to; bh=gziYjKkMg0T3fda4PLPmPFitx5z4Cip2iKsXyoEML/s=; b=pJjJnEaIWunU3SFMoD7Lv1gqDvCANlpiMdapSNr9V/TAuoeWV/HVAqIHZs07jcSnph nWflcbGf+oGQ9Ig8WMXKIsy50324aBqUc3rFKgYwFm/iwDRm8sPR3pb4FEXvtobPv2lU 3+1anK8WKDYAwYVFw0xpl9yp4eMwGwXl2znCHp97d0HBk66ISLG0nNmg6qLebYmmxNP1 0koVyFxAkHqd5fNLGgzqHC2uFbDpB2+2ikA2Fc4WyxAv5fXEPtO5CvWcm2ccUb921M5u AbdFGyMWxzQWXLO3h0xJnO/MAzsVZFE4UcOwi8gKxz0wBaAu4V7F15BsypIc89baNrmR wwRQ== X-Gm-Message-State: AOAM530qWBZEC9WVWoIeuS+H3j18ch+nydfcd6GOYU3O66ILuyLjVxgV yEgvBdMyKgctimtOBqf9fl4= X-Received: by 2002:ad4:4514:: with SMTP id k20mr12374804qvu.18.1605814437722; Thu, 19 Nov 2020 11:33:57 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id p48sm570704qtp.67.2020.11.19.11.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 11:33:56 -0800 (PST) Date: Thu, 19 Nov 2020 12:33:55 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Ard Biesheuvel , Masahiro Yamada , Michal Marek , Catalin Marinas , Will Deacon , Russell King , Florian Fainelli , Arnd Bergmann , Abbott Liu , Linus Walleij , Jian Cai , Andrey Ryabinin , Mike Rapoport , Linux Kbuild mailing list , LKML , Linux ARM , Fangrui Song , Dan Rue , Mark Brown , Alan Modra Subject: Re: [PATCH] kbuild: Always link with '-z norelro' Message-ID: <20201119193355.GA3235069@ubuntu-m3-large-x86> References: <20201112183839.1009297-1-natechancellor@gmail.com> <20201113005347.GA3625030@ubuntu-m3-large-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 18, 2020 at 03:24:04PM -0800, Nick Desaulniers wrote: > On Wed, Nov 18, 2020 at 3:07 PM Ard Biesheuvel wrote: > > > > On Thu, 19 Nov 2020 at 00:05, Nick Desaulniers wrote: > > > > > > > > > > > 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? > > $ ld.bfd -z foo /dev/null > ld.bfd: warning: -z foo ignored > ld.bfd: warning: cannot find entry symbol _start; not setting start address > ➜ echo $? > 0 > > Probably not. Can be a version check then (yuck); next is to find when > ld.bfd supported `-z norelro`. > > commit 8c37241be3b1 in binutils looks like it. > Date: Tue May 11 17:08:38 2004 +0000 > > which looks like either > 2004-05-17 19:46:23 +0000 (tag: binutils-2_15) > or > 2005-05-02 22:04:18 +0000 (tag: binutils-2_16) > > So I think that would be fine then, since the kernel only supports 2.23+. > > Though maybe it's > commit 5fd104addfddb68844fb8df67be832ee98ad9888 > Emit a warning when -z relro is unsupported > > ld silently accepts -z relro and -z norelro for targets that lack the > necessary GNU_RELRO support. This patch makes those targets emit a > warning instead, and adds testsuite infrastructure to detect when > relro is unsupported. > > So maybe then alpha and xtensa are getting new warnings (IIUC). If > that's the case, then we might not be able to set `-z norelro` > globally, and instead have to play whack a mole per architecture. Sure, I can just submit the arch/arm patch that I had before this for now and we can always revisit something like this later, if you feel it is best. Cheers, Nathan