diff options
author | Andi Kleen <ak@suse.de> | 2007-02-13 07:26:24 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:24 -0500 |
commit | f49481bc50fce428521497977861b8115666dbe7 (patch) | |
tree | 82b104f236cbc9b57d906c79c432fd8bb2d46bd8 /arch/x86_64/kernel/ptrace.c | |
parent | 2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544 (diff) |
[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>
Diffstat (limited to 'arch/x86_64/kernel/ptrace.c')
-rw-r--r-- | arch/x86_64/kernel/ptrace.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c index addc14af0c56..4326a690a509 100644 --- a/arch/x86_64/kernel/ptrace.c +++ b/arch/x86_64/kernel/ptrace.c | |||
@@ -536,8 +536,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
536 | } | 536 | } |
537 | ret = 0; | 537 | ret = 0; |
538 | for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) { | 538 | for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) { |
539 | ret |= __get_user(tmp, (unsigned long __user *) data); | 539 | ret = __get_user(tmp, (unsigned long __user *) data); |
540 | putreg(child, ui, tmp); | 540 | if (ret) |
541 | break; | ||
542 | ret = putreg(child, ui, tmp); | ||
543 | if (ret) | ||
544 | break; | ||
541 | data += sizeof(long); | 545 | data += sizeof(long); |
542 | } | 546 | } |
543 | break; | 547 | break; |