diff options
author | Andi Kleen <ak@suse.de> | 2005-05-17 08:53:29 +0400 |
---|---|---|
committer | <chrisw@vas.sous-sol.org> | 2005-05-27 08:20:10 +0400 |
commit | 63a4a4f228c0de221779cd18c7ed9511d42c557b (patch) | |
tree | d624f187485e67e5e95b840b8f492e4805cb8ecc | |
parent | 77068954f8f2354b3dfd65253f2a41e473b58f66 (diff) | |
download | linux-63a4a4f228c0de221779cd18c7ed9511d42c557b.tar.xz |
[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.c | 5 |
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; |