aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/s390/kernel/module.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-04-02 20:55:21 +0200
committerVasily Gorbik <gor@linux.ibm.com>2023-04-13 17:36:26 +0200
commit1707c1165283a9634717971f17692535c21ab0eb (patch)
treed488e9829417c7128525711f63071eb32f1c62e0 /arch/s390/kernel/module.c
parents390/ftrace: do not assume module_alloc() returns executable memory (diff)
downloadwireguard-linux-1707c1165283a9634717971f17692535c21ab0eb.tar.xz
wireguard-linux-1707c1165283a9634717971f17692535c21ab0eb.zip
s390/module: create module allocations without exec permissions
This is the s390 variant of commit 7dfac3c5f40e ("arm64: module: create module allocations without exec permissions"): "The core code manages the executable permissions of code regions of modules explicitly. It is no longer necessary to create the module vmalloc regions with RWX permissions. So create them with RW- permissions instead, which is preferred from a security perspective." Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to '')
-rw-r--r--arch/s390/kernel/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 57c13e30e66d..07a13546980d 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -63,7 +63,7 @@ void *module_alloc(unsigned long size)
return NULL;
p = __vmalloc_node_range(size, MODULE_ALIGN,
MODULES_VADDR + get_module_load_offset(), MODULES_END,
- gfp_mask, PAGE_KERNEL_EXEC, VM_DEFER_KMEMLEAK, NUMA_NO_NODE,
+ gfp_mask, PAGE_KERNEL, VM_DEFER_KMEMLEAK, NUMA_NO_NODE,
__builtin_return_address(0));
if (p && (kasan_alloc_module_shadow(p, size, gfp_mask) < 0)) {
vfree(p);