mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
[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>
This commit is contained in:
parent
77068954f8
commit
63a4a4f228
1 changed files with 5 additions and 0 deletions
|
@ -149,6 +149,11 @@ static int putreg(struct task_struct *child,
|
||||||
return -EIO;
|
return -EIO;
|
||||||
value &= 0xffff;
|
value &= 0xffff;
|
||||||
break;
|
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);
|
put_stack_long(child, regno - sizeof(struct pt_regs), value);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue