From: miod Date: Tue, 12 Aug 2014 04:28:07 +0000 (+0000) Subject: Pass 0 instead of uvm_map_hint() to uvm_map() in exec_md_map() to figure out X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3222d34885dc05fc6dc28b588d4b5884dbf27fca;p=openbsd Pass 0 instead of uvm_map_hint() to uvm_map() in exec_md_map() to figure out where to put the fpu assist page, for uvm_map_hint() may return an address outside userland bounds due to aggressive randomization. Passing zero will still get a random address, but correctly bounded. --- diff --git a/sys/arch/mips64/mips64/mips64_machdep.c b/sys/arch/mips64/mips64/mips64_machdep.c index 5c14041b4de..b0663d27ac5 100644 --- a/sys/arch/mips64/mips64/mips64_machdep.c +++ b/sys/arch/mips64/mips64/mips64_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mips64_machdep.c,v 1.15 2014/04/03 08:07:16 mpi Exp $ */ +/* $OpenBSD: mips64_machdep.c,v 1.16 2014/08/12 04:28:07 miod Exp $ */ /* * Copyright (c) 2009, 2010, 2012 Miodrag Vallat. @@ -181,7 +181,7 @@ exec_md_map(struct proc *p, struct exec_package *pack) * successful conditional branches. */ - va = uvm_map_hint(p->p_vmspace, UVM_PROT_RX); + va = 0; rc = uvm_map(&p->p_vmspace->vm_map, &va, PAGE_SIZE, NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_ALL, UVM_INH_COPY,