diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c --- a/sys/compat/linux/linux_mmap.c +++ b/sys/compat/linux/linux_mmap.c @@ -230,7 +230,9 @@ linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { - /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + if ((prot & LINUX_PROT_GROWSDOWN) != 0) + addr -= len; + /* Clear PROT_GROWSDOWN and PROT_GROWSUP. */ prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) return (EINVAL);