Bug 157707

Summary: Oops in proc_pid_stat() when dereferencing ->real_parent in a dead task.
Product: Red Hat Enterprise Linux 4 Reporter: Michael Gaughen <mgaughen>
Component: kernelAssignee: Ingo Molnar <mingo>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: davej, djn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.9-11.EL Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-15 22:43:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed kernel patch to fix the oops in proc_pid_stat(). none

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.