riscv: module: Create module allocations without exec permissions

The core code manages the executable permissions of code regions of
modules explicitly, it is not necessary to create the module vmalloc
regions with RWX permissions. Create them with RW- permissions instead.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Jisheng Zhang
2021-03-30 02:25:51 +08:00
committed by Palmer Dabbelt
parent fc8504765e
commit 5387054b98

View File

@@ -412,7 +412,7 @@ void *module_alloc(unsigned long size)
{ {
return __vmalloc_node_range(size, 1, MODULES_VADDR, return __vmalloc_node_range(size, 1, MODULES_VADDR,
MODULES_END, GFP_KERNEL, MODULES_END, GFP_KERNEL,
PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, PAGE_KERNEL, 0, NUMA_NO_NODE,
__builtin_return_address(0)); __builtin_return_address(0));
} }
#endif #endif