diff options
author | 2004-02-13 00:05:52 +0000 | |
---|---|---|
committer | 2004-02-13 00:05:52 +0000 | |
commit | 929b0ad4d1a0e6f0a8e4858fb79e34264b8d50c8 (patch) | |
tree | f4e76211df44016b23cd92eeaf7829587b061701 | |
parent | don't reset the PHY when IPs are configured; from freebsd revision 1.16 (diff) | |
download | wireguard-openbsd-929b0ad4d1a0e6f0a8e4858fb79e34264b8d50c8.tar.xz wireguard-openbsd-929b0ad4d1a0e6f0a8e4858fb79e34264b8d50c8.zip |
on sigreturn check cs and rflags for evilness; from i386
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index bf82df6856a..7571f885d92 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.3 2004/02/03 12:09:47 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.4 2004/02/13 00:05:52 mickey Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -684,6 +684,10 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) if (copyin((caddr_t)scp, &ksc, sizeof ksc)) return (error); + if (((ksc.sc_rflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 || + !USERMODE(ksc.sc_cs, ksc.sc_eflags)) + return (EINVAL); + ksc.sc_trapno = tf->tf_trapno; ksc.sc_err = tf->tf_err; bcopy(&ksc, tf, sizeof(*tf)); |