]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86_64 ptrace: fix sys32_ptrace task_struct leak
authorRoland McGrath <roland@redhat.com>
Fri, 27 Jun 2008 20:48:29 +0000 (13:48 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Jul 2008 03:46:15 +0000 (20:46 -0700)
Commit 5a4646a4efed8c835f76c3b88f3155f6ab5b8d9b introduced a leak of
task_struct refs into sys32_ptrace.  This bug has already gone away in
for 2.6.26 in commit 562b80bafffaf42a6d916b0a2ee3d684220a1c10.

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/ptrace.c

index 9003e0b03605f23f1c2986fdd9ab8ea5e2125007..a10ba6536b4122bfe0db2e651a10bcbd7f25e9bb 100644 (file)
@@ -1309,42 +1309,49 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
                break;
 
        case PTRACE_GETREGS:    /* Get all gp regs from the child. */
-               return copy_regset_to_user(child, &user_x86_32_view,
-                                          REGSET_GENERAL,
-                                          0, sizeof(struct user_regs_struct32),
-                                          datap);
+               ret = copy_regset_to_user(child, &user_x86_32_view,
+                                         REGSET_GENERAL,
+                                         0, sizeof(struct user_regs_struct32),
+                                         datap);
+               break;
 
        case PTRACE_SETREGS:    /* Set all gp regs in the child. */
-               return copy_regset_from_user(child, &user_x86_32_view,
-                                            REGSET_GENERAL, 0,
-                                            sizeof(struct user_regs_struct32),
-                                            datap);
+               ret = copy_regset_from_user(child, &user_x86_32_view,
+                                           REGSET_GENERAL, 0,
+                                           sizeof(struct user_regs_struct32),
+                                           datap);
+               break;
 
        case PTRACE_GETFPREGS:  /* Get the child FPU state. */
-               return copy_regset_to_user(child, &user_x86_32_view,
-                                          REGSET_FP, 0,
-                                          sizeof(struct user_i387_ia32_struct),
-                                          datap);
+               ret = copy_regset_to_user(child, &user_x86_32_view,
+                                         REGSET_FP, 0,
+                                         sizeof(struct user_i387_ia32_struct),
+                                         datap);
+               break;
 
        case PTRACE_SETFPREGS:  /* Set the child FPU state. */
-               return copy_regset_from_user(
+               ret = copy_regset_from_user(
                        child, &user_x86_32_view, REGSET_FP,
                        0, sizeof(struct user_i387_ia32_struct), datap);
+               break;
 
        case PTRACE_GETFPXREGS: /* Get the child extended FPU state. */
-               return copy_regset_to_user(child, &user_x86_32_view,
-                                          REGSET_XFP, 0,
-                                          sizeof(struct user32_fxsr_struct),
-                                          datap);
+               ret = copy_regset_to_user(child, &user_x86_32_view,
+                                         REGSET_XFP, 0,
+                                         sizeof(struct user32_fxsr_struct),
+                                         datap);
+               break;
 
        case PTRACE_SETFPXREGS: /* Set the child extended FPU state. */
-               return copy_regset_from_user(child, &user_x86_32_view,
+               ret = copy_regset_from_user(child, &user_x86_32_view,
                                             REGSET_XFP, 0,
                                             sizeof(struct user32_fxsr_struct),
                                             datap);
+               break;
 
        default:
-               return compat_ptrace_request(child, request, addr, data);
+               ret = compat_ptrace_request(child, request, addr, data);
+               break;
        }
 
  out: