[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: Andi Kleen <ak@suse.de>
This commit is contained in:
Andi Kleen 2007-02-13 13:26:24 +01:00 коммит произвёл Andi Kleen
Родитель 2f7a2a79c3
Коммит f49481bc50
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -536,8 +536,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
}
ret = 0;
for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) {
ret |= __get_user(tmp, (unsigned long __user *) data);
putreg(child, ui, tmp);
ret = __get_user(tmp, (unsigned long __user *) data);
if (ret)
break;
ret = putreg(child, ui, tmp);
if (ret)
break;
data += sizeof(long);
}
break;