From 78bcf87e3e48b8cd3e79f109187d41feaec88a5b Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 14 Jun 2018 23:10:10 +0000 Subject: [PATCH] Use M_EXEC when calling malloc() to allocate the memory to store the module, as it'll contain executable code. --- sys/kern/link_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 450901d42a5..e9bd2119c1d 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -945,7 +945,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, goto out; } #else - ef->address = malloc(mapsize, M_LINKER, M_WAITOK); + ef->address = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); #endif mapbase = ef->address;