summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2025-02-20 15:58:01 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-27 04:30:13 -0800
commit93745f5f2377c6e12e1607bcb8558b9f0b673483 (patch)
treef4e35a29053ea5add7e5d03582870290bb85d46f /include
parent19b4657de424f48a588eb379fe3214d317f46cd7 (diff)
downloadlinux-93745f5f2377c6e12e1607bcb8558b9f0b673483.tar.gz
linux-93745f5f2377c6e12e1607bcb8558b9f0b673483.tar.bz2
linux-93745f5f2377c6e12e1607bcb8558b9f0b673483.zip
arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings
PROT_MTE (memory tagging extensions) is not supported on all user mmap() types for various reasons (memory attributes, backing storage, CoW handling). The arm64 arch_validate_flags() function checks whether the VM_MTE_ALLOWED flag has been set for a vma during mmap(), usually by arch_calc_vm_flag_bits(). Linux prior to 6.13 does not support PROT_MTE hugetlb mappings. This was added by commit 25c17c4b55de ("hugetlb: arm64: add mte support"). However, earlier kernels inadvertently set VM_MTE_ALLOWED on (MAP_ANONYMOUS | MAP_HUGETLB) mappings by only checking for MAP_ANONYMOUS. Explicitly check MAP_HUGETLB in arch_calc_vm_flag_bits() and avoid setting VM_MTE_ALLOWED for such mappings. Fixes: 9f3419315f3c ("arm64: mte: Add PROT_MTE support to mmap() and mprotect()") Cc: <stable@vger.kernel.org> # 5.10.x-6.12.x Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions