Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 2004 14:25:36 -0800 (PST)
From:      Stephan Uphoff <ups@tree.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/62890: proc pointer set by fork1 can be stale in fork,rfork,vfork
Message-ID:  <200402152225.i1FMPaVE056541@www.freebsd.org>
Resent-Message-ID: <200402152230.i1FMUNSd058719@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402152225.i1FMPaVE056541>