Trivial. Pick the new "random" value to use it instead of PT_PTRACED.
We need this old or new bit only to make sure task_ptrace() != 0.

This allows us to simplify/lessen the first patch(es) we are going
to send to lkml, because now we can drop some of unnecessary changes
outside of ptrace.c.

See the next patch as an example.

---

 kernel/ptrace.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- PU/kernel/ptrace.c~112_PT_UTRACED   2009-10-21 19:43:59.000000000 +0200
+++ PU/kernel/ptrace.c  2009-10-21 19:57:49.000000000 +0200
@@ -36,6 +36,8 @@ struct ptrace_context {
        enum utrace_resume_action resume;
 };
 
+#define PT_UTRACED                     0x00001000
+
 #define PTRACE_O_SYSEMU                        0x100
 
 #define PTRACE_EVENT_SYSCALL_ENTRY     (1 << 16)
@@ -518,7 +520,7 @@ static int ptrace_attach_task(struct tas
                return PTR_ERR(engine);
        /*
         * It can fail only if the tracee is dead, the caller
-        * must notice this before setting PT_PTRACED.
+        * must notice this before setting PT_UTRACED.
         */
        err = __ptrace_set_options(tracee, engine, options);
        WARN_ON(err && !tracee->exit_state);
@@ -645,7 +647,7 @@ int ptrace_attach(struct task_struct *ta
                goto unlock_tasklist;
 
        BUG_ON(task->ptrace);
-       task->ptrace = PT_PTRACED;
+       task->ptrace = PT_UTRACED;
        if (capable(CAP_SYS_PTRACE))
                task->ptrace |= PT_PTRACE_CAP;
 
@@ -664,7 +666,7 @@ out:
 /**
  * ptrace_traceme  --  helper for PTRACE_TRACEME
  *
- * Performs checks and sets PT_PTRACED.
+ * Performs checks and sets PT_UTRACED.
  * Should be used by all ptrace implementations for PTRACE_TRACEME.
  */
 int ptrace_traceme(void)
@@ -685,7 +687,7 @@ int ptrace_traceme(void)
         * pretend ->real_parent untraces us right after return.
         */
        if (!ret && !(current->real_parent->flags & PF_EXITING)) {
-               current->ptrace = PT_PTRACED;
+               current->ptrace = PT_UTRACED;
                __ptrace_link(current, current->real_parent);
                detach = false;
        }

Reply via email to