From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH v10 00/13] arm64: Branch Target Identification support Date: Mon, 23 Mar 2020 15:32:28 +0000 Message-ID: <20200323153228.GE4948@sirena.org.uk> References: <20200316165055.31179-1-broonie@kernel.org> <20200320173945.GC27072@arm.com> <20200323122143.GB4892@mbp> <20200323132412.GD4948@sirena.org.uk> <20200323135722.GA3959@C02TD0UTHF1T.local> <20200323143954.GC4892@mbp> <20200323145546.GB3959@C02TD0UTHF1T.local> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2hMgfIw2X+zgXrFs" Return-path: Content-Disposition: inline In-Reply-To: <20200323145546.GB3959@C02TD0UTHF1T.local> Sender: linux-kernel-owner@vger.kernel.org To: Mark Rutland Cc: Catalin Marinas , Szabolcs Nagy , Will Deacon , Alexander Viro , Paul Elliott , Peter Zijlstra , Yu-cheng Yu , Amit Kachhap , Vincenzo Frascino , Marc Zyngier , Eugene Syromiatnikov , "H . J . Lu " , Andrew Jones , Kees Cook , Arnd Bergmann , Jann Horn , Richard Henderson , Kristina =?utf-8?Q?Mart=C5=A1enko?= , Thomas Gleixner , Florian List-Id: linux-arch.vger.kernel.org --2hMgfIw2X+zgXrFs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 23, 2020 at 02:55:46PM +0000, Mark Rutland wrote: > On Mon, Mar 23, 2020 at 02:39:55PM +0000, Catalin Marinas wrote: > > So this means that the interpreter will have to mprotect(PROT_BTI) the > > text section of the primary executable. > Yes, but after fixing up any relocations in that section it's going to > have to call mprotect() on it anyhow (e.g. in order to make it > read-only), and in doing so would throw away BTI unless it was BTI > aware. Ah, of course - I forgot that's not a read/modify/write cycle. I'll send the comment version. > > That's a valid point. If we have an old dynamic linker and the kernel > > enabled BTI automatically for the main executable, could things go wrong > > (e.g. does the PLT need to be BTI-aware)? > I believe that a PLT in an unguarded page needs no special treatment. A > PLT within a guarded page needs to be built specially for BTI. Unguarded stuff is unaffected. --2hMgfIw2X+zgXrFs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl541osACgkQJNaLcl1U h9A4pAf+IvJV9iWwP6vJKgT868+5ZjhSjiVsOKwt0PqgVzwOcV5HIX7k7mlf91GM k1Fn/ZsPWecmng93bj0iUlMtnBCoxTyE4F20odXx1vgUhscr6RjCvtPkGlLEgYEz 0Cs6mB6NDjJxcTJDxB54HIXhlP4lL3Jo++u+yRS2/0lLHba08FUu7/gJYjh7TTCV n9kw50W8boGR1DgRe51u0Yn08RqNt2Boe/tauY2huT9H5zgbM2d40jv7qVcdTffJ PWeuF23KN9w9E/burfR4MrA8JtLgZHrnjt5cuSXuogtP28D1UcfgaKfr8JSDPT6P VjN8hBGRZhte6hqR58+ZsNUrKDDLIw== =1CsH -----END PGP SIGNATURE----- --2hMgfIw2X+zgXrFs-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.110.172]:51124 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727137AbgCWPcb (ORCPT ); Mon, 23 Mar 2020 11:32:31 -0400 Date: Mon, 23 Mar 2020 15:32:28 +0000 From: Mark Brown Subject: Re: [PATCH v10 00/13] arm64: Branch Target Identification support Message-ID: <20200323153228.GE4948@sirena.org.uk> References: <20200316165055.31179-1-broonie@kernel.org> <20200320173945.GC27072@arm.com> <20200323122143.GB4892@mbp> <20200323132412.GD4948@sirena.org.uk> <20200323135722.GA3959@C02TD0UTHF1T.local> <20200323143954.GC4892@mbp> <20200323145546.GB3959@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2hMgfIw2X+zgXrFs" Content-Disposition: inline In-Reply-To: <20200323145546.GB3959@C02TD0UTHF1T.local> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Mark Rutland Cc: Catalin Marinas , Szabolcs Nagy , Will Deacon , Alexander Viro , Paul Elliott , Peter Zijlstra , Yu-cheng Yu , Amit Kachhap , Vincenzo Frascino , Marc Zyngier , Eugene Syromiatnikov , "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 Message-ID: <20200323153228.Qs9c_Rbae1pCurOXEtIF9h3FXIhT5RdMimhT6ivR7Jc@z> --2hMgfIw2X+zgXrFs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 23, 2020 at 02:55:46PM +0000, Mark Rutland wrote: > On Mon, Mar 23, 2020 at 02:39:55PM +0000, Catalin Marinas wrote: > > So this means that the interpreter will have to mprotect(PROT_BTI) the > > text section of the primary executable. > Yes, but after fixing up any relocations in that section it's going to > have to call mprotect() on it anyhow (e.g. in order to make it > read-only), and in doing so would throw away BTI unless it was BTI > aware. Ah, of course - I forgot that's not a read/modify/write cycle. I'll send the comment version. > > That's a valid point. If we have an old dynamic linker and the kernel > > enabled BTI automatically for the main executable, could things go wrong > > (e.g. does the PLT need to be BTI-aware)? > I believe that a PLT in an unguarded page needs no special treatment. A > PLT within a guarded page needs to be built specially for BTI. Unguarded stuff is unaffected. --2hMgfIw2X+zgXrFs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl541osACgkQJNaLcl1U h9A4pAf+IvJV9iWwP6vJKgT868+5ZjhSjiVsOKwt0PqgVzwOcV5HIX7k7mlf91GM k1Fn/ZsPWecmng93bj0iUlMtnBCoxTyE4F20odXx1vgUhscr6RjCvtPkGlLEgYEz 0Cs6mB6NDjJxcTJDxB54HIXhlP4lL3Jo++u+yRS2/0lLHba08FUu7/gJYjh7TTCV n9kw50W8boGR1DgRe51u0Yn08RqNt2Boe/tauY2huT9H5zgbM2d40jv7qVcdTffJ PWeuF23KN9w9E/burfR4MrA8JtLgZHrnjt5cuSXuogtP28D1UcfgaKfr8JSDPT6P VjN8hBGRZhte6hqR58+ZsNUrKDDLIw== =1CsH -----END PGP SIGNATURE----- --2hMgfIw2X+zgXrFs--