Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
#include <asm-generic/mman.h>
+
+#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */
+
+#define arch_mmap_check(addr, len, flags) \
+ (((flags) & MAP_FIXED && (addr) < MIN_MAP_ADDR) ? -EINVAL : 0)
#include <asm/uaccess.h>
-#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */
-
/*
* memory mapping syscall
*/
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
- if (flags & MAP_FIXED && addr < MIN_MAP_ADDR)
- goto out;
-
error = -EBADF;
if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd);