MAP_GROWSDOWN flag is not supported by PCuABI specification. Hence reject such requests with -EOPNOTSUPP error.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@arm.com --- mm/mmap.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/mm/mmap.c b/mm/mmap.c index cb7a4b71ad82..e8e9190f26cb 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1258,6 +1258,13 @@ user_uintptr_t do_mmap(struct file *file, user_uintptr_t user_addr, ignore_reserv = true; goto skip_pcuabi_checks; } + /* + * Introduce checks for PCuABI: + * - MAP_GROWSDOWN flag do not have fixed bounds and hence not + * supported in PCuABI reservation model. + */ + if (flags & MAP_GROWSDOWN) + return -EOPNOTSUPP; if (cheri_tag_get(user_addr)) { if (!capability_owns_range(user_addr, addr, len) || !(flags & MAP_FIXED)) return -EINVAL;