Bug 20178 - posix_spawn{p} should not call exit
Summary: posix_spawn{p} should not call exit
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: 2.24
Assignee: Adhemerval Zanella
Depends on:
Blocks: 10354 14750 18433
  Show dependency treegraph
Reported: 2016-05-30 13:02 UTC by Adhemerval Zanella
Modified: 2016-06-08 09:26 UTC (History)
1 user (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Adhemerval Zanella 2016-05-30 13:02:11 UTC
The new posix_spawn{p} implementation [1] call exit on failure case where it should call _exit.  Although POSIX allows posix_spawn to call atfork handlers, it introduces opportunities for atfork-related race conditions and add performance overhead from handler calling (BZ#14499).

[1] Commit 9ff72da471a509a8c19791efe469f47fa6977410
Comment 1 Adhemerval Zanella 2016-05-30 14:02:12 UTC
Fixed by 3e040a2d5f59c5494910bd6451b3dcb69221a047.
Comment 2 cvs-commit@gcc.gnu.org 2016-05-30 14:02:24 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3e040a2d5f59c5494910bd6451b3dcb69221a047 (commit)
      from  c30c3f46a5f2e60639dab888c487397b579942e9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

commit 3e040a2d5f59c5494910bd6451b3dcb69221a047
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon May 30 10:04:47 2016 -0300

    posix: Call _exit in failure case for posix_spawn{p} (BZ#20178)
    This patch call _exit instead of exit in failure case for the spawned
    child in Linux posix_spawn{p} implementation.
    Tested on x86_64.
    	[BZ #20178]
    	* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Call _exit
    	on failure instead of exit.


Summary of changes:
 ChangeLog                        |    6 ++++++
 sysdeps/unix/sysv/linux/spawni.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)