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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59B29C3DA7F for ; Thu, 15 Aug 2024 10:45:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=htvDFLr6IbGsuAmBAkByyu9KBbpd/W0aTtd1ouB5scE=; b=zF57Ck6aG3a/l8J4CjaxN5/dkb QGqyrGy6UnvUCyKVH9/QypU1LMu+VjRqPcSMaeMSba77lCqJ0waxfPG0bdPR/8lLnlfUG7JZoseRV W5Ai+489CpYKYqwLKgAIXKV0UvUFQl79Gzi9ni1nFrIrpx2IcnZ/CWQzN8b9bS1ei0I1/GHkL/bjD ktzFsMcicO6iBZkle1yvZ6PwUiWEbELV3C7RnhNuLFkoN14lBsHzhfKHnXMr1Cmfb358PDpQAKmDH ZhNPzDwJV+zrzPedPHqZdSEPle6MGgBFdCRU9L6Z0SWZn4EMO+qmffaA4EM3+bTsWJCx+6pEXfZ5D uMEiuRXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seXyq-00000009gCB-3htg; Thu, 15 Aug 2024 10:45:20 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seXwC-00000009fEO-3jjK; Thu, 15 Aug 2024 10:42:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B843461DE5; Thu, 15 Aug 2024 10:42:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36C1AC32786; Thu, 15 Aug 2024 10:42:30 +0000 (UTC) Date: Thu, 15 Aug 2024 11:42:28 +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 , 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 v10 02/40] prctl: arch-agnostic prctl for shadow stack Message-ID: References: <20240801-arm64-gcs-v10-0-699e2bd2190b@kernel.org> <20240801-arm64-gcs-v10-2-699e2bd2190b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240801-arm64-gcs-v10-2-699e2bd2190b@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240815_034237_106806_AFBE8DA4 X-CRM114-Status: GOOD ( 18.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 01, 2024 at 01:06:29PM +0100, Mark Brown wrote: > Three architectures (x86, aarch64, riscv) have announced support for > shadow stacks with fairly similar functionality. While x86 is using > arch_prctl() to control the functionality neither arm64 nor riscv uses > that interface so this patch adds arch-agnostic prctl() support to > get and set status of shadow stacks and lock the current configuation to > prevent further changes, with support for turning on and off individual > subfeatures so applications can limit their exposure to features that > they do not need. The features are: > > - PR_SHADOW_STACK_ENABLE: Tracking and enforcement of shadow stacks, > including allocation of a shadow stack if one is not already > allocated. > - PR_SHADOW_STACK_WRITE: Writes to specific addresses in the shadow > stack. > - PR_SHADOW_STACK_PUSH: Push additional values onto the shadow stack. > > These features are expected to be inherited by new threads and cleared > on exec(), unknown features should be rejected for enable but accepted > for locking (in order to allow for future proofing). > > This is based on a patch originally written by Deepak Gupta but modified > fairly heavily, support for indirect landing pads is removed, additional > modes added and the locking interface reworked. The set status prctl() > is also reworked to just set flags, if setting/reading the shadow stack > pointer is required this could be a separate prctl. > > Reviewed-by: Thiago Jung Bauermann > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas