Bug 20178

Summary: posix_spawn{p} should not call exit
Product: glibc Reporter: Adhemerval Zanella <adhemerval.zanella>
Component: libcAssignee: Adhemerval Zanella <adhemerval.zanella>
Severity: normal CC: drepper.fsp
Priority: P2 Flags: fweimer: security-
Version: 2.24   
Target Milestone: 2.24   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 10354, 14750, 18433    

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 Sourceware Commits 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(-)