]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] x86_64: check if ptrace RIP is canonical
authorAndi Kleen <ak@suse.de>
Tue, 17 May 2005 04:53:29 +0000 (04:53 +0000)
committer <chrisw@vas.sous-sol.org> <>
Fri, 27 May 2005 04:20:10 +0000 (21:20 -0700)
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>
arch/x86_64/kernel/ptrace.c

index eaa7250152f56ca7f55e94dc42ca61f8ad9488b5..b2b7e347a6715f7f487928336608a411564e7e5f 100644 (file)
@@ -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;