summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-06-20 06:24:34 +0000
committeralc <alc@FreeBSD.org>2008-06-20 06:24:34 +0000
commitc5556f0762ea142f2348d3870881beaaead0b8dd (patch)
treedf9248cbf69e61fc7f3151895a66f9eac0c3fcba
parent2fc7871f11f777726ba33446fb7c230152d69133 (diff)
downloadFreeBSD-src-c5556f0762ea142f2348d3870881beaaead0b8dd.zip
FreeBSD-src-c5556f0762ea142f2348d3870881beaaead0b8dd.tar.gz
Enforce the mapping of kernel loadable modules in the uppermost 2GB of the
kernel virtual address space on amd64.
-rw-r--r--sys/kern/link_elf_obj.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 7df776b..f8ef7f3 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -664,6 +664,13 @@ link_elf_load_file(linker_class_t cls, const char *filename,
goto out;
}
ef->address = (caddr_t) vm_map_min(kernel_map);
+
+ /*
+ * In order to satisfy amd64's architectural requirements on the
+ * location of code and data in the kernel's address space, request a
+ * mapping that is above the kernel.
+ */
+ mapbase = KERNBASE;
error = vm_map_find(kernel_map, ef->object, 0, &mapbase,
round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
if (error) {
OpenPOWER on IntegriCloud