diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2017-03-01 10:28:15 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-03-01 10:28:15 +0000 |
commit | 55b985b43bfa6ba97969de26a1d7a46777dff221 (patch) | |
tree | 39823a408dd25b9c5107b16fe4e0e18a414df275 /sys/kern/imgact_elf.c | |
parent | e3d8f8fed4860127e9ab3fa35516bf80a80c9cd0 (diff) | |
download | src-55b985b43bfa6ba97969de26a1d7a46777dff221.tar.gz src-55b985b43bfa6ba97969de26a1d7a46777dff221.zip |
Notes
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 092036897405..c01ab36cb5db 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -452,9 +452,10 @@ __elfN(map_insert)(struct image_params *imgp, vm_map_t map, vm_object_t object, * The mapping is not page aligned. This means we have * to copy the data. Sigh. */ - rv = vm_map_find(map, NULL, 0, &start, end - start, 0, - VMFS_NO_SPACE, prot | VM_PROT_WRITE, VM_PROT_ALL, - 0); + vm_map_lock(map); + rv = vm_map_insert(map, NULL, 0, start, end, + prot | VM_PROT_WRITE, VM_PROT_ALL, 0); + vm_map_unlock(map); if (rv != KERN_SUCCESS) return (rv); if (object == NULL) |