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=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 78C34C47096 for ; Thu, 3 Jun 2021 16:51:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5EAC5613F1 for ; Thu, 3 Jun 2021 16:51:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbhFCQxb (ORCPT ); Thu, 3 Jun 2021 12:53:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:36926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbhFCQxb (ORCPT ); Thu, 3 Jun 2021 12:53:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4E79613B1; Thu, 3 Jun 2021 16:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622739106; bh=3NGvQGORedPqt0D77r3OkoXFokp1EM61eRGVBn3bSCc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MbMjzA8fXlXzBrK0gmvbC6/nM9Seje/7G35bZKhUfRaYOpyT3V5IpIUa9OQJSE3/J hrxG4dCsz8Qp97UMRoROs06zRg4pQd4NuxuZlGEK0Cpz6fwC2zHbWnrgchbmWHDrwA 7MAuSyaDL3fnoq/uuNBxGavYbxaqkxytOoOmOovXOKo3+jwey3+gmi2Ms+qWcpDMNY K+4DrP9/Lidn1HjARnqRL7OkF835C7azrrWBAuoNDlcMcYtQqlw9bFu569rS0CNNti tPiaX6bhmvr7cplGA7rNGkrNoY8SL756MN5SX2lo87VwA9QFtAEI1T3NcQUy7CyeNK wzlrj+9+5+dDQ== Date: Thu, 3 Jun 2021 17:51:34 +0100 From: Mark Brown To: Dave Martin Cc: Catalin Marinas , Will Deacon , Szabolcs Nagy , Jeremy Linton , "H . J . Lu" , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org Subject: Re: [PATCH v1 2/2] arm64: Enable BTI for main executable as well as the interpreter Message-ID: <20210603165134.GF4257@sirena.org.uk> References: <20210521144621.9306-1-broonie@kernel.org> <20210521144621.9306-3-broonie@kernel.org> <20210603154034.GH4187@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iBwuxWUsK/REspAd" Content-Disposition: inline In-Reply-To: <20210603154034.GH4187@arm.com> X-Cookie: Where am I? Who am I? Am I? I User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org --iBwuxWUsK/REspAd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 03, 2021 at 04:40:35PM +0100, Dave Martin wrote: > Do we know how libcs will detect that they don't need to do the > mprotect() calls? Do we need a detection mechanism at all? > Ignoring certain errors from mprotect() when ld.so is trying to set > PROT_BTI on the main executable's code pages is probably a reasonable, > backwards-compatible compromise here, but it seems a bit wasteful. I think the theory was that they would just do the mprotect() calls and ignore any errors as they currently do, or declare that they depend on a new enough kernel version I guess (not an option for glibc but might be for others which didn't do BTI yet). > > flexibility userspace has to disable BTI but it is expected that for cases > > where there are problems which require BTI to be disabled it is more likely > > that it will need to be disabled on a system level. > There's no flexibility impact unless MemoryDenyWriteExecute is in force, > right? Right, or some other mechanism that has the same effect. --iBwuxWUsK/REspAd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC5CJUACgkQJNaLcl1U h9BYcAf+KtLJ0uuW2MkjJ3lNd+ujeqmWUcPw6tQy5T5zSUGtYsNGx2ZrFP01drnw +9dNYITs6f/GQ1XNJ/lnLXh7OR0hXCEg3NVohS1hhQfX8iIQnpStmvdBEoc8/5Cc PdVbHmfFmckyjglzxv5gKuj1O0tPvtjA8L5hAij7+7mQ8J/2tgQVlpTGoGGpj2SJ c/i4iZKYhzbzNtDn4ag+rkJrdRpa4zPSear3D7ZuY9j1UrJZfa8cr/rS7lu2/O2U 65/eaGX+yYjnxgW3frUS03uyfMvpWvDdLNeki+E3LuaY6Hq6otqWdP1TrwLxn9O3 gFJfF0ehKIzSySvFCtLvU9eg2r0FKQ== =kiXe -----END PGP SIGNATURE----- --iBwuxWUsK/REspAd-- 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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 B1092C47096 for ; Thu, 3 Jun 2021 16:59:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 80DB2613B1 for ; Thu, 3 Jun 2021 16:59:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80DB2613B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=H2P4wSB1JsXU4l7iEAf6qZjw42annNhl0ayV9pfYcFk=; b=UrJXZJib9a3LLAe4Ct8w16VfYb gZZh8/9VDNZlIpFnku59d7LKl8Xvi1VcHqVI6FHis9+509VSnc4S4rs1UzwOedZjHUYcABq6GuQXk syo8lI9c0i0DJAfEtCBiSJRl4NNf+u0LLtjRgoupJcW9z5YlaguGH5IMbJauZoqORVTCKr7jwCkfk O6MFItqoKlFl3fVZCDZoxQ7PvP+3y0kaY/Z1DO7wEcQyqg0HqPP0o2G9sIcQSI1kx90IzwbpRr+48 +F/Sjyco6f2kXa1anSCEN6uKj8CO7qy9ftAZ2VWAeNXbPdF97JFrXaGtAQo2Hr8oxQKcnX0F9bZey sH9BCfgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loqem-009fis-W6; Thu, 03 Jun 2021 16:57:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loqZP-009dev-5d for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 16:51:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4E79613B1; Thu, 3 Jun 2021 16:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622739106; bh=3NGvQGORedPqt0D77r3OkoXFokp1EM61eRGVBn3bSCc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MbMjzA8fXlXzBrK0gmvbC6/nM9Seje/7G35bZKhUfRaYOpyT3V5IpIUa9OQJSE3/J hrxG4dCsz8Qp97UMRoROs06zRg4pQd4NuxuZlGEK0Cpz6fwC2zHbWnrgchbmWHDrwA 7MAuSyaDL3fnoq/uuNBxGavYbxaqkxytOoOmOovXOKo3+jwey3+gmi2Ms+qWcpDMNY K+4DrP9/Lidn1HjARnqRL7OkF835C7azrrWBAuoNDlcMcYtQqlw9bFu569rS0CNNti tPiaX6bhmvr7cplGA7rNGkrNoY8SL756MN5SX2lo87VwA9QFtAEI1T3NcQUy7CyeNK wzlrj+9+5+dDQ== Date: Thu, 3 Jun 2021 17:51:34 +0100 From: Mark Brown To: Dave Martin Cc: Catalin Marinas , Will Deacon , Szabolcs Nagy , Jeremy Linton , "H . J . Lu" , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, libc-alpha@sourceware.org Subject: Re: [PATCH v1 2/2] arm64: Enable BTI for main executable as well as the interpreter Message-ID: <20210603165134.GF4257@sirena.org.uk> References: <20210521144621.9306-1-broonie@kernel.org> <20210521144621.9306-3-broonie@kernel.org> <20210603154034.GH4187@arm.com> MIME-Version: 1.0 In-Reply-To: <20210603154034.GH4187@arm.com> X-Cookie: Where am I? Who am I? Am I? I User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_095147_262040_C18C8540 X-CRM114-Status: GOOD ( 19.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2452204068151826243==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2452204068151826243== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iBwuxWUsK/REspAd" Content-Disposition: inline --iBwuxWUsK/REspAd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 03, 2021 at 04:40:35PM +0100, Dave Martin wrote: > Do we know how libcs will detect that they don't need to do the > mprotect() calls? Do we need a detection mechanism at all? > Ignoring certain errors from mprotect() when ld.so is trying to set > PROT_BTI on the main executable's code pages is probably a reasonable, > backwards-compatible compromise here, but it seems a bit wasteful. I think the theory was that they would just do the mprotect() calls and ignore any errors as they currently do, or declare that they depend on a new enough kernel version I guess (not an option for glibc but might be for others which didn't do BTI yet). > > flexibility userspace has to disable BTI but it is expected that for cases > > where there are problems which require BTI to be disabled it is more likely > > that it will need to be disabled on a system level. > There's no flexibility impact unless MemoryDenyWriteExecute is in force, > right? Right, or some other mechanism that has the same effect. --iBwuxWUsK/REspAd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC5CJUACgkQJNaLcl1U h9BYcAf+KtLJ0uuW2MkjJ3lNd+ujeqmWUcPw6tQy5T5zSUGtYsNGx2ZrFP01drnw +9dNYITs6f/GQ1XNJ/lnLXh7OR0hXCEg3NVohS1hhQfX8iIQnpStmvdBEoc8/5Cc PdVbHmfFmckyjglzxv5gKuj1O0tPvtjA8L5hAij7+7mQ8J/2tgQVlpTGoGGpj2SJ c/i4iZKYhzbzNtDn4ag+rkJrdRpa4zPSear3D7ZuY9j1UrJZfa8cr/rS7lu2/O2U 65/eaGX+yYjnxgW3frUS03uyfMvpWvDdLNeki+E3LuaY6Hq6otqWdP1TrwLxn9O3 gFJfF0ehKIzSySvFCtLvU9eg2r0FKQ== =kiXe -----END PGP SIGNATURE----- --iBwuxWUsK/REspAd-- --===============2452204068151826243== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2452204068151826243==--