summaryrefslogtreecommitdiffstats
path: root/runtime/task_finder.c
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-02-11 09:29:22 -0600
committerDavid Smith <dsmith@redhat.com>2009-02-11 09:29:22 -0600
commitf02fa988a4f37292d0da10f086901246d65013c0 (patch)
tree90c74c290df9aa00ebbc3f0c130cb32c8a40ff31 /runtime/task_finder.c
parent3a66ad568254853a195035bd8deca3d38dde27d2 (diff)
downloadsystemtap-steved-f02fa988a4f37292d0da10f086901246d65013c0.tar.gz
systemtap-steved-f02fa988a4f37292d0da10f086901246d65013c0.tar.xz
systemtap-steved-f02fa988a4f37292d0da10f086901246d65013c0.zip
Fixed __stp_utrace_attach by always checking for mm.
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.
Diffstat (limited to 'runtime/task_finder.c')
-rw-r--r--runtime/task_finder.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index e058c191..9db713c3 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -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)) {