]> Git Repo - linux.git/commitdiff
Revert "mm: add arch hook to validate mmap() prot flags"
authorCatalin Marinas <[email protected]>
Tue, 12 Mar 2024 20:00:38 +0000 (20:00 +0000)
committerCatalin Marinas <[email protected]>
Wed, 13 Mar 2024 10:59:38 +0000 (10:59 +0000)
This reverts commit cb1a393c40eee2f1692c995ea0cc6e45bfccde4d.

Since the arm64 WXN patch has been reverted, remove this hook as it
would not have any users.

Signed-off-by: Catalin Marinas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
include/linux/mman.h
mm/mmap.c

index ec5e7f606e434f943c564442a48d2907baee36ed..dc7048824be81d628ca12f0874c1a7508da0d5c1 100644 (file)
@@ -124,21 +124,6 @@ static inline bool arch_validate_flags(unsigned long flags)
 #define arch_validate_flags arch_validate_flags
 #endif
 
-#ifndef arch_validate_mmap_prot
-/*
- * This is called from mmap(), which ignores unknown prot bits so the default
- * is to accept anything.
- *
- * Returns true if the prot flags are valid
- */
-static inline bool arch_validate_mmap_prot(unsigned long prot,
-                                          unsigned long addr)
-{
-       return true;
-}
-#define arch_validate_mmap_prot arch_validate_mmap_prot
-#endif
-
 /*
  * Optimisation macro.  It is equivalent to:
  *      (x & bit1) ? bit2 : 0
index 977a8c3fd9f5f80e901b56fef4b19baabb7c7907..d89770eaab6b6111117783ca7ff532871c1d71a5 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1229,9 +1229,6 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
                if (!(file && path_noexec(&file->f_path)))
                        prot |= PROT_EXEC;
 
-       if (!arch_validate_mmap_prot(prot, addr))
-               return -EACCES;
-
        /* force arch specific MAP_FIXED handling in get_unmapped_area */
        if (flags & MAP_FIXED_NOREPLACE)
                flags |= MAP_FIXED;
This page took 0.064986 seconds and 4 git commands to generate.