kern/62890: proc pointer set by fork1 can be stale in fork,rfork,vfork

Stephan Uphoff ups at tree.com
Sun Feb 15 14:30:23 PST 2004


>Number:         62890
>Category:       kern
>Synopsis:       proc pointer set by fork1 can be stale in fork,rfork,vfork
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 15 14:30:22 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Stephan Uphoff
>Release:        current 15 Feb 2004
>Organization:
>Environment:
N/A
>Description:
fork(),rfork(),vfork() call fork1() to create a child process
and to obtain a pointer to the new proc structure.
They then use the pointer to the proc structure
to obtain the child's pid.

However if the parent process is not interested in waiting for the child
then the child process might already be dead and its proc structure
recycled by the time fork(),rfork(),vfork() try to obtain the pid.

>How-To-Repeat:
      
>Fix:
Add pidp parameter to fork1() and use it.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list