Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1841299rdb; Sun, 4 Feb 2024 03:57:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLg8c6LEVmORxJbnoVxHUHlz1j9PgoQI+vNr/nSkF3LVR80Bjt/04TlJf4daEJTiqZvfzo X-Received: by 2002:a05:6a00:ccb:b0:6df:e229:8f16 with SMTP id b11-20020a056a000ccb00b006dfe2298f16mr12912840pfv.17.1707047831669; Sun, 04 Feb 2024 03:57:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707047831; cv=pass; d=google.com; s=arc-20160816; b=YRXUTemki4nnSfEcW9OBa+UjzE+HIG9XR3nfPAKOVAn/TgIloZXjTp3TM8DePS+mzM ZbYGVOCCch5CALyWsSAy6ch1GEQcfXyNwE2rwZ1yhvID+vVrgcBn96BdodcY/WSLs3mm WlNUjsPo+S4iWjEQl1SuxeSUMQmycpldvbyuM6PH+3ykWwthdLU78fvSqPSw9kod7vRp t5dEw0a8t3BC6kk0F7B/XfJEBGlHIbHQP6gJsJ/dy4k7BIMDDRnpgpaihLg0Yyq9GHBf juqL7ARnEl9y8KVHkVgqLAFhes0LmWiUIDbOksRsLwG1mfZ+ITK6FhRzrPS1E6UwVZWt KUNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GU0sTNkjSddR8xfGDr+jDeLQsSuK3Gocdh9Oj+Mn96Q=; fh=A15wFIEY/ERgeTriXRYThSjg9j77OBuvk5kaLA6a13Y=; b=BNxOFdof2NUXi2dXtueoZFzFdBRjBIANZ8CgiInL6lCrx+whFD6WEvVw0JBTbKR5ep NnVgsf0/KHEGYVxBgeI7mUtcDJDc0sC1pIpr1uMhTsO0/YKMpsOtFgHFe0vVM7CG9W2S FRgG0HUbNSr1cFQ/VxUAllTatKQO0esHGdLt7YuIrc+3iMwewrkBEbkBDqjdUUxkPYRY gVZQj/FtTPeO3HjNYAeDPo0h4dn8FXJ4Z2UJmLBzwptRcW9SbA524lSyijXNw3yOG/J5 +Y+jlaZZPXfnwM7+bmOpHO1tfZ4Q/FFyLPf8I1Jte0UWnVg6PYVTEtqMQbtaHzzGTFU5 95tQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZY/WEtGX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVGAS+VKTOADNQy7oqVA37zVo+ZhjW14HaKEVbnJe9C5IM+TbUqSm3VVosJMgV0iyEcTqSaITWgZBJzBRAJIOvk9Y8q2XI2YVuyYAGIow== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c19-20020a631c13000000b005d8c2dc7127si4450737pgc.325.2024.02.04.03.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 03:57:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZY/WEtGX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AF965B21816 for ; Sun, 4 Feb 2024 11:57:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 988EE22309; Sun, 4 Feb 2024 11:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZY/WEtGX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4DE82208E; Sun, 4 Feb 2024 11:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707047817; cv=none; b=fHiWY+7b7Zs3RikbUbtlAo13XXvfMXvXN4mr4DQxEQ/ezvfzQacm2U6420PLiV+rL9vxDVS2+41x6FprIBQGMHZx6RypxuxiVfKP81L/k9PJI/ZWoX15+YJqsJe/5LlNk9PJEJJv3Xh0f4yFUTp0xuIEhSKtXBD6d+H5K4PbnuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707047817; c=relaxed/simple; bh=4MfqGCuyTV/WsAyZLhKLgr6v3KIUjtNQFKaYShJa5D0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FNlJLv5n50kKawFOK7kyT90GGb2KKqwavivynQhPtFlcmR4wL7aR0Gy7quMBSh77wlFuHIVPcr3RsNVidqDin+dIvt6YNLmgKZqeFp0nvo/3IMdwR5xkJ5e/HRW0VaX3CHab9uCwecG4oLm6AkBoiIo68RW+g3yttKAY6ZSPLAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZY/WEtGX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DE05C433C7; Sun, 4 Feb 2024 11:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707047817; bh=4MfqGCuyTV/WsAyZLhKLgr6v3KIUjtNQFKaYShJa5D0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZY/WEtGXriFjgcbMxABWAI4nFRroyGqI2w96wGZ9ydXf9+uL8mdZqzi+dGzo4Lf9A bQTQ7bhibCdYAIAU9P2v7NgeMdVO2JwRrFhz1EBhCZUkivhQ9ale4dK+SQyCpL9ltY vR1mZgXbXe+c3RC+Ef75Wj5FDvuvJPWzVIoPSwilsDgWUUgAw1PPqmbAFE2GJZaVjR PP958f8YXAXj91IZo569uUsbJsm+M2tLGiEKOfBTSY1pvkOSxezO/kp6V8/0P83l5H bue5JvBedmel6vfTkGxy4W5d7RMgyQqSAvKOxlpcl9IC1nTWZ+O5BlMlkpjEXbZ/bW gwK2DWtg278SA== Date: Sun, 4 Feb 2024 12:56:41 +0100 From: Mike Rapoport To: Mark Brown Cc: "Rick P. Edgecombe" , Deepak Gupta , Szabolcs Nagy , "H.J. Lu" , Florian Weimer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Christian Brauner , Shuah Khan , linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Kees Cook , jannh@google.com, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH RFT v3 1/5] mm: Introduce ARCH_HAS_USER_SHADOW_STACK Message-ID: References: <20231120-clone3-shadow-stack-v3-0-a7b8ed3e2acc@kernel.org> <20231120-clone3-shadow-stack-v3-1-a7b8ed3e2acc@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120-clone3-shadow-stack-v3-1-a7b8ed3e2acc@kernel.org> On Mon, Nov 20, 2023 at 11:54:29PM +0000, Mark Brown wrote: > Since multiple architectures have support for shadow stacks and we need to > select support for this feature in several places in the generic code > provide a generic config option that the architectures can select. > > Suggested-by: David Hildenbrand > Acked-by: David Hildenbrand > Signed-off-by: Mark Brown > --- > arch/x86/Kconfig | 1 + > fs/proc/task_mmu.c | 2 +- > include/linux/mm.h | 2 +- > mm/Kconfig | 6 ++++++ > 4 files changed, 9 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 3762f41bb092..14b7703a9a2b 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -1952,6 +1952,7 @@ config X86_USER_SHADOW_STACK > depends on AS_WRUSS > depends on X86_64 > select ARCH_USES_HIGH_VMA_FLAGS > + select ARCH_HAS_USER_SHADOW_STACK > select X86_CET > help > Shadow stack protection is a hardware feature that detects function > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index ef2eb12906da..f0a904aeee8e 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -699,7 +699,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) > #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR > [ilog2(VM_UFFD_MINOR)] = "ui", > #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ > -#ifdef CONFIG_X86_USER_SHADOW_STACK > +#ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK > [ilog2(VM_SHADOW_STACK)] = "ss", > #endif > }; > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 418d26608ece..10462f354614 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -341,7 +341,7 @@ extern unsigned int kobjsize(const void *objp); > #endif > #endif /* CONFIG_ARCH_HAS_PKEYS */ > > -#ifdef CONFIG_X86_USER_SHADOW_STACK > +#ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK > /* > * VM_SHADOW_STACK should not be set with VM_SHARED because of lack of > * support core mm. > diff --git a/mm/Kconfig b/mm/Kconfig > index 89971a894b60..6713bb3b0b48 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -1270,6 +1270,12 @@ config LOCK_MM_AND_FIND_VMA > bool > depends on !STACK_GROWSUP > > +config ARCH_HAS_USER_SHADOW_STACK > + bool > + help > + The architecture has hardware support for userspace shadow call > + stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss). The whitespace looks suspicious, I think there should be a leading tab. Otherwise Reviewed-by: Mike Rapoport (IBM) > + > source "mm/damon/Kconfig" > > endmenu > > -- > 2.30.2 > -- Sincerely yours, Mike.