diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c index 70d274c5aca..a81a02ac8ae 100644 --- a/sys/compat/linux/linux_mmap.c +++ b/sys/compat/linux/linux_mmap.c @@ -228,6 +228,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif diff --git a/sys/compat/linux/linux_mmap.h b/sys/compat/linux/linux_mmap.h index a27d99d989d..a694dc05799 100644 --- a/sys/compat/linux/linux_mmap.h +++ b/sys/compat/linux/linux_mmap.h @@ -41,6 +41,8 @@ #define LINUX_MAP_ANON 0x0020 #define LINUX_MAP_GROWSDOWN 0x0100 +#define LINUX_PROT_GROWSDOWN 0x01000000 +#define LINUX_PROT_GROWSUP 0x02000000 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t);