Commit f49481bc authored by Andi Kleen's avatar Andi Kleen Committed by Andi Kleen

[PATCH] x86-64: Check return value of putreg in PTRACE_SETREGS

This means if an illegal value is set for the segment registers there
ptrace will error out now with an errno instead of silently ignoring
it.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent 2f7a2a79
...@@ -536,8 +536,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) ...@@ -536,8 +536,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
} }
ret = 0; ret = 0;
for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) { for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) {
ret |= __get_user(tmp, (unsigned long __user *) data); ret = __get_user(tmp, (unsigned long __user *) data);
putreg(child, ui, tmp); if (ret)
break;
ret = putreg(child, ui, tmp);
if (ret)
break;
data += sizeof(long); data += sizeof(long);
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment