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 B17DAC001DF for ; Tue, 1 Aug 2023 16:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y4Ub1gsQy8m/MvPXGWyAqPuFve5N1trmRos6PE8fpRM=; b=zCIkrRlWf+jzxM +kwHiCZZIPdpF4u3PkASnPjeNdCklFrsnDTyE768dd+OXld48RBhung5hB+woxy1u++2m6INIiMx9 Unh7SPOyVmcHxo/Yn29K+FGEg/ZaerXwbQ8ONvwiApS/UZzm3+fGxg8DRWTWMUb2cgmFXRjp4l1Jp zhZop+GO3bbwpPVtgsMk1JTs+qp7AOV3VL/twf4lS+zrVu0HW/IPAg2TRmCtYamYjTkEDppzZJO85 FCJmClwm8FbEh9y7mCzlb9/3CodCZRGFvrn2lZ7Vs0jHl02mMKAKxtn0K2Frmq1HMaQjOtZdqznIv JPtNdP149IoUtPM6Zo4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQsdL-002quJ-1k; Tue, 01 Aug 2023 16:54:07 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQsdI-002qtU-2a; Tue, 01 Aug 2023 16:54:06 +0000 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 2756E61638; Tue, 1 Aug 2023 16:54:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE3C1C433C7; Tue, 1 Aug 2023 16:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690908843; bh=liMpSScDu0h+PrjpmqiYb+Q+6aHOwyISw4j8BFIcGVw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BIFlmOCqJS8iQcXvk8oNZxNGz4QNLszdREetAXo8Uo+jxPN2dAxboF2ywOt+r6sF4 1Ce2+7VJBYSGs32seKXUp9myi6IuJy6hA4JORLtRMmgg1V/NnkE6s5/mCkx/yY5eSx hJeilqNSHkRQUd3TgjbR5C3RqdbDv1v8l8q/HRJ5d4R42KAnIGAb5tXRn9g5WJ8qqo mDEv5+Zw5cXJgVkudwVKqN6SYARTjqDZCN6holglfEyaqBXFe9dSofXvT6coPEOgpA xj+s68tMRVaVcMe1Q2cVhtEHL+1/z/BwX05ZAZfo29BBJ2ZA0XJP5VyrA4HxSuC/Yz troFt3trmDEBw== Date: Tue, 1 Aug 2023 19:53:12 +0300 From: Mike Rapoport To: Mark Brown Cc: 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 , "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 Subject: Re: [PATCH v3 10/36] mm: Define VM_SHADOW_STACK for arm64 when we support GCS Message-ID: <20230801165312.GB2607694@kernel.org> References: <20230731-arm64-gcs-v3-0-cddf9f980d98@kernel.org> <20230731-arm64-gcs-v3-10-cddf9f980d98@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230731-arm64-gcs-v3-10-cddf9f980d98@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_095404_923703_CD11A745 X-CRM114-Status: GOOD ( 22.32 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Jul 31, 2023 at 02:43:19PM +0100, Mark Brown wrote: > Use VM_HIGH_ARCH_5 for guarded control stack pages. > > Signed-off-by: Mark Brown > --- > Documentation/filesystems/proc.rst | 2 +- > fs/proc/task_mmu.c | 3 +++ > include/linux/mm.h | 12 +++++++++++- > 3 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > index 6ccb57089a06..086a0408a4d7 100644 > --- a/Documentation/filesystems/proc.rst > +++ b/Documentation/filesystems/proc.rst > @@ -566,7 +566,7 @@ encoded manner. The codes are the following: > mt arm64 MTE allocation tags are enabled > um userfaultfd missing tracking > uw userfaultfd wr-protect tracking > - ss shadow stack page > + ss shadow/guarded control stack page I've missed this in Rick's patches, but it's not a page but area. > == ======================================= > > Note that there is no guarantee that every flag and associated mnemonic will > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index cfab855fe7e9..e8c50848bb16 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -711,6 +711,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) > #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ > #ifdef CONFIG_X86_USER_SHADOW_STACK > [ilog2(VM_SHADOW_STACK)] = "ss", > +#endif > +#ifdef CONFIG_ARM64_GCS > + [ilog2(VM_SHADOW_STACK)] = "ss", > #endif > }; > size_t i; > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 43fe625b85aa..3f939ae212e5 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -372,7 +372,17 @@ extern unsigned int kobjsize(const void *objp); > * having a PAGE_SIZE guard gap. > */ > # define VM_SHADOW_STACK VM_HIGH_ARCH_5 > -#else > +#endif > + > +#if defined(CONFIG_ARM64_GCS) > +/* > + * arm64's Guarded Control Stack implements similar functionality and > + * has similar constraints to shadow stacks. > + */ > +# define VM_SHADOW_STACK VM_HIGH_ARCH_5 > +#endif > + > +#ifndef VM_SHADOW_STACK > # define VM_SHADOW_STACK VM_NONE > #endif > > > -- > 2.30.2 > > -- Sincerely yours, Mike. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv