public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/14782] New: system() wrongly enables asynchronous cancellation
@ 2012-10-29  1:12 bugdal at aerifal dot cx
  2012-10-29  3:26 ` [Bug libc/14782] " cat at vv dot carleton.ca
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugdal at aerifal dot cx @ 2012-10-29  1:12 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14782

             Bug #: 14782
           Summary: system() wrongly enables asynchronous cancellation
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bugdal@aerifal.cx
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


In sysdeps/posix/system.c, __libc_system function wrongly enables asynchronous
cancellation around the call to do_system, which in turn performs many
operations which are not async-cancel-safe such as obtaining locks and changing
signal dispositions. Thus, cancelling a thread that is calling system() can
lead to corruption of the internal state.

There is no purpose to enabling asynchronous cancellation; the only call in
do_system() which does not return immediately is waitpid, and waitpid is a
cancellation point, so normal deferred cancellation will yield the correct
behavior.

Removing the unneeded and harmful use of asynchronous cancellation state also
eliminates the need for the clone() hack in lines 27-38 of
sysdeps/unix/sysv/linux/system.c.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-13 10:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29  1:12 [Bug libc/14782] New: system() wrongly enables asynchronous cancellation bugdal at aerifal dot cx
2012-10-29  3:26 ` [Bug libc/14782] " cat at vv dot carleton.ca
2014-01-10 20:46 ` carlos at redhat dot com
2014-01-15 17:42 ` cvs-commit at gcc dot gnu.org
2014-01-18 15:02 ` cvs-commit at gcc dot gnu.org
2014-06-13 10:12 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).