Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157707 - Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Summary: Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Ingo Molnar
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-05-13 21:59 UTC by Michael Gaughen
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: 2.6.9-11.EL
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-15 22:43:11 UTC


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

Description Michael Gaughen 2005-05-13 21:59:10 UTC
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 22:01:45 UTC
Created attachment 114363 [details]
Proposed kernel patch to fix the oops in proc_pid_stat().

Comment 2 Ingo Molnar 2005-09-15 22:43:11 UTC
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.