Skip to content

Commit 1ef21fc

Browse files
committed
Revert "mm: add arch hook to validate mmap() prot flags"
This reverts commit cb1a393. 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]
1 parent 69ebc01 commit 1ef21fc

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

include/linux/mman.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,6 @@ static inline bool arch_validate_flags(unsigned long flags)
124124
#define arch_validate_flags arch_validate_flags
125125
#endif
126126

127-
#ifndef arch_validate_mmap_prot
128-
/*
129-
* This is called from mmap(), which ignores unknown prot bits so the default
130-
* is to accept anything.
131-
*
132-
* Returns true if the prot flags are valid
133-
*/
134-
static inline bool arch_validate_mmap_prot(unsigned long prot,
135-
unsigned long addr)
136-
{
137-
return true;
138-
}
139-
#define arch_validate_mmap_prot arch_validate_mmap_prot
140-
#endif
141-
142127
/*
143128
* Optimisation macro. It is equivalent to:
144129
* (x & bit1) ? bit2 : 0

mm/mmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,9 +1229,6 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
12291229
if (!(file && path_noexec(&file->f_path)))
12301230
prot |= PROT_EXEC;
12311231

1232-
if (!arch_validate_mmap_prot(prot, addr))
1233-
return -EACCES;
1234-
12351232
/* force arch specific MAP_FIXED handling in get_unmapped_area */
12361233
if (flags & MAP_FIXED_NOREPLACE)
12371234
flags |= MAP_FIXED;

0 commit comments

Comments
 (0)