summaryrefslogtreecommitdiff
path: root/sys/kern/exec_elf.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-11-10 03:56:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-11-10 03:56:17 +0000
commitce8919e4d085d3f90fc7037adb6f792b1a2b284c (patch)
tree629c4caa82d17d18b83309209c0ce2c41ac4d90a /sys/kern/exec_elf.c
parent6a814f32b6f5a12b2709efe7eb472f82e8b082cc (diff)
vm_map_lock() around calls to uvm_map_findspace(); ok tedu
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r--sys/kern/exec_elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index bfff39083f3..2a0083906db 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.66 2008/07/18 16:58:06 kurt Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.67 2008/11/10 03:56:16 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -384,14 +384,17 @@ ELFNAME(load_file)(struct proc *p, char *path, struct exec_package *epp,
addr = round_page((vaddr_t)p->p_vmspace->vm_daddr +
MAXDSIZ);
+ vm_map_lock(&p->p_vmspace->vm_map);
if (uvm_map_findspace(&p->p_vmspace->vm_map, addr, size,
&addr, uobj, uoff, 0, UVM_FLAG_FIXED) == NULL) {
if (uvm_map_findspace(&p->p_vmspace->vm_map, addr, size,
&addr, uobj, uoff, 0, 0) == NULL) {
error = ENOMEM; /* XXX */
+ vm_map_unlock(&p->p_vmspace->vm_map);
goto bad1;
}
}
+ vm_map_unlock(&p->p_vmspace->vm_map);
if (addr != pos + loadmap[i].vaddr) {
/* base changed. */
pos = addr - trunc_page(loadmap[i].vaddr);