Re: oops in proc_pid_stat() on task->real_parent?

From: Andrew Morton
Date: Wed Dec 08 2004 - 01:19:59 EST


Chris Wright <chrisw@xxxxxxxx> wrote:
>
> * Andrew Morton (akpm@xxxxxxxx) wrote:
> > yup, we fixed that one.
>
> I thought the same thing, but this oops is from proc_pid_stat, not
> proc_pid_status. The code is now in do_task_stat(), and the oops is
> within the orignal tasklist lock (instead of dropping and reaquiring the
> lock). So, might be fixed, but if so, I think for a different reason.
>

Ah, thanks.

I'm not sure that the holding of tasklist_lock is going to save us there.
But then, Manfred recently did an audit, so I'm probably missing something.

Manfred, should we do this?

--- 25/fs/proc/array.c~do_task_stat-use-pid_alive 2004-12-07 22:17:01.378528576 -0800
+++ 25-akpm/fs/proc/array.c 2004-12-07 22:17:10.140196600 -0800
@@ -370,7 +370,7 @@ static int do_task_stat(struct task_stru
stime += task->signal->stime;
}
}
- ppid = task->pid ? task->group_leader->real_parent->tgid : 0;
+ ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0;
read_unlock(&tasklist_lock);

if (!whole || num_threads<2)
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/