Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f49481bc50fce428521497977861b8115666dbe7
Commit:     f49481bc50fce428521497977861b8115666dbe7
Parent:     2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:24 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:24 2007 +0100

    [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 <[EMAIL PROTECTED]>
---
 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 addc14a..4326a69 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)
                }
                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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to