Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3911018ybv; Tue, 25 Feb 2020 09:29:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyohiu4/xZ+gPHfIeb/4thm98BZG9cNjtuH8b6d9Z8b2KTsA2u94EfQ0SWhLBvT7Z6vEX9f X-Received: by 2002:a05:6830:610:: with SMTP id w16mr46379970oti.239.1582651776181; Tue, 25 Feb 2020 09:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582651776; cv=none; d=google.com; s=arc-20160816; b=PtZWiFidzwNyYT4Pi8Cg9KxXL5xibjHyhOXF4jrq6GvLPSntnHBRH1xcSTmCFe+OMH EwhEqnFRhCLUC6s03gISv/8stqPK9pHwipEfGhLxo1r5032VTopHV+hNg7u3TCd1+o1L DLT9kykxsUuCZRsiyUDAmmt4sp54op05xVN6/b1BWPXss28vGS/5ECgEaSkGTdCac0bY hEVP2DaZxGjiLynvEqVjqmhWXAH3W5x2DZ8vvZu5ku08fbBB/31dV8JAetVlpOnYAC9T A4mOTdLGuuL594lRVk4AloDGwfB80q5uZqmmd60TkxAfNde2qFOf6iePTDsPgHPb4IqQ GkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aHcjvmklAnsvS0aDidN1t6BlHLiGfrfBmwdpaAirUxg=; b=RJy9UpVrjEF6vDKXZN59cTu+Owk4nGI+yoEaa/dX1eQ8eNeOoX4Gxn7Acq9a8+0men n6/pxC9hue9nIUoWXfM5puxjq0L6OohiP1pHGmiGtqV1+nPoFFKoJIkHjjOl6ddqQ7pk I5hwd3EwgGQ4vxDDalY8ZUmMqQuyRRps9VW13vS1MT1e155fO9YQS+h+33dFWZXR4vXB xlNphnc5N0YqmK3fzHp1PMLaIBqnH9TelifHIsZHCt6d+MZQzqyQZi48j3XmNDzdS2q6 wXChPt1zhz4u2VyCGhDo16HKh5SscG7dCJx+dkm92xdamDbzQNlvbRj3pGiXnespIfz4 GykA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si3246968otr.227.2020.02.25.09.29.24; Tue, 25 Feb 2020 09:29:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730214AbgBYR10 (ORCPT + 99 others); Tue, 25 Feb 2020 12:27:26 -0500 Received: from foss.arm.com ([217.140.110.172]:53552 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728200AbgBYR1Z (ORCPT ); Tue, 25 Feb 2020 12:27:25 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 21F221FB; Tue, 25 Feb 2020 09:27:25 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A6403F6CF; Tue, 25 Feb 2020 09:27:24 -0800 (PST) Date: Tue, 25 Feb 2020 17:27:23 +0000 From: Mark Brown To: Amit Kachhap Cc: Catalin Marinas , Will Deacon , Alexander Viro , Paul Elliott , Peter Zijlstra , Yu-cheng Yu , Vincenzo Frascino , Marc Zyngier , Eugene Syromiatnikov , Szabolcs Nagy , "H . J . Lu" , Andrew Jones , Kees Cook , Arnd Bergmann , Jann Horn , Richard Henderson , Kristina =?utf-8?Q?Mart=C5=A1enko?= , Thomas Gleixner , Florian Weimer , Sudakshina Das , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dave Martin Subject: Re: [PATCH v6 05/11] arm64: elf: Enable BTI at exec based on ELF program properties Message-ID: <20200225172723.GG4633@sirena.org.uk> References: <20200212192906.53366-1-broonie@kernel.org> <20200212192906.53366-6-broonie@kernel.org> <275b9cdb-7835-0dfe-9bea-acb0d8301e36@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TmwHKJoIRFM7Mu/A" Content-Disposition: inline In-Reply-To: <275b9cdb-7835-0dfe-9bea-acb0d8301e36@arm.com> X-Cookie: Booths for two or more. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TmwHKJoIRFM7Mu/A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 25, 2020 at 06:58:50PM +0530, Amit Kachhap wrote: > On 2/13/20 12:59 AM, Mark Brown wrote: > > +static inline int arch_parse_elf_property(u32 type, const void *data, > > + size_t datasz, bool compat, > > + struct arch_elf_state *arch) > > +{ > Does this check here make sense to skip running extra code? > if (!system_supports_bti()) > return 0; This specifically is the wrong place for such a test since we didn't even figure out if we're looking at the BTI property yet so it'd need to be moved if any further properties are added. > Although this check is there in arch_validate_prot. And more importantly in arch_calc_vm_prot_bits() so we never actually create guarded pages on a system that doesn't support BTI. That said I do agree that it seems reasonable to add an explicit check in the parsing of the actual BTI property for robustness and clarity, I'll do a patch for that and roll it into any future versions or send it incrementally if this one is applied but it doesn't seem sensible to spin the whole series with the very broad CC list it has. --TmwHKJoIRFM7Mu/A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl5VWPoACgkQJNaLcl1U h9Bq6Af/XISIHfTbIdVWLIy9cav1xBGoNheQB8U8jrd370PqkAtHsvZwnq9aDdt3 IxSWEuRVgj4bCprzm7gRSiLT5DSxNEqraVfT9GtbAy2Yi/ErLTSHRTCafCelguRv guxddwpmSo/yyNcyW0xen19YAhFjJ+VAKjlPdO0ApbplIBWPzwX7cvO7db6qnH9m k0GBhysZIXjhJW9KtjmFjdeiJxWGkjTXMDiC5O+Lq0/PL5MIWzrALmT45mFq4Ojf 1rHAkV6H/8HqU7hSGxnKegK5uwx/gPT2JjhKVYoXXnTIogDeFmnBuz4ZlWMaVD0P 3T4W1JDe639jb8v2EqZNxjdsU2XPFA== =os2p -----END PGP SIGNATURE----- --TmwHKJoIRFM7Mu/A--