mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-01 17:56:50 +07: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>
This commit is contained in:
parent
312df5f1a1
commit
d1099e8a18
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user