[PATCH] CRIS update: updates for 2.6.12
[pandora-kernel.git] / arch / cris / arch-v10 / kernel / ptrace.c
index 581ecab..130dd21 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/ptrace.h>
 #include <linux/user.h>
 #include <linux/signal.h>
+#include <linux/security.h>
 
 #include <asm/uaccess.h>
 #include <asm/page.h>
@@ -86,9 +87,13 @@ sys_ptrace(long request, long pid, long addr, long data)
        ret = -EPERM;
        
        if (request == PTRACE_TRACEME) {
+               /* are we already being traced? */
                if (current->ptrace & PT_PTRACED)
                        goto out;
-
+               ret = security_ptrace(current->parent, current);
+               if (ret)
+                       goto out;
+               /* set the ptrace bit in the process flags. */
                current->ptrace |= PT_PTRACED;
                ret = 0;
                goto out;
@@ -207,7 +212,7 @@ sys_ptrace(long request, long pid, long addr, long data)
                case PTRACE_KILL:
                        ret = 0;
                        
-                       if (child->state == TASK_ZOMBIE)
+                       if (child->exit_state == EXIT_ZOMBIE)
                                break;
                        
                        child->exit_code = SIGKILL;