From 27a384f98af1b6e8ab513f04a416a8d0382111e6 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 18 Nov 2022 03:47:21 +0000 Subject: [PATCH] mips64 code calls uvm_map_protect() directly, so needs to adapt: 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index d044afd73e5..2bd9d3608c9 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -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 -- 2.20.1