MAP_GROWSDOWN flag is not supported by PCuABI specification. Hence, reject such requests with -EOPNOTSUPP error.
Signed-off-by: Amit Daniel Kachhap amitdaniel.kachhap@arm.com --- mm/mmap.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/mm/mmap.c b/mm/mmap.c index fd25fa7c9cda..c5ffa129ff72 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1453,6 +1453,15 @@ user_uintptr_t ksys_mmap_pgoff(user_uintptr_t user_ptr, unsigned long len, } if (!reserv_is_supported(current->mm)) goto skip_pcuabi_checks; + /* + * Introduce checks for PCuABI: + * - MAP_GROWSDOWN flag has no fixed bounds and hence is not supported + * in the PCuABI reservation model. + */ + if (flags & MAP_GROWSDOWN) { + retval = -EOPNOTSUPP; + goto out_fput; + }
if (user_ptr_is_valid((const void __user *)user_ptr)) { if (!(flags & MAP_FIXED) || !check_user_ptr_owning(user_ptr, addr, len))