diff options
author | alc <alc@FreeBSD.org> | 2008-06-20 06:24:34 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-06-20 06:24:34 +0000 |
commit | c5556f0762ea142f2348d3870881beaaead0b8dd (patch) | |
tree | df9248cbf69e61fc7f3151895a66f9eac0c3fcba | |
parent | 2fc7871f11f777726ba33446fb7c230152d69133 (diff) | |
download | FreeBSD-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.c | 7 |
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) { |