]> sourceware.org Git - systemtap.git/commitdiff
Fixed __stp_utrace_attach by always checking for mm.
authorDavid Smith <dsmith@redhat.com>
Wed, 11 Feb 2009 15:29:22 +0000 (09:29 -0600)
committerDavid Smith <dsmith@redhat.com>
Wed, 11 Feb 2009 15:29:22 +0000 (09:29 -0600)
2009-02-11  David Smith  <dsmith@redhat.com>

        * task_finder.c (__stp_utrace_attach): Still checks for mm after
        checking task's flags for PF_KTHREAD.

runtime/ChangeLog
runtime/task_finder.c

index df765169a90df9b0e44715b9b3779687be1b8649..2eb1cdaf99eb3769af8ae0d98d7fcb3e2c6d0c58 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-11  David Smith  <dsmith@redhat.com>
+
+       * task_finder.c (__stp_utrace_attach): Still checks for mm after
+       checking task's flags for PF_KTHREAD.
+
 2009-02-10  David Smith  <dsmith@redhat.com>
 
        * task_finder.c (stap_utrace_detach_ops): Fixed typo.
index e058c1916f2331fac5d3e05154cadae909db6212..9db713c3b551ae13679b284cea7bcfc1d3c38e2f 100644 (file)
@@ -413,9 +413,7 @@ __stp_utrace_attach(struct task_struct *tsk,
                    enum utrace_resume_action action)
 {
        struct utrace_attached_engine *engine;
-#ifndef PF_KTHREAD
        struct mm_struct *mm;
-#endif
        int rc = 0;
 
        // Ignore init
@@ -426,13 +424,14 @@ __stp_utrace_attach(struct task_struct *tsk,
        // Ignore kernel threads
        if (tsk->flags & PF_KTHREAD)
                return EPERM;
-#else
-       // Ignore threads with no mm (which are kernel threads).
+#endif
+
+       // Ignore threads with no mm (which are either kernel threads
+       // or "mortally wounded" threads).
        mm = get_task_mm(tsk);
        if (! mm)
                return EPERM;
        mmput(mm);
-#endif
 
        engine = utrace_attach_task(tsk, UTRACE_ATTACH_CREATE, ops, data);
        if (IS_ERR(engine)) {
This page took 0.030914 seconds and 5 git commands to generate.