Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2507428rdb; Wed, 21 Feb 2024 09:36:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUASYqaGb0slIVEELON12JIkLm/t+Ag5sxHK8dGe87ae74LRGyyX2Y4jHvsP5zcA9yKlEdNwahzpFGcIiV4UVsSfMTMsqf/vRdF9Hq/sA== X-Google-Smtp-Source: AGHT+IF3at4y9OYv2UbP8uPaBDBieks4Ru5BXi+iCWBer+m3eLm0E7tOfQbwrh2pM6E2Bdw258Mr X-Received: by 2002:a05:6214:3015:b0:68f:1bd9:f6d5 with SMTP id ke21-20020a056214301500b0068f1bd9f6d5mr18155288qvb.16.1708536997759; Wed, 21 Feb 2024 09:36:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708536997; cv=pass; d=google.com; s=arc-20160816; b=tn8sjUuZvsJlDvw65GD5jzj3jooHhjwfQiOg+v9hbpT9hKDQsp8eCeKnpeylR5J2qv Rp3ov73+7S1VWo1B5kEiwJRZPxKenj56ElU/mGBJYHtv6HGKzG4FdArB2ntXrnZRlXxD 4TcSCGO2RqkUqSOyNn8Hv2i7EqtTmfC7WcVzK4M1Uil32uO/7+Vt64b6Kdc3mwKUVsyq 44L7z3jwF7Jyhy2Aal7zIgkYrCB8ENBx5LXxw4im5etYihOdQUIvS7k3qDd1XEWyVKDj nIW5MN7d75SNSINjxj10snyJAIns7pKCM7rcL9Xo91PP6d9r4O/uo3X1nTuy+MSdkMcY n3Xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PMjL3AbjIoy3EBiG5m8OQIk8cqZjIuewJUJPyjduMOA=; fh=bK2TNWI1JdrPPde3YQZQXeUk6vxxXnhujJyiMpPsIY4=; b=EbIMnLrA6SZfIJdj9MEq0oxSZtuhn/XbrvFWHaWvi2DmeCTtzSQZ9xFaI6C1/7Sn7c N8WCEhB21h3YhwbpTLGrTVKXKqS1VvqgVDzDesv153ITNn1UcJvRO0O7tzbNNDcDyr8P n8i3VXd7K/jo/uf++7zdPpMr5ePFgJQd/Zi2ubp7N9fLqK1usoXt1HoVwxoLlHQt29kT 4i9xIfcibJEaiWLCaJXsl9HaXBLsfzdwGlpUoCKA+AbWNyDIO/8AwP5xd3uIvdx/PpQU 7HYjU9AFhwCLeEkO+b1OtO9TytNWqlNfkRitZMnUhDED/vIFOLQ8PE6oQxlWNsARsu3U rdaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O12n148t; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jq11-20020ad45fcb000000b0068f52b36b81si9378739qvb.55.2024.02.21.09.36.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:36:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O12n148t; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 74EB51C23028 for ; Wed, 21 Feb 2024 17:36:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B77A184A21; Wed, 21 Feb 2024 17:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O12n148t" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB93F82865; Wed, 21 Feb 2024 17:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708536983; cv=none; b=oar2RshXI3OCV8qDYcrJvi1AW99x0vWqXR9A+fMDneD7eJcRpefdD6mrzG7Sy2LAg3QLX6eB9YgkVvLAd76il2NnbxB6/QK+Q5smlBcS3769SSafM7OWuHPF96IEuM5tZpy+kfHyOQse2Fo0mFY5cVxgI+JywSir8w1oT/Ab8dU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708536983; c=relaxed/simple; bh=yiMUcDHHU5n4NoQ84wGw656HnuqVIwBmqSIpUYSySM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pm4hsDeN3YzFtJKMeEL4BpULGS6KHPSDVs55bYyiDpFpGaTnAW3znsuhOLg6vgMKtlOvKxvsvNhDKjuKYxpK4msIPatgic+wc/M2tHGFwruH2t/WTg16ZiC4rWWLZSKhznxa12MjoM5z5gljdXApqog/KsUKDz7T1nKtyGq7hXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O12n148t; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 569D2C433F1; Wed, 21 Feb 2024 17:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708536983; bh=yiMUcDHHU5n4NoQ84wGw656HnuqVIwBmqSIpUYSySM0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O12n148tnxl0hHrH0KNUw308nap2CMfsjiJaCO+G6etl5udAA3V57bqbWZBFQUGZs Kj4x4GxnB2NHbhBuzMjO33ReX0o4unLwDVUsx7rE6BrK0mSY+AQVi1U20errE3mUk7 nVTIbjx7vjPf0I68CWxX1fA4b1OFc0RyrKyDq5swD9NlwBDQWruvA/i+WNXsvWkpRM uYyCW+odtKyrAny0HBpdXJaxNnNh93OFpmEFT500VAoVKZsfjMLpKQM8nF17WmQNVZ f7b+uqFxyhSA53z6Utjz7HKlp+QYfzdvrhQRfPQSg/ENFM+J0kh3Y5lihL5FmDHnX1 07XkRuq4u5RdA== Date: Wed, 21 Feb 2024 17:36:12 +0000 From: Mark Brown To: "dalias@libc.org" Cc: "Edgecombe, Rick P" , "linux-arch@vger.kernel.org" , "suzuki.poulose@arm.com" , "Szabolcs.Nagy@arm.com" , "musl@lists.openwall.com" , "linux-fsdevel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "kvmarm@lists.linux.dev" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "catalin.marinas@arm.com" , "oliver.upton@linux.dev" , "palmer@dabbelt.com" , "debug@rivosinc.com" , "aou@eecs.berkeley.edu" , "shuah@kernel.org" , "arnd@arndb.de" , "maz@kernel.org" , "oleg@redhat.com" , "fweimer@redhat.com" , "keescook@chromium.org" , "james.morse@arm.com" , "ebiederm@xmission.com" , "will@kernel.org" , "brauner@kernel.org" , "hjl.tools@gmail.com" , "linux-kselftest@vger.kernel.org" , "paul.walmsley@sifive.com" , "ardb@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mm@kvack.org" , "thiago.bauermann@linaro.org" , "akpm@linux-foundation.org" , "sorear@fastmail.com" , "linux-doc@vger.kernel.org" Subject: Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace Message-ID: <4a3809e8-61b2-4341-a868-292ba6e64e8a@sirena.org.uk> References: <20240203-arm64-gcs-v8-0-c9fec77673ef@kernel.org> <22a53b78-10d7-4a5a-a01e-b2f3a8c22e94@app.fastmail.com> <4c7bdf8fde9cc45174f10b9221fa58ffb450b755.camel@intel.com> <20240220185714.GO4163@brightrain.aerifal.cx> <9fc9c45ff6e14df80ad023e66ff7a978bd4ec91c.camel@intel.com> <20240220235415.GP4163@brightrain.aerifal.cx> <20240221012736.GQ4163@brightrain.aerifal.cx> <20240221145800.GR4163@brightrain.aerifal.cx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SXzKVr6cSzokmvVK" Content-Disposition: inline In-Reply-To: <20240221145800.GR4163@brightrain.aerifal.cx> X-Cookie: The second best policy is dishonesty. --SXzKVr6cSzokmvVK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 21, 2024 at 09:58:01AM -0500, dalias@libc.org wrote: > On Wed, Feb 21, 2024 at 01:53:10PM +0000, Mark Brown wrote: > > On Tue, Feb 20, 2024 at 08:27:37PM -0500, dalias@libc.org wrote: > > > On Wed, Feb 21, 2024 at 12:35:48AM +0000, Edgecombe, Rick P wrote: > > > > (INCSSP, RSTORSSP, etc). These are a collection of instructions that > > > > allow limited control of the SSP. When shadow stack gets disabled, > > > > these suddenly turn into #UD generating instructions. So any other > > > > threads executing those instructions when shadow stack got disabled > > > > would be in for a nasty surprise. > > > This is the kernel's problem if that's happening. It should be > > > trapping these and returning immediately like a NOP if shadow stack > > > has been disabled, not generating SIGILL. > > I'm not sure that's going to work out well, all it takes is some code > > that's looking at the shadow stack and expecting something to happen as > > a result of the instructions it's executing and we run into trouble. A > I said NOP but there's no reason it strictly needs to be a NOP. It > could instead do something reasonable to convey the state of racing > with shadow stack being disabled. This feels like it's getting complicated and I fear it may be an uphill struggle to get such code merged, at least for arm64. My instinct is that it's going to be much more robust and generally tractable to let things run to some suitable synchronisation point and then disable there, but if we're going to do that then userspace can hopefully arrange to do the disabling itself through the standard disable interface anyway. Presumably it'll want to notice things being disabled at some point anyway? TBH that's been how all the prior proposals for process wide disable I've seen were done. --SXzKVr6cSzokmvVK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmXWNIwACgkQJNaLcl1U h9CDBQf/b2osUy8IL9ugqihJXvxZdZ2gjHyphrXKAEbbUT4oT2dVS/P4nlvlYurY 9IML2O8yTSshh0R+WaZCQ28PqhVENeRSLmgsuSIDiSrLY66okGApL4XVaAWAek2d KvQ3CU5OkGfGONdHJpiaDdcQbFBuEvUq258Kv+jUJnTKUnmFIjGeM1SIZzQMbrUH 6cXrpAA0Pqc5yrwYFzYxky0ZScQRgr1RQMV43e7IbCtfGnFfbvevfzgWwzZINjf9 kjz8RcfyhXuAoW1sAaXsPz49nL0NGr4l5riEdr3SmDYyvhJ5LEpDnFtANzD4lD3E cZMNKqJyog/SgaLaqh6dMTlV5Qd9gw== =pmML -----END PGP SIGNATURE----- --SXzKVr6cSzokmvVK--