summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/ptrace.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-05-16 21:53:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 07:59:15 -0700
commitd1099e8a18960693c04507bdd7b9403db70bfd97 (patch)
treedab39ccad609234491bd1122f9dcae1f62a7abbc /arch/x86_64/kernel/ptrace.c
parent312df5f1a1da780e084b328bcabb02a6dcd044c3 (diff)
downloadblackbird-op-linux-d1099e8a18960693c04507bdd7b9403db70bfd97.tar.gz
blackbird-op-linux-d1099e8a18960693c04507bdd7b9403db70bfd97.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>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-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 e26e86bb56fe..892212161aa8 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -277,6 +277,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;
OpenPOWER on IntegriCloud