Thread (39 messages) 39 messages, 5 authors, 2026-01-15

Re: [PATCH v9 01/26] mm: helper `is_shadow_stack_vma` to check shadow stack vma

From: Deepak Gupta <hidden>
Date: 2025-02-07 23:52:33
Also in: linux-arch, linux-doc, linux-fsdevel, linux-kselftest, linux-mm, linux-riscv, lkml

On Fri, Feb 07, 2025 at 03:44:27PM -0800, Deepak Gupta wrote:
On Fri, Feb 07, 2025 at 10:27:10AM +0100, Vlastimil Babka wrote:
quoted
On 2/5/25 02:21, Deepak Gupta wrote:
quoted
VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) is used to encode shadow stack
I see that arm GCS uses VM_HIGH_ARCH_6.
quoted
VMA on three architectures (x86 shadow stack, arm GCS and RISC-V shadow
And RISC-V doesn't define it at all, not even in this patchset, or did I
miss it somewhere?
hmm...
Something wrong in my workflow and rebasing.
Thanks for catching this.
I think this is the miss on my part.

I had this patch in last series which introduces `ARCH_HAS_USER_SHADOW_STACK`
https://lore.kernel.org/all/20241111-v5_user_cfi_series-v8-1-dce14aa30207@rivosinc.com/ (local)

As part of above patch, `CONFIG_X86_USER_SHADOW_STACK` was replaced with
`CONFIG_ARCH_HAS_USER_SHADOW_STACK` in `mm.h` to define VM_SHADOW_STACK
as VM_HIGH_ARCH_5. It was all fine because all 3 arches were using VM_HIGH_ARCH_5. 

However as things progressed on, arm64 ended up using VM_HIGH_ARCH_6. But
arm64 gcs patches also landed the introduction of `ARCH_HAS_USER_SHADOW_STACK`.
So I dropped this patch from my v9 and didn't pay attention and actually missed
the definition.
quoted
quoted
stack). In case architecture doesn't implement shadow stack, it's VM_NONE
Introducing a helper `is_shadow_stack_vma` to determine shadow stack vma
or not.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help