Skip to content

Commit

Permalink
[PATCH] x86_64: check if ptrace RIP is canonical
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed May 17, 2005
1 parent 312df5f commit d1099e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86_64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1099e8

Please sign in to comment.