Files
linux-bredos/arch/arm64/include/asm
Catalin Marinas 14cc006ed6 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 25c17c4b55 ("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: 9f3419315f ("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>
2025-02-27 04:10:42 -08:00
..
2023-06-05 09:36:39 +02:00
2023-06-05 09:36:39 +02:00
2023-06-05 09:36:39 +02:00
2021-10-21 10:45:22 +01:00
2023-06-07 17:57:47 +01:00
2023-06-06 17:39:05 +01:00
2023-04-05 19:42:43 -07:00
2022-07-22 17:34:57 -05:00
2023-06-05 09:36:39 +02:00
2022-02-19 11:11:09 +01:00
2023-08-12 09:18:47 -07:00
2023-05-25 17:44:01 +01:00
2022-09-16 12:17:03 +01:00
2024-04-27 17:11:31 +02:00