Skip to content
Snippets Groups Projects
Commit d1099e8a authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds
Browse files

[PATCH] x86_64: check if ptrace RIP is canonical


This works around an AMD Erratum.

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 312df5f1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment