summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2002-11-08 01:59:53 +0000
committermickey <mickey@openbsd.org>2002-11-08 01:59:53 +0000
commit03b4e23ea3ae9654605422e7a1792466931444e9 (patch)
tree099bf0b49b8ba57bdb9b0ab086be36945d5e8b1b /sys
parentDon't uvm_useracc the user sigcontext in sys_sigreturn and then access (diff)
downloadwireguard-openbsd-03b4e23ea3ae9654605422e7a1792466931444e9.tar.xz
wireguard-openbsd-03b4e23ea3ae9654605422e7a1792466931444e9.zip
Don't uvm_useracc the user sigcontext in sys_sigreturn and then access
the user addresses directly from the kernel. copyin is faster and can correctly deal properly with mappings that uvm_useracc thinks are correct but will fault anyway (to figure out how to generate such mappings is left as en excercise for the reader).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/machdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 4ea22834f39..41364dcd856 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.88 2002/11/01 00:14:43 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.89 2002/11/08 01:59:53 mickey Exp $ */
/*
* Copyright (c) 1999-2002 Michael Shalayeff
@@ -1299,6 +1299,7 @@ sys_sigreturn(p, v, retval)
} */ *uap = v;
struct sigcontext *scp, ksc;
struct trapframe *tf = p->p_md.md_regs;
+ int error;
scp = SCARG(uap, sigcntxp);
#ifdef DEBUG
@@ -1306,9 +1307,8 @@ sys_sigreturn(p, v, retval)
printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
#endif
- if (uvm_useracc((caddr_t)scp, sizeof (*scp), B_WRITE) == 0 ||
- copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc))
- return (EINVAL);
+ if ((error = copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc)))
+ return (error);
#define PSL_MBS (PSL_C|PSL_Q|PSL_P|PSL_D|PSL_I)
#define PSL_MBZ (PSL_Y|PSL_Z|PSL_S|PSL_X|PSL_M|PSL_R)