diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-03-30 21:08:41 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-03-30 21:08:41 +0000 |
commit | cbcb22b06c8a154b39499941e4bf5b9d6e0ab756 (patch) | |
tree | 6067bc0259d8df037242675f31f741069aa8d408 /sys/kern | |
parent | 2144a111bea8a88f1cc4c1922c3503207fbf565d (diff) |
Extend uvm_map_hint() to get an address range as extra arguments, and make
sure it will return an address within that range.
Use this in uaddr_rnd_select() to make sure we will not attempt to pick
an address beyond what we are allowed to map.
In my trees for 9 months, blackmailed s2k15 attendees into agreeing now would
be a good time to commit.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/exec_elf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 50a52badb42..5ceea1f7303 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.112 2015/02/10 23:39:57 guenther Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.113 2015/03/30 21:08:38 miod Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -377,7 +377,8 @@ ELFNAME(load_file)(struct proc *p, char *path, struct exec_package *epp, * would (i.e. something safely out of the way). */ if (pos == ELFDEFNNAME(NO_ADDR)) { - pos = uvm_map_hint(p->p_vmspace, PROT_EXEC); + pos = uvm_map_hint(p->p_vmspace, PROT_EXEC, + VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS); } pos = ELF_ROUND(pos, file_align); |