Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3549462rwb; Mon, 7 Aug 2023 15:50:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5UBL71Phj4RkFeG2VA9MOMcYfFldhKggz3vjBsrVXXhK01m1Sz73rGsT1yvc3nkIHVvid X-Received: by 2002:a05:6830:2005:b0:6b8:9a3a:ea12 with SMTP id e5-20020a056830200500b006b89a3aea12mr10265960otp.12.1691448641325; Mon, 07 Aug 2023 15:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691448641; cv=none; d=google.com; s=arc-20160816; b=BtA24/gtbiksKcnKyKoKr6JF1QF3ISAh24+Zes5eSSmlr2f4L6k/n3aQ7RXZbV+UGw 4ERUetGF54MPGcqUlcSLq3SexY8IZB7O5CJC5kTv7lLH2IMe0Sx80kFACC1pOgcQauG2 Rao1LDr2sPHhIgqv42Jb9fevkDvajAB3dgEPO/jP4xJyqblx/rlzcKmKMT2cbEP8xvwt 9CNaixRaoZafkDaH+hswZd7XhtZy4r16WXaOsD60bZ+9YWkgK2tAOVHTvZtHdq+1scu4 suC/fV77MPwj0WG3kJMi5ZsX9luEvXBHuO7zuGFCXl1jQrQAvNplMKddXVzwDExNujQM mOHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=BnTPNnb7vLdvFR5WbrJlLKVTi36UZPFC5Hk16d0IDAo=; fh=EdAFSmIgUzZTC6WCy4Jg1wBZ0/m6m2d/OjiRUJ3BsTI=; b=B9vw9GZxFLXXVvl4+mDTuqTWg6n749UOmrwxynQ9VTAOSc16r+ntGMZ/EIgrA7zEj0 EU3x+U6dFKtNS98FYEHEQ0ltKeWOD/BxI32yoCbjjwr5GMT6Z38bjarKz0o6tiJ1T35C oy6rHLLHsP9TuzBR5M3g1Rsmk/GAy9+UGLafeouzQFNavUP0cIML9viOmGca/BQUML+r qUDoddKFC0ku+O/fd+M8bHo3OVO8i9p62HZNnmbUIDhktLNn7lO5EyIzVcOrTAW75RzN JG/6Bo32UyCfl0qb+Bsq1mEoAK5tNJbzxCM/XMnP7Hd8p2mRnMFeMQX6Iq2lGzpE38Th VnTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lv9rtr+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs3-20020a632803000000b005651147ebcasi398019pgb.363.2023.08.07.15.50.28; Mon, 07 Aug 2023 15:50:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lv9rtr+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbjHGWGR (ORCPT + 99 others); Mon, 7 Aug 2023 18:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbjHGWFg (ORCPT ); Mon, 7 Aug 2023 18:05:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38CD12704; Mon, 7 Aug 2023 15:04:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1691B622B9; Mon, 7 Aug 2023 22:04:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2521C433A9; Mon, 7 Aug 2023 22:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691445848; bh=H5XnWdFwxjuGxEH72kUlpbP8cfBTQj97MLlaTYR448U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lv9rtr+EAtd7102Xa76cZT5edbG236PmmRMfJ0OVh9XSwdHdiQDhzAodKIm6h6vRL NdeHOOaW3VjKe4x6bFplgcRucirA65snxMgTKHuaMJTLv4B0DDfwkx1sMx2pSK8oO0 2aM3m10IQgkgZWX+lvnqMHISitXUCnEYUGloqvw4yCl+r+w1ulXdoB1lZkYddHbmtv q4wt3WLucdMRrSVRnCJv3xHiCrXZzxoLue+HgZiUTOaMubTpynltGWm9V39FVRVUE5 7aXA+eCbY/2l7sEIajG4DCK1yU9XH6gMDwdeTqgBTk9LL1f3LWIlsXsKiGB6G9MZo6 3gvRa5H7jjZBA== From: Mark Brown Date: Mon, 07 Aug 2023 23:00:30 +0100 Subject: [PATCH v4 25/36] arm64: Add Kconfig for Guarded Control Stack (GCS) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230807-arm64-gcs-v4-25-68cfa37f9069@kernel.org> References: <20230807-arm64-gcs-v4-0-68cfa37f9069@kernel.org> In-Reply-To: <20230807-arm64-gcs-v4-0-68cfa37f9069@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 , 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-034f2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1334; i=broonie@kernel.org; h=from:subject:message-id; bh=H5XnWdFwxjuGxEH72kUlpbP8cfBTQj97MLlaTYR448U=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBk0WmrSl4chwKr3/R3Gfif9Ncd39ArWvtZPbVutDLW JCRoW6mJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZNFpqwAKCRAk1otyXVSH0NifB/ kBQS0LE5LNfugxE9C8D8+xMQF/ddJKgmOJR6SlfCJAWbTlPEYUJ2WICFiC5P5ZO7Mu0dMk1v+UlHnk 9CpuDpHJq6MISRR5/Q5wcBY/wv/canyD6S+BWS4sQGiuaqOtLiSqAPiaVOupwy50mVhdQsVo2WvHNg WhgUOF97GkPLzxHTQK/EE3e6694K4HF1KKPETwaR1mKg+cIH1kH3150ck6WmZqVUnKF0QBoes5+WSU f3ejEjNWL3ipnUAM0lvk/Oqbz0RiBsbjxunbVG8LubCbWLB+aDglDoTZUO7tXlGyOLIAfhDD7FSa6t yF2AdyawCHd1h5vjTc1KFjQp6WZaLh X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a2511b30d0f6..b5ef1a698770 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2093,6 +2093,25 @@ 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_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 -- 2.30.2