[PATCH v6 02/33] mm: helper `is_shadow_stack_vma` to check shadow stack vma

Mark Brown broonie at kernel.org
Wed Oct 9 04:11:32 PDT 2024


On Tue, Oct 08, 2024 at 03:36:44PM -0700, Deepak Gupta wrote:
> VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) is used to encode shadow stack
> VMA on three architectures (x86 shadow stack, arm GCS and RISC-V shadow
> 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.

Not that it makes any difference but the arm64 eneded up defining
VM_SHADOW_STACK to VM_HIGH_ARCH_6.

> Signed-off-by: Deepak Gupta <debug at rivosinc.com>
> ---
>  mm/gup.c |  2 +-
>  mm/vma.h | 10 +++++++---
>  2 files changed, 8 insertions(+), 4 deletions(-)

There's another test of VM_SHADOW_STACK in mainline now, added by my
change df7e1286b1dc3d6c ("mm: care about shadow stack guard gap when
getting an unmapped area") - sorry, I should've remembered this change
from your series and pulled it into mine.

> @@ -387,7 +392,6 @@ static inline bool is_data_mapping(vm_flags_t flags)
>         return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE;
>  }
> 
> -
>  static inline void vma_iter_config(struct vma_iterator *vmi,
>                 unsigned long index, unsigned long last)

Unrelated whitespace change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20241009/05adf78e/attachment.sig>


More information about the linux-riscv mailing list