23 lines · plain
1.. title:: clang-tidy - android-cloexec-pipe22 3android-cloexec-pipe24=====================5 6This check ensures that ``pipe2()`` is called with the ``O_CLOEXEC`` flag.7The check also adds the ``O_CLOEXEC`` flag that marks the file descriptor8to be closed in child processes.9Without this flag a sensitive file descriptor can be leaked to a child process,10potentially into a lower-privileged SELinux domain.11 12Examples:13 14.. code-block:: c++15 16 pipe2(pipefd, O_NONBLOCK);17 18Suggested replacement:19 20.. code-block:: c++21 22 pipe2(pipefd, O_NONBLOCK | O_CLOEXEC);23