diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-26 17:05:12 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-26 17:05:12 +0000 |
commit | b2451c3498ddb2e06384202a22e677b6e89704fa (patch) | |
tree | fbb27f60b78a8130b58028a1a2643a4df2873f7b /sys | |
parent | c1ff300c4feff6e9f8c2c5b550f4f1cc02e027bd (diff) |
Do not allow userland to change cop0 SR via ptrace; from NetBSD.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mips64/mips64/process_machdep.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/process_machdep.c b/sys/arch/mips64/mips64/process_machdep.c index 50ab019c316..d3fe50bbe4b 100644 --- a/sys/arch/mips64/mips64/process_machdep.c +++ b/sys/arch/mips64/mips64/process_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process_machdep.c,v 1.6 2005/12/17 14:56:31 kettenis Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.7 2007/04/26 17:05:11 miod Exp $ */ /* * Copyright (c) 1994 Adam Glass @@ -40,7 +40,7 @@ * From: * Id: procfs_i386.c,v 4.1 1993/12/17 10:47:45 jsp Rel * - * $Id: process_machdep.c,v 1.6 2005/12/17 14:56:31 kettenis Exp $ + * $Id: process_machdep.c,v 1.7 2007/04/26 17:05:11 miod Exp $ */ /* @@ -105,6 +105,7 @@ process_write_regs(p, regs) struct proc *p; struct reg *regs; { + register_t sr; extern struct proc *machFPCurProcPtr; if (p == machFPCurProcPtr) { @@ -113,8 +114,9 @@ process_write_regs(p, regs) else MipsSaveCurFPState16(p); } + sr = p->p_md.md_regs->sr; bcopy((caddr_t)regs, (caddr_t)p->p_md.md_regs, REGSIZE); -/*XXX Clear to user set bits!! */ + p->p_md.md_regs->sr = sr; return (0); } |