summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-11-08 01:59:54 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-11-08 01:59:54 +0000
commit31cdbef371a8b4406ee3f91d30fa66016b8039bd (patch)
treea51792bd819761d77d102d9d21276ca7a52e9904 /sys
parent784f474051e25b793878e4e3095c6511b1fe52b0 (diff)
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)