Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5975635rwb; Tue, 1 Aug 2023 10:22:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlGqlmKih2iJfpeWCWNdYamYyj4h4TSA5/fJmsp/IYDv7UvH/caeL+gxrpcJ+Pc8YfScBl8W X-Received: by 2002:a05:6a20:2c98:b0:133:dc0a:37e7 with SMTP id g24-20020a056a202c9800b00133dc0a37e7mr10680745pzj.13.1690910536402; Tue, 01 Aug 2023 10:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690910536; cv=none; d=google.com; s=arc-20160816; b=qNb5c/NlfaPIkjaJoXwgHVeSznkdCJ6pNIO9Te8ngCYODj+moMDLMEhO+MfhQA65c4 8jOSKrc9uQG4pvnwnX7wx/RbAGShJGmxSdozT0uvCAbpyaIMo52vFv7fXhUKksdo6l8c 9GT+7ZoK9k9OQYRImVBAQBP7KZlIj9H3ISAcXaDH5hBlvgRkcwboKTHbLE38cDs5NBdY H0cDsGswb8etqJgSaf36mlJswNoAnFL3DtUvO4+F7Z+rKNpIASAfcLaeeRPufELADIAr 2o7wIu5rwvxVDafzjZHLzjqu88fb7IhnXawAKNBVYRnjwCcL1Px4gul8VjjpKKKec8KW 20kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GF51qDy3GiWR/nYZI9t++wsOCQB+tJwaD717HhTgEtg=; fh=ftlHRuJ5/ZArKI7a/HVutviFcs2zMDcn+5TXYZGM9pY=; b=lbrIB0zZiRSH2xP+JfeF5ef4lVSf0PJAh03Kg0Zc22vSmPqKzFnzRFjSSbfWYEcVqz 4+eFDAA6uK6uTvI59VoOIYWYURl78l8SU58McvcX9j4UFN5fB8LVmPyXZ0Yo5StNNLD4 1zbTNSg5RfnZ8fAD8YSIQIFvElPGz+sHsIUgWXwPIVrq2vKQyV/vYfoCOYZP1eqfsH64 uw/Iini2eSeRt8jSAXmwFOlSkSF5UxwC26emn1TKFxQbfcMe8lWHHEyT0KzHJW6ASdVR Uj2taFBeCme1PI0TjclceoQGMdGixhKPKTElVxWuCYagRjn6omVeXMfeV9SKMI1J2TdE OkYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BIFlmOCq; 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 l193-20020a6391ca000000b005641fc26838si1431824pge.525.2023.08.01.10.22.02; Tue, 01 Aug 2023 10:22:16 -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=BIFlmOCq; 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 S232828AbjHAQyI (ORCPT + 99 others); Tue, 1 Aug 2023 12:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbjHAQyF (ORCPT ); Tue, 1 Aug 2023 12:54:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B6E2116; Tue, 1 Aug 2023 09:54:04 -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 2C0016163D; 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731-arm64-gcs-v3-10-cddf9f980d98@kernel.org> 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,T_SCC_BODY_TEXT_LINE 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 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.