linux/arch/arm64/mm
Catalin Marinas 47a8aad135 arm64: gcs: Honour mprotect(PROT_NONE) on shadow stack mappings
vm_get_page_prot() short-circuits the protection_map[] lookup for a
VM_SHADOW_STACK mapping since it uses a different PIE index from the
typical read/write/exec permissions. However, the side effect is that it
also ignores mprotect(PROT_NONE) by creating an accessible PTE.

Special-case the !(vm_flags & VM_ACCESS_FLAGS) flags to use the
protection_map[VM_NONE] permissions instead. No GCS attributes are
required for an inaccessible PTE.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 6497b66ba6 ("arm64/mm: Map pages for guarded control stack")
Cc: stable@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
2026-02-25 19:53:58 +00:00
..
cache.S efi: arm64: enter with MMU and caches enabled 2023-01-24 11:51:08 +00:00
context.c arm64: Ensure bits ASID[15:8] are masked out when the kernel uses 8-bit ASIDs 2024-12-05 11:24:38 +00:00
contpte.c arm64: mm: support batch clearing of the young flag for large folios 2026-02-12 15:43:00 -08:00
copypage.c arm64: mte: Do not warn if the page is already tagged in copy_highpage() 2025-10-23 17:34:58 +01:00
dma-mapping.c arm64: Properly clean up iommu-dma remnants 2024-05-10 09:04:25 +02:00
extable.c arm64: mm: Handle PAN faults on uaccess CPY* instructions 2025-03-07 18:28:29 +00:00
fault.c arm64 updates for 6.19: 2025-12-02 17:03:55 -08:00
fixmap.c arm64: Add support for FEAT_HAFT 2024-11-05 13:18:35 +00:00
flush.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
gcs.c arm64/gcs: Fix error handling in arch_set_shadow_stack_status() 2026-02-03 09:30:20 +00:00
hugetlbpage.c arm64/mm: add addr parameter to __ptep_get_and_clear_anysz() 2026-01-26 20:02:33 -08:00
init.c mm, arch: consolidate hugetlb CMA reservation 2026-01-26 20:02:19 -08:00
ioremap.c arm64: io: Rename ioremap_prot() to __ioremap_prot() 2026-02-25 19:49:51 +00:00
kasan_init.c kasan: call kasan_init_generic in kasan_init 2025-09-21 14:21:58 -07:00
Makefile mm: rename GENERIC_PTDUMP and PTDUMP_CORE 2025-03-17 00:05:32 -07:00
mem_encrypt.c arm64: mm: Add top-level dispatcher for internal mem_encrypt API 2024-08-30 16:30:41 +01:00
mmap.c arm64: gcs: Honour mprotect(PROT_NONE) on shadow stack mappings 2026-02-25 19:53:58 +00:00
mmu.c mm: introduce generic lazy_mmu helpers 2026-01-20 19:24:33 -08:00
mteswap.c arm64: mm: swap: support THP_SWAP on hardware with MTE 2024-04-25 20:56:07 -07:00
pageattr.c mm: introduce generic lazy_mmu helpers 2026-01-20 19:24:33 -08:00
pgd.c arm64/mm: Ensure PGD_SIZE is aligned to 64 bytes when PA_BITS = 52 2025-11-11 19:13:03 +00:00
physaddr.c arm64: mm: Don't use %pK through printk 2025-03-20 15:34:53 +00:00
proc.S arm64 updates for 7.0 2026-02-09 20:28:45 -08:00
ptdump.c arm64: Enable vmalloc-huge with ptdump 2025-09-22 11:53:24 +01:00
ptdump_debugfs.c mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() 2025-07-09 22:42:20 -07:00
trans_pgd-asm.S arm64: kexec: configure EL2 vectors for kexec 2021-10-01 13:31:00 +01:00
trans_pgd.c arm64: Fix 5-level paging support in kexec/hibernate trampoline 2025-02-04 12:23:09 +00:00