From patchwork Wed Nov 22 09:42:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13464421 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 20EBEC61D9B for ; Wed, 22 Nov 2023 09:46:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B211A6B05C0; Wed, 22 Nov 2023 04:46:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACFF86B05C1; Wed, 22 Nov 2023 04:46:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9710D6B05C2; Wed, 22 Nov 2023 04:46:28 -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 860BB6B05C0 for ; Wed, 22 Nov 2023 04:46:28 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6DAA9B58C8 for ; Wed, 22 Nov 2023 09:46:28 +0000 (UTC) X-FDA: 81485110056.22.AE70695 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf10.hostedemail.com (Postfix) with ESMTP id F044CC0008 for ; Wed, 22 Nov 2023 09:46:25 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="ZNt/mhOl"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700646386; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fzbo3KR4MOr1ZmKxTJQohTxFt954ex0BmbuXA1ZQ+UM=; b=tCG9Kjc9jpLEoOqFbq38EnXWZBXwVRiQc8tpwxzwMTVw6TdEXbWffhgdLnAoFpJRLwRLdj ZiEKjWzCfoqHqlel3NQZeguCTJ03Bs6eKJDO3Lq/dqmHNgT1dVtiaauuov+SPyWwNZzOCJ 2hV4lp3ED7d0IPyJUp16McEdQCoCG64= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="ZNt/mhOl"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700646386; a=rsa-sha256; cv=none; b=HWkRrEQvGJdjFznKbwcxqirFOqmnIDk3R4nOWZ85VvetR3id7HO2BXPP5SR99rFnn8HkhZ dQLXD9AukFG6/6NmU7DcSOiI+feJ9Er/jjwyGxufl7MTixonBbUijI3LxTVuboJisiypoQ NR8OFeUCRMLdryW3yE0oAtMvDF48P7c= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 7A13ECE1EC1; Wed, 22 Nov 2023 09:46:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 866E8C43395; Wed, 22 Nov 2023 09:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700646383; bh=0y6nS2SVdzl2qxV5TcDCnpKi8YQvhWLC/gR5WsuQggw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZNt/mhOldQGyAGrFdcd7zCoYi9c4Cpbfl611N1nCbvre1FYvH7Zl1qxYMHlLUXK/R oTr4pGgCl3ZqkdfLg9vxV823aJQE0eCLlAhRLaW1gT0pmdwjk38uP6NXqfphyDxggd Nce0uiHdxAcfp2N1Y9laenaA7HV7sOUFODNyqrBMy7XcrOzKnRNQTKmHrYboi3WFf4 QOpE3cQlVvo2KE6NieOOuSEronhIGHfX5fucm1ZO0NVH0NxleNUmMK8+wdtaJLpRNh bN4Wz6vhiC+V3XP1enBFhlP/PZm5aE6IiSJnXGkBC62BqC2W7W+tQNNElkgCPc4NEY Pt1AESbQWlpmQ== From: Mark Brown Date: Wed, 22 Nov 2023 09:42:37 +0000 Subject: [PATCH v7 27/39] arm64: Add Kconfig for Guarded Control Stack (GCS) MIME-Version: 1.0 Message-Id: <20231122-arm64-gcs-v7-27-201c483bd775@kernel.org> References: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> In-Reply-To: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> To: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy Cc: "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , 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, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=1372; i=broonie@kernel.org; h=from:subject:message-id; bh=0y6nS2SVdzl2qxV5TcDCnpKi8YQvhWLC/gR5WsuQggw=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlXc0LjTRQMrZZBOJgPLB48tbG4uiml7CZIDEV5 uQD798eCNqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZV3NCwAKCRAk1otyXVSH 0Iq3B/9HlE8pfPFk2nuyqu1U5wC2TDnfo30tlZoqa72rjxWoZMeOZIt03d7ifiDGT60BAhV7DR/ X2q4ijl0gxsqAdoQTECIT09I17i0jhkg4sOrFnUM9S88Dc3B+OIQORdu8k6AozeCurJMkcd/ICY snWt5N0Nh2ox8T7U6IwsCVSrOZfctm8ylWDVAVHxsy53/DBhuI0FtT+rlbYGseRcYj1zRLPXpf+ BVttx7Ntz2AelFYWVTuV1+GEKIwFIHMxKR/QSrU8uS9CzItwTUAOZKN30cLz7YqjsJMsYAnSVKN Bd8Eqt+f6s9NrIoUWZmOF8FfRH4sNLQwPl0XXWRCxkdsmJNx X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Queue-Id: F044CC0008 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ueyjxseag5sqf1q9jsuctfnhr3ajyjoz X-HE-Tag: 1700646385-814049 X-HE-Meta: U2FsdGVkX1/bFgP7PMjxOnINBdPCiMelg6pQyfSGPmtgCMnxKhboRIrWkUknxnduMXqGvZ/bdf60LdATTC604NvDEKWX2voaeq6ogICcCnMVWEpocVe9TNkLaO3WmOaDmPdBXml9Zutm0EAsiGf2t3HjNNJfcdw+ft3iW09Ai10GcVvRC3szdu3G3t0X9rUtq+RD3etM8/3p6YxufSSsj2FrFF44UWIrJZmuTycjUvfpOd8TGOb25N3oeOnug+9B+oeIax61/8tgDmo0sfB/fldnFZZSTSAVghTOo/uQZ92ufeLkh1zOUPMmPlXwsmtJ9PjMuCTXFAQdoEGDkHxT3XacVDB3QBP0KPq0QYkGlR5JY15Lh4c7X5VsEhwch0tQDWr8Tx4czS7yuiFW3cr6ioy8fi7+iPU66mpAg+pmQhg0drPM19dmZ7fl7TaGspOmlkLmSEfHn9BCFv/0lRA5ILKErQ/5RPR+QOvmQHbwNRiAq3VuA3dP3qqhof1MbfR1IU5/llVNl9LGTbkn69iHbrDjrMOhflE3qyS4Pjm7keOLxcIft9CmIpeAbcY0Cb7gXayiVKU+pdJ1QefvxQTIBvGzsr6TJ55HlFsTY62vVY6m5FVUp97k09CkbwbRG2RO2TgvzcRGCExETEwEnMYUX4nMlsRJP4tLJcicZb20LTTOQnaR20o12zY1Atgr+y6uhDrGkYm+40N6G6fSFzKocIPn/pcj3X+l9KGWCZuJf64mHFf53QRjzwshLF7bEjsctM3dxYOWfNjboWsLnzyHqx6B7fi7ZCfOfpSyWnoQ++z6YO9YpQFH8WpTi85wT9R4A/TG7UagmjewE0vS757RBW90gi5nzNp3DD/Iceb4k8Bqn5zYfSdy+Gl3xfdy67dRXxa55V8bUbe7wk+9Ht2DblrnCW95P3Xj2R+8fvKkzDUDzKGfXjSBrgCQ4tjpgfHDvLIgbSiPtWacuA4/ieV 8pk77+mc +pHjJ9px+0eOcPezF5TuUHEw5Nw5PytKFKxVk6hAfWiRL+77trAq/urALs03sk0x0ejHq0UrabOZuOdV5TDfoHhiTd2vJJiwKdwGJmCYQCeeFdfK1HcRACU6tFSQ6Q76f3/tXeeMPaYJzEtS7OoB5BBTr3LvP7HJqu8FTgAxE/lzAWaW6undtpMEA35iCcwOx8zSG4BFGlJ+54ZXrT3Df5xVPQsLuQMjnEdX31Gu4KY7xEgwdrnyPPxf9vvLv7ajc5KqUxfWAF/sK3xoJeWhIafom2IijE7kZGU76eWRhzd0eAq9tcsktOjhfH+KEf5jE6jb1 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: Provide a Kconfig option allowing the user to select if GCS support is built into the kernel. Signed-off-by: Mark Brown --- arch/arm64/Kconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7b071a00425d..05cffc0f5786 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2078,6 +2078,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" + config ARM64_SVE bool "ARM Scalable Vector Extension support" default y