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
..
2022-09-09 12:30:08 +01:00
2022-09-09 12:27:25 +01:00
2022-06-06 08:54:33 +02:00
2024-09-12 11:11:42 +02:00
2024-02-23 09:24:47 +01:00
Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core
2023-06-23 18:32:20 +01:00
2022-03-08 13:32:48 +00:00
2023-01-31 16:06:17 +00:00
2023-06-05 21:11:05 +02:00
2023-05-25 17:44:02 +01:00
2023-11-20 11:59:38 +01:00
2022-07-05 11:45:46 +01:00
2024-06-12 11:12:49 +02:00
2022-06-28 12:11:47 +01:00
2023-06-15 17:47:54 +01:00
2022-12-06 11:33:29 +00:00
2023-06-05 09:36:39 +02:00
2023-06-05 09:36:39 +02:00
2023-06-05 09:57:14 +02:00
2024-08-14 13:58:48 +02:00
2022-01-15 08:47:31 -08:00
2023-02-08 15:26:58 -08:00
2023-06-19 16:19:22 -07:00
2023-08-24 16:20:20 -07:00
2023-06-05 09:36:39 +02:00
2023-05-25 17:44:01 +01:00
2023-04-13 12:27:11 +01:00
2022-06-23 14:19:33 +01:00
2023-06-06 16:52:40 +01:00
2023-09-18 10:45:11 +01:00
2022-06-23 14:19:33 +01:00
2024-10-10 11:58:02 +02:00
2023-04-14 13:39:47 +01:00
2023-09-08 11:25:13 -07:00
2023-07-26 17:08:29 +00:00
2024-10-04 16:29:55 +02:00
Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core
2023-06-23 18:32:20 +01:00
2021-11-08 22:16:26 +01:00
2023-04-20 10:04:27 +02:00
2023-04-11 18:55:28 +01:00
2024-03-26 18:19:11 -04:00
2023-06-29 11:29:31 +01:00
2023-07-12 12:06:04 -04:00
2021-10-21 10:45:22 +01:00
2021-10-21 10:45:22 +01:00
2023-09-29 17:20:47 -07:00
2023-05-25 17:44:01 +01:00
2023-08-04 17:32:13 +01:00
2022-01-12 08:24:29 -06:00
2023-06-21 08:53:31 -06:00
2022-02-22 21:25:48 +00:00
2024-12-09 10:31:42 +01:00
2023-08-18 10:12:36 -07:00
2024-02-05 20:14:17 +00:00
2023-06-07 17:57:47 +01:00
2024-08-11 12:47:24 +02:00
2022-05-04 15:30:28 +01:00
2023-08-04 17:19:44 +01:00
2023-04-11 19:24:46 +01:00
2023-03-27 16:15:20 +01:00
2023-10-12 16:38:50 +01:00
2023-08-31 13:18:53 -04:00
2023-07-26 17:08:30 +00:00
2024-12-09 10:32:44 +01:00
2023-09-12 13:07:37 +01:00
2023-08-26 12:00:54 +01:00
2023-08-17 10:00:27 +01:00
2023-08-17 09:40:35 +01:00
2023-06-01 21:34:51 +00:00
2022-04-29 19:26:27 +01:00
2023-01-24 11:49:43 +00:00
2023-06-07 17:57:47 +01:00
2023-07-06 10:06:04 -07:00
2025-02-27 04:10:42 -08:00
Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core
2023-06-23 18:32:20 +01:00
2023-07-27 11:18:02 +01:00
2023-06-06 17:39:05 +01:00
2023-06-06 17:39:05 +01:00
2022-02-15 22:53:29 +00:00
2023-04-05 19:42:43 -07:00
2023-08-18 10:12:02 -07:00
2023-02-02 22:33:18 -08:00
2022-02-23 10:58:28 +01:00
2023-01-24 11:49:43 +00:00
2022-07-22 17:34:57 -05:00
2023-06-05 09:36:39 +02:00
2023-03-27 14:01:18 +01:00
2021-11-16 10:12:57 +00:00
2023-06-06 16:52:41 +01:00
2023-06-06 16:52:41 +01:00
2023-12-20 17:02:01 +01:00
2023-04-13 12:27:11 +01:00
2022-02-19 11:11:09 +01:00
2023-08-12 09:18:47 -07:00
2022-11-07 14:19:01 +00:00
2023-01-31 16:06:17 +00:00
2022-03-09 21:56:50 +00:00
2023-05-25 17:44:01 +01:00
2023-08-04 17:35:33 +01:00
2022-02-15 17:40:28 +00:00
2023-01-19 14:58:19 +01:00
2023-12-03 07:33:05 +01:00
2023-05-15 13:44:57 +02:00
2023-04-05 19:42:46 -07:00
2023-05-25 17:44:02 +01:00
2021-12-07 15:14:12 +01:00
2022-11-18 02:18:10 +01:00
2023-01-16 15:27:31 +01:00
2022-10-09 02:33:49 +01:00
2022-03-07 21:57:02 +00:00
2024-01-20 11:51:46 +01:00
2023-07-12 12:06:04 -04:00
2023-09-07 13:52:20 -07:00
2022-09-16 12:17:03 +01:00
2023-06-09 17:44:16 -07:00
2023-08-21 13:37:55 -07:00
2023-08-18 10:12:37 -07:00
2024-04-27 17:11:31 +02:00
2022-03-10 20:21:58 +01:00
2021-10-01 13:31:01 +01:00
2023-05-25 17:44:03 +01:00
2023-06-15 17:47:54 +01:00
2024-07-05 09:34:04 +02:00
2023-07-27 12:25:35 +02:00
2024-10-22 15:46:20 +02:00
2022-09-09 12:27:25 +01:00
2022-03-18 13:48:28 +00:00
2023-07-11 19:30:14 +00:00
2022-03-24 19:06:47 -07:00
2022-03-24 19:06:47 -07:00
2023-04-05 19:42:43 -07:00
2022-02-11 20:39:39 +11:00