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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3454C5478A for ; Wed, 21 Feb 2024 17:36:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D3D06B0080; Wed, 21 Feb 2024 12:36:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AA5C6B0081; Wed, 21 Feb 2024 12:36:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34B576B0082; Wed, 21 Feb 2024 12:36:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 23ACE6B0080 for ; Wed, 21 Feb 2024 12:36:27 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B78C01C0B09 for ; Wed, 21 Feb 2024 17:36:26 +0000 (UTC) X-FDA: 81816515172.21.69D617D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 110E04002C for ; Wed, 21 Feb 2024 17:36:24 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=O12n148t; spf=pass (imf27.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708536985; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PMjL3AbjIoy3EBiG5m8OQIk8cqZjIuewJUJPyjduMOA=; b=4V5MlHU+iNO8wgaSphBZ4QecrlXcLj3WYFcfEVhavIRWyT+zFkChXPjKlrS43wmyRrrfgf e/82SJ0EsYUxolbgAD4KWLJxQEsgL9K94pzgxgJ39tb4O7jSoEQ7yPquwZJid19MwWcXKy BqlG7+zOkm4KIya7y+PDRWupTyDEH3c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708536985; a=rsa-sha256; cv=none; b=xs54+b3+5hBRvGuF01mTp+stt8qXQzlPeysvMahnPIc0ND9Wo1LlR0bCd1T3bk/SGIss6Y T09Rh+pfxHEXlp/g+R9kIWRsshWzA7pWMyROPiajO3UpS6KpLrRcini1eS3lzZzs/EsOBG IU04SqGa8HMto9Bg1P+JIqrg2O6GwWo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=O12n148t; spf=pass (imf27.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E04F161587; Wed, 21 Feb 2024 17:36:23 +0000 (UTC) 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> 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. X-Rspamd-Queue-Id: 110E04002C X-Rspam-User: X-Stat-Signature: r3fnxj35knwd9sa5csdkmt4pnbztkd1k X-Rspamd-Server: rspam03 X-HE-Tag: 1708536984-181540 X-HE-Meta: U2FsdGVkX181K5tu1xEYiVaWC4Uaz4MV0vPqo/iVRlJJlr+D1ob+QYkGINxkJ1Y2ed2P+q2n7bviCJwOUxd7hbhZQeOdxqLIMib3O/jfPX/CXhF5yrWiuuG9Z2e2MnxIYx6asWCxnizZRfN8DFS/eVbZWweZ4e1ijdmJ547mhT3DJBOiEG0zpbf+GdRa3/yGu2Huc2TwKtKM7TqGKzx954GJp8SWo0ALTwJaCFXCQZ8MktVH0VC/9nCnuq3KES7CBcErkT2y1tOomNCPJd4L0LbWDDz3QzU0lIe0fkGDA+vYJMagpxCM8AlzyZyJxUtcd5XnfG/ultGzukwLIHCNsRYOWgKQSoe4VXTSX8P9lhlp+VcWvoy6QDHOF3yhLSw4ZMxY1IrPlGu9+LxxcPnbgNZDq9PCp3SZ5jxet2xDRW27C5JwkjpVjQy6oIkq3w+bkOv/GhawCH2w2MiZKSVXlyEnxTHxoxuN4AHj3C6OPY32awqq+apgWhE3GSdkzdBsguSkJBnuGclowALBazAaZWZjqAxTYdTRcXj7wMftyfBLm66E5P0m/QFtKZxOfRSu4w7QRJl0IyhUMIyjzowuQzalsaO9KbowUHnK62ZK7uCDF/kcTav5W6gRJ6XIuhn4v84WsEB/EBGIdeeOiT8YQf3Ug8033k+hHe8Pr9KMpbwkZcbythjAC+s8CrSPeEfS7ssIe3oGpMJL5JDCzKjmZbi/KRNtArkzL730ffvtCcdmF2vFMWkbjGI2KC2n+Q+gpp7LWTRX+daNFCZh03phxDhDo3CAwal1+dOZThL6eXhP63ow9+zW6Y47hmssDs2CmYlo35Ro9JMqHrDH/8Ei6kqSfwvGJNtJpQcJ+C5OfeBU8/aMz/umg8rLC43G4oKcw3RzmHOcSHX6gd/R1gCAb5UtsLN78eTM/YyX0ePx/z3Dj6IL0zuQy2rxR8N2ycieg3/XgB3mp0/Xu1hB5C3 knbT8jyd CNSvJvaBFLkeABgmBsLDWV+PiXNlAq+ZUdVQFYH/Zto/aZc7Ry422h+mfzg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --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--