Closed
Bug 1400042
Opened 7 years ago
Closed 6 years ago
Remove base::SetAllFDsToCloseOnExec
Categories
(Core :: IPC, enhancement, P3)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: jld, Assigned: jld)
References
Details
Attachments
(1 file)
As the comments around it point out, base::SetAllFDsToCloseOnExec is inherently racy: another thread can create a non-close-on-exec fd after that function is called and before the spawn, which would then leak a copy into the child. APIs to create fds with the close-on-exec bit already set aren't always portable, and in practice aren't used consistently even when there is a standard.
Currently, SetAllFDsToCloseOnExec is used by process_util_bsd and process_util_mac, because they use posix_spawn rather than fork and can't ru code to iterate open file descriptors in the forked child; I'll file platform-specific bugs for them.
![]() |
||
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jld
Assignee | ||
Comment 1•6 years ago
|
||
As the comments indicate, it has unavoidable race conditions in a
multithreaded program, and its call sites have all been removed.
Comment 2•6 years ago
|
||
Comment on attachment 9011169 [details]
Bug 1400042 - Remove SetAllFDsToCloseOnExec
Andrew McCreight [:mccr8] has approved the revision.
Attachment #9011169 -
Flags: review+
Pushed by jedavis@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/991ffc61729e
Remove SetAllFDsToCloseOnExec r=mccr8
Comment 4•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•6 years ago
|
status-firefox57:
affected → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•