Do not use engine->data. It should point to struct ptrace_context (or,
perhaps, struct utrace_ptrace ?)

Indeed! now "make check" does not crash the kernel. Of course, I see
a lot of FAIL's but not too much: 8. Upstream kernel reports 4/39
tests failed (under KVM).

---

--- PU/kernel/ptrace.c~06_DONT_USE_DATA 2009-08-13 18:23:43.000000000 +0200
+++ PU/kernel/ptrace.c  2009-08-13 18:41:46.000000000 +0200
@@ -259,7 +259,7 @@ static u32 ptrace_report_clone(enum utra
                                                  UTRACE_ATTACH_EXCLUSIVE |
                                                  UTRACE_ATTACH_MATCH_OPS,
                                                  &ptrace_utrace_ops,
-                                                 parent->parent);
+                                                 NULL);
                if (unlikely(IS_ERR(child_engine))) {
                        WARN_ON(1);     /* XXX */
                } else {
@@ -476,9 +476,8 @@ static int finish_ptrace_attach(struct t
        if (retval) {
                int error = utrace_control(task, engine, UTRACE_DETACH);
                WARN_ON(error && error != -ESRCH && error != -EALREADY);
-       } else {
-               engine->data = task->parent;
        }
+
        utrace_engine_put(engine);
        return retval;
 }
@@ -495,7 +494,7 @@ static struct utrace_engine *prepare_ptr
        engine = utrace_attach_task(child, UTRACE_ATTACH_CREATE |
                                    UTRACE_ATTACH_EXCLUSIVE |
                                    UTRACE_ATTACH_MATCH_OPS,
-                                   &ptrace_utrace_ops, parent);
+                                   &ptrace_utrace_ops, NULL);
 
        if (IS_ERR(engine)) {
                if (engine != ERR_PTR(-ESRCH) &&

Reply via email to