svn commit: r335182 - head/sys/kern

Olivier Houchard cognet at FreeBSD.org
Thu Jun 14 23:10:12 UTC 2018


Author: cognet
Date: Thu Jun 14 23:10:10 2018
New Revision: 335182
URL: https://svnweb.freebsd.org/changeset/base/335182

Log:
  Use M_EXEC when calling malloc() to allocate the memory to store the module,
  as it'll contain executable code.

Modified:
  head/sys/kern/link_elf.c

Modified: head/sys/kern/link_elf.c
==============================================================================
--- head/sys/kern/link_elf.c	Thu Jun 14 22:31:30 2018	(r335181)
+++ head/sys/kern/link_elf.c	Thu Jun 14 23:10:10 2018	(r335182)
@@ -945,7 +945,7 @@ link_elf_load_file(linker_class_t cls, const char* fil
 		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;
 


More information about the svn-src-all mailing list