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 | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/mm/mmap.c b/mm/mmap.c index 771d99f965da..ad6991e4bb68 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1248,6 +1248,14 @@ user_uintptr_t do_mmap(struct file *file, user_uintptr_t user_addr, return -EINVAL;
#ifdef CONFIG_CHERI_PURECAP_UABI + /* + * 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 (!reserve_ignore) { if (cheri_tag_get(user_addr)) { if (!capability_owns_range(user_addr, addr, len))