[BusyBox 0000732]: incorrect use of vfork leads to corruption/crash

bugs at busybox.net bugs at busybox.net
Sun Feb 19 06:34:42 UTC 2006


The following issue has been UPDATED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=732 
====================================================================== 
Reported By:                rfelker
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   732
Category:                   Other
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-18-2006 21:02 PST
Last Modified:              02-18-2006 22:34 PST
====================================================================== 
Summary:                    incorrect use of vfork leads to corruption/crash
Description: 
vfork is used in place of fork several places in busybox. As far as I can
tell, they are all incorrect according to susv3
(http://www.opengroup.org/onlinepubs/009695399/functions/vfork.html) and I
have confirmed that the one in tar.c causes memory corruption/crash on
implementations that actually provide a true vfork rather than just
mapping vfork to fork.

Specifics of the incorrect usage: dup2 and close are called after vfork.
According to the spec, no function other than exec* or _exit may be called
by the child process after vfork.

====================================================================== 

---------------------------------------------------------------------- 
 vapier - 02-18-06 22:01  
---------------------------------------------------------------------- 
the only places vfork is used in uClibc is in popen() and system() and both
look just fine to me 

---------------------------------------------------------------------- 
 rfelker - 02-18-06 22:21  
---------------------------------------------------------------------- 
As you can see, this bug is filed under busybox. :)
My bad for saying uClibc in the description. Everything else I said still
applies (to busybox). 

---------------------------------------------------------------------- 
 vapier - 02-18-06 22:34  
---------------------------------------------------------------------- 
most of the time, vfork is used instead of fork so that busybox will work
nicely on uClinux systems 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-18-06 21:02  rfelker        New Issue                                    
02-18-06 21:02  rfelker        Status                   new => assigned     
02-18-06 21:02  rfelker        Assigned To               => BusyBox         
02-18-06 22:01  vapier         Note Added: 0001106                          
02-18-06 22:21  rfelker        Note Added: 0001107                          
02-18-06 22:34  vapier         Note Added: 0001108                          
02-18-06 22:34  vapier         Description Updated                          
======================================================================




More information about the busybox-cvs mailing list