提交 d1099e8a 编写于 作者: A Andi Kleen 提交者: Linus Torvalds

[PATCH] x86_64: check if ptrace RIP is canonical

This works around an AMD Erratum.
Signed-off-by: NAndi Kleen <ak@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 312df5f1
...@@ -277,6 +277,11 @@ static int putreg(struct task_struct *child, ...@@ -277,6 +277,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册