Bug 157707 - Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ingo Molnar
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-13 17:59 EDT by Michael Gaughen
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: 2.6.9-11.EL
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-15 18:43:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed kernel patch to fix the oops in proc_pid_stat(). (933 bytes, patch)
2005-05-13 18:01 EDT, Michael Gaughen
no flags Details | Diff

  None (edit)
Description Michael Gaughen 2005-05-13 17:59:10 EDT
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:

http://marc.theaimsgroup.com/?l=linux-kernel&m=110246758508105&w=2

and was fixed in the 2.6.11 kernel.



Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

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.
  

Additional info:
Comment 1 Michael Gaughen 2005-05-13 18:01:45 EDT
Created attachment 114363 [details]
Proposed kernel patch to fix the oops in proc_pid_stat().
Comment 2 Ingo Molnar 2005-09-15 18:43:11 EDT
this bug should be fixed in the RHEL4-U1 kernel.

Note You need to log in before you can comment on or make changes to this bug.