James Peach created MESOS-8027:
----------------------------------

             Summary: os::open doesn't always atomically apply O_CLOEXEC
                 Key: MESOS-8027
                 URL: https://issues.apache.org/jira/browse/MESOS-8027
             Project: Mesos
          Issue Type: Bug
          Components: stout
            Reporter: James Peach


In [r/39180|https://reviews.apache.org/r/39180], the {{os/open.hpp}} header was 
refactored so that it conditionally includes {{fcntl.h}}. However {{fcntl.h}} 
is required to make the {{O_CLOEXEC}} symbol visible, so it is quite likely 
that {{O_CLOEXEC_UNDEFINED}} will be defined even on systems that do actually 
support {{O_CLOEXEC}}. This causes {{os::open}} to fall back to the non-atomic 
open+fcntl sequence, which can leak file descriptors into child processes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to