diff options
author | 2007-09-09 20:49:18 +0000 | |
---|---|---|
committer | 2007-09-09 20:49:18 +0000 | |
commit | 87b51b63bd6c9ff9c6ce2d466d08d3a0cc33ac1a (patch) | |
tree | a1444d979bd8570d13f3cdb7bdb8d656678165fd | |
parent | Added support for checkout -p with local repository. (diff) | |
download | wireguard-openbsd-87b51b63bd6c9ff9c6ce2d466d08d3a0cc33ac1a.tar.xz wireguard-openbsd-87b51b63bd6c9ff9c6ce2d466d08d3a0cc33ac1a.zip |
Make sure ptrace(2) cannot change any priviliged bits in the Machine State
Register. Fixes PR 5574. From Stefan Kempf.
ok deraadt@
-rw-r--r-- | sys/arch/powerpc/powerpc/process_machdep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/powerpc/powerpc/process_machdep.c b/sys/arch/powerpc/powerpc/process_machdep.c index 4004c4dd9cf..49c6834ef43 100644 --- a/sys/arch/powerpc/powerpc/process_machdep.c +++ b/sys/arch/powerpc/powerpc/process_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process_machdep.c,v 1.12 2007/03/20 20:59:53 kettenis Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.13 2007/09/09 20:49:18 kettenis Exp $ */ /* $NetBSD: process_machdep.c,v 1.1 1996/09/30 16:34:53 ws Exp $ */ /* @@ -124,6 +124,9 @@ process_write_regs(struct proc *p, struct reg *regs) struct trapframe *tf = trapframe(p); struct pcb *pcb = &p->p_addr->u_pcb; + if ((regs->ps ^ tf->srr1) & PSL_USERSTATIC) + return EINVAL; + bcopy(regs->gpr, tf->fixreg, sizeof(regs->gpr)); /* XXX What if the state is on the other cpu? */ |