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 28CB2C5320E for ; Sun, 25 Aug 2024 17:56:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E91B8D0015; Sun, 25 Aug 2024 13:56:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 864508D0016; Sun, 25 Aug 2024 13:56:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 699EE8D0015; Sun, 25 Aug 2024 13:56:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4B8278D0012 for ; Sun, 25 Aug 2024 13:56:49 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB319120798 for ; Sun, 25 Aug 2024 17:56:48 +0000 (UTC) X-FDA: 82491523296.03.C5A20C1 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf30.hostedemail.com (Postfix) with ESMTP id 6B42F80004 for ; Sun, 25 Aug 2024 17:56:47 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf30.hostedemail.com: domain of cmarinas@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724608545; a=rsa-sha256; cv=none; b=KcLYo6ma2+wAbdlPD5G2urf62k/JbI0yCkU8E81IVSTG97msNoT8SKMphoL5zrSOhEvYxe qvDzHphYXMCPx3JnAnA0cPBO3TXsK198NR/7B0PcEs8a4vS7EF8DFIElPZrwTs4tFRHBoZ E1f34mPZq+8FGrxfUgXrsJXxGh0iKHk= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf30.hostedemail.com: domain of cmarinas@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724608545; 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; bh=ibPOTwgg/Z4pmQA9vlGECC5um2krnKdHAhwkgDhcNU8=; b=qifsM3YH8CMSbrTYrpCDHFkz4mRjTi0+M2wmMD6dYLKdfOKaderrXBtxewXuPV7QW1o0+U OvO+p9qUfyTMxZ/oG4ltvzwZ6WXowfITYTc4cm0nPySek+MHffvPPAP0gAwAHN3UsiSG5+ 8hsrdTba5BZeegsVaXeTXsXiAIaOras= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 74FB1A42641; Fri, 23 Aug 2024 09:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6993C32786; Fri, 23 Aug 2024 09:48:49 +0000 (UTC) Date: Fri, 23 Aug 2024 10:48:47 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , Kees Cook , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , Ross Burton , Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v11 27/39] arm64: Add Kconfig for Guarded Control Stack (GCS) Message-ID: References: <20240822-arm64-gcs-v11-0-41b81947ecb5@kernel.org> <20240822-arm64-gcs-v11-27-41b81947ecb5@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240822-arm64-gcs-v11-27-41b81947ecb5@kernel.org> X-Rspamd-Queue-Id: 6B42F80004 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ygu1e7g6twtrqrr7hxp8b8tes1ugezha X-HE-Tag: 1724608607-119564 X-HE-Meta: U2FsdGVkX18GVZ1Rgn1448s0HZLONiGBgYr7MzDP6KVQugZDM9PbSn7NK2BJUl7YlzJTz2fBbzFO8Gpu8Um4W+w+8WQRti9ohuzpnB6WvL6P7o+V3mVYJh/NVakXuUP/mOBHsmeyFypPlB2yftf1UhFl+jtp5eSIfSTWw/HLzOQtS/IT3t63ReszPFODmen3Qw78NoDGtM+zVTpoN+gyIvovnk8Th3P2ToLjR7faIrI8idlWypInikiQT/LL+ujzwFXiM6LCK0nd/7j6VR+iBd0pcZg7lhw/TE4P+aZe682+FwUUoRbEqEAdbTWetE14/LKCH03MZKsebqARsTbzWABBANuYIsySl0pL9xDr3UnaIcNmYJCcQFrVrvzx71lVgt6bFeT6u9JEQPzCYjJAtg8eFoe0LdblvEojQfp1WDgFW3wYeiWkbMdmCLOFqeuAZvfEDv7J6zvjJigNgWhlK4gXgoZTUF+UK5hZxGL+ksuiyu5mtMsoIoa6jmknblvT9jmb82SJRyB3MnUv50fWGPuY2YACcws0xw8P3VS4khuJOj1rBzDyZoDrUx4tS2P/yRe8O+y3Ibv7tDBZUDlXbAvCAW3In5A0BI4StN1tvc6vd6gz0vti/wlSMsgGyK8x+vSu3CUKuoKGrDt4i1vueSuZdKP78Jbunlw0TX0+V9BMenz27lIz9zXvr9PXBHpQHIDRJuKaqZYK0YevQZ+mwEtrHCVetnHJQ/D07/lkomB4ePHxWDCxXvwkcTCDjLs3eTLHhJJsET5XtDAI+1aKW89y5DaIerTbx7UcUOZKs+R9pCMiEblJWN7TkcogTh7reDOPkUkxkfOdgl5bk1j1pRn9vyf+8keuRzG/XAI7fCMDK3aaRWIqjWBwlEne7jeoJFZDcg+xh0J5Flp33n3zY4YLiZsMRbjxoUIye82UCSJHrl1xKb+F10hmxkbDf5JyqUbx6jwXjO5tGUcwK6Q dxgFjRjj YzQn3d2J8+ty5lyoR0rdoo0piDKJUR9jdxDMegzS0Ht8BaXaTLI9yZnOeGpfrMSJG9tvQ/iGqx2m/sGqzgDIecHNm9HDmHKLJcfPbP6PwxPSzSC+yGgV3GjuC2CDyio0IHptKbOZJqAeeqzFk/gVLAxmjKdvFvk+ErseCbp1ZKnH4Emc68o/ZQ8B8tgwLzus/B55KCBNrjsXWqIT+6erVFgAyupvBZY07CrI/MPb1M/FlY1JI2WK45h9COjQJEmxiNiOjkJ4U2/+a5yGLGzRzMBltbfJTDCOnQyFl4qQd48vWdunucUkwqMiu2oCj7W7mLTGYPRpy//ngMzwiN5O4TZRUQUITXGZrex688LFmxFdOs76cJx2V2tZBJeb0Ueol4qEP16kGix6tEIdHftxuUXf0RDO6FHLUdGLqaf+FBpctXvoUq+omrIyfnsrw4LDh1OY6Uf6ncDzRNcU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Aug 22, 2024 at 02:15:30AM +0100, Mark Brown wrote: > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index a2f8ff354ca6..772f9ba99fe8 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2137,6 +2137,26 @@ config ARM64_EPAN > if the cpu does not implement the feature. > endmenu # "ARMv8.7 architectural features" > > +menu "v9.4 architectural features" > + > +config ARM64_GCS > + bool "Enable support for Guarded Control Stack (GCS)" > + default y > + select ARCH_HAS_USER_SHADOW_STACK > + select ARCH_USES_HIGH_VMA_FLAGS > + help > + Guarded Control Stack (GCS) provides support for a separate > + stack with restricted access which contains only return > + addresses. This can be used to harden against some attacks > + by comparing return address used by the program with what is > + stored in the GCS, and may also be used to efficiently obtain > + the call stack for applications such as profiling. > + > + The feature is detected at runtime, and will remain disabled > + if the system does not implement the feature. > + > +endmenu # "v9.4 architectural features" BTW, as Mark R spotted we'd also need to handle uprobes. Since that's off in defconfig, I think it can be done separately on top of this series. In the meantime, we could make this dependent on !UPROBES. -- Catalin