Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 23:10:11 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335182 - head/sys/kern
Message-ID:  <201806142310.w5ENABG6074457@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806142310.w5ENABG6074457>