diff options
author | David Smith <dsmith@redhat.com> | 2009-02-11 09:29:22 -0600 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-02-11 09:29:22 -0600 |
commit | f02fa988a4f37292d0da10f086901246d65013c0 (patch) | |
tree | 90c74c290df9aa00ebbc3f0c130cb32c8a40ff31 /runtime/task_finder.c | |
parent | 3a66ad568254853a195035bd8deca3d38dde27d2 (diff) | |
download | systemtap-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.c | 9 |
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)) { |