Red Hat Bugzilla – Bug 157707
Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Last modified: 2007-11-30 17:07:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.2) Gecko/20040803
Description of problem:
In certain cases, proc_pid_stat() can dereference an invalid ->real_parent if the task is in the TASK_DEAD state. The same problem had existed in task_state(), but was fixed by calling pid_alive() to see if the task was alive or not before dereferencing any of the task's pointer fields. A similar fix should go into proc_pid_stat().
This same problem was also reported to lkml here:
and was fixed in the 2.6.11 kernel.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run any program that will read /proc task entries (eg. top, ps)
2. Start various processes that exit (or can be killed) while top, ps, etc. is
running. In some cases, proc_pid_stat() will deal with a task that is marked
TASK_DEAD, and dereferencing ->real_parent will cause an oops.
Created attachment 114363 [details]
Proposed kernel patch to fix the oops in proc_pid_stat().
this bug should be fixed in the RHEL4-U1 kernel.