From: wangfushuai <wangfushuai@baidu.com>
To: <akpm@linux-foundation.org>
Cc: <Liam.Howlett@Oracle.com>, <andrii@kernel.org>,
<broonie@kernel.org>, <catalin.marinas@arm.com>,
<christophe.leroy@csgroup.eu>, <david@redhat.com>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<osalvador@suse.de>, <wangfushuai@baidu.com>
Subject: Re: [PATCH v2] fs/proc/task_mmu: add VM_SHADOW_STACK for arm64 when support GCS
Date: Sun, 8 Jun 2025 15:35:17 +0800 [thread overview]
Message-ID: <20250608073517.98789-1-wangfushuai@baidu.com> (raw)
In-Reply-To: <20250607143128.d3ae86e8ebf9dcab02870421@linux-foundation.org>
>> The recent commit adding VM_SHADOW_STACK for arm64 GCS did not update
>> the /proc/[pid]/smaps display logic to show the "ss" flag for GCS pages.
>> This patch adds the necessary condition to display "ss" flag.
>>
>> ...
>>
>> --- a/fs/proc/task_mmu.c
>> +++ b/fs/proc/task_mmu.c
>> @@ -994,6 +994,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
>> #ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK
>> [ilog2(VM_SHADOW_STACK)] = "ss",
>> #endif
>> +#if defined(CONFIG_ARM64_GCS)
>> + [ilog2(VM_SHADOW_STACK)] = "ss",
>> +#endif
>> #if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
>> [ilog2(VM_DROPPABLE)] = "dp",
>> #endif
>
> It is possible to have CONFIG_ARM64_GCS=y when
> CONFIG_ARCH_HAS_USER_SHADOW_STACK=n? If so, is this a correct
> combination?
Hi, Morton
After revisiting the code logic, I realized that if CONFIG_ARM64_GCS is enabled,
CONFIG_ARCH_HAS_USER_SHADOW_STACK will always be enabled as well. Therefore,
it seems unnecessary to add separate VM_SHADOW_STACK support specifically for
CONFIG_ARM64_GCS at this stage.
I will make sure to review future patches more carefully to avoid such oversights.
Regards,
Wang
>
>
> Also, wouldn't it be nicer to code this as
>
> --- a/fs/proc/task_mmu.c~a
> +++ a/fs/proc/task_mmu.c
> @@ -991,7 +991,7 @@ static void show_smap_vma_flags(struct s
> #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR
> [ilog2(VM_UFFD_MINOR)] = "ui",
> #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
> -#ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK
> +#if defined(CONFIG_ARCH_HAS_USER_SHADOW_STACK) || defined(CONFIG_ARM64_GCS)
> [ilog2(VM_SHADOW_STACK)] = "ss",
> #endif
> #if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
> _
> --
prev parent reply other threads:[~2025-06-08 7:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-07 13:15 wangfushuai
2025-06-07 18:17 ` David Hildenbrand
2025-06-07 21:31 ` Andrew Morton
2025-06-08 7:35 ` wangfushuai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250608073517.98789-1-wangfushuai@baidu.com \
--to=wangfushuai@baidu.com \
--cc=Liam.Howlett@Oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osalvador@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®