mips64 code calls uvm_map_protect() directly, so needs to adapt:
authorderaadt <deraadt@openbsd.org>
Fri, 18 Nov 2022 03:47:21 +0000 (03:47 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 18 Nov 2022 03:47:21 +0000 (03:47 +0000)
stack growth from setrlimit was never updated to set UVM_ET_STACK on
the entries, so the check-sp-at-system-call check failed.  Quite strange
it took this long to find this.
ok kettenis

sys/arch/mips64/mips64/trap.c

index d044afd..2bd9d36 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: trap.c,v 1.161 2022/11/02 07:20:08 guenther Exp $     */
+/*     $OpenBSD: trap.c,v 1.162 2022/11/18 03:47:21 deraadt Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -615,7 +615,7 @@ fault_common_no_miss:
                                KERNEL_UNLOCK();
                                (void)uvm_map_protect(map, p->p_md.md_fppgva,
                                    p->p_md.md_fppgva + PAGE_SIZE,
-                                   PROT_NONE, FALSE, FALSE);
+                                   PROT_NONE, 0, FALSE, FALSE);
                                return;
                        }
                        /* FALLTHROUGH */
@@ -1585,7 +1585,7 @@ fpe_branch_emulate(struct proc *p, struct trapframe *tf, uint32_t insn,
         */
 
        rc = uvm_map_protect(map, p->p_md.md_fppgva,
-           p->p_md.md_fppgva + PAGE_SIZE, PROT_READ | PROT_WRITE, FALSE,
+           p->p_md.md_fppgva + PAGE_SIZE, PROT_READ | PROT_WRITE, 0, FALSE,
            FALSE);
        if (rc != 0) {
 #ifdef DEBUG
@@ -1625,7 +1625,7 @@ fpe_branch_emulate(struct proc *p, struct trapframe *tf, uint32_t insn,
        }
 
        (void)uvm_map_protect(map, p->p_md.md_fppgva,
-           p->p_md.md_fppgva + PAGE_SIZE, PROT_READ | PROT_EXEC, FALSE, FALSE);
+           p->p_md.md_fppgva + PAGE_SIZE, PROT_READ | PROT_EXEC, 0, FALSE, FALSE);
        p->p_md.md_fpbranchva = dest;
        p->p_md.md_fpslotva = (vaddr_t)tf->pc + 4;
        p->p_md.md_flags |= MDP_FPUSED;
@@ -1639,7 +1639,7 @@ err:
        KERNEL_UNLOCK();
 err2:
        (void)uvm_map_protect(map, p->p_md.md_fppgva,
-           p->p_md.md_fppgva + PAGE_SIZE, PROT_NONE, FALSE, FALSE);
+           p->p_md.md_fppgva + PAGE_SIZE, PROT_NONE, 0, FALSE, FALSE);
        return rc;
 }
 #endif