summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-05-17 04:53:29 +0000
committer <chrisw@vas.sous-sol.org>2005-05-26 21:20:10 -0700
commit63a4a4f228c0de221779cd18c7ed9511d42c557b (patch)
treed624f187485e67e5e95b840b8f492e4805cb8ecc
parent77068954f8f2354b3dfd65253f2a41e473b58f66 (diff)
downloadlinux-stable-63a4a4f228c0de221779cd18c7ed9511d42c557b.tar.gz
linux-stable-63a4a4f228c0de221779cd18c7ed9511d42c557b.tar.bz2
linux-stable-63a4a4f228c0de221779cd18c7ed9511d42c557b.zip
[PATCH] x86_64: check if ptrace RIP is canonical
This works around an AMD Erratum. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Chris Wright <chrisw@osdl.org>
-rw-r--r--arch/x86_64/kernel/ptrace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index eaa7250152f5..b2b7e347a671 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -149,6 +149,11 @@ static int putreg(struct task_struct *child,
return -EIO;
value &= 0xffff;
break;
+ case offsetof(struct user_regs_struct, rip):
+ /* Check if the new RIP address is canonical */
+ if (value >= TASK_SIZE)
+ return -EIO;
+ break;
}
put_stack_long(child, regno - sizeof(struct pt_regs), value);
return 0;