From f02fa988a4f37292d0da10f086901246d65013c0 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 11 Feb 2009 09:29:22 -0600 Subject: Fixed __stp_utrace_attach by always checking for mm. 2009-02-11 David Smith * task_finder.c (__stp_utrace_attach): Still checks for mm after checking task's flags for PF_KTHREAD. --- runtime/task_finder.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'runtime/task_finder.c') 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)) { -- cgit