Pass 0 instead of uvm_map_hint() to uvm_map() in exec_md_map() to figure out
authormiod <miod@openbsd.org>
Tue, 12 Aug 2014 04:28:07 +0000 (04:28 +0000)
committermiod <miod@openbsd.org>
Tue, 12 Aug 2014 04:28:07 +0000 (04:28 +0000)
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.

sys/arch/mips64/mips64/mips64_machdep.c

index 5c14041..b0663d2 100644 (file)
@@ -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,