diff options
author | Nick Kralevich <nnk@google.com> | 2018-12-17 14:41:59 -0800 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2018-12-17 14:48:35 -0800 |
commit | 1de009645c3e315e749bae7246f9a2972c80a051 (patch) | |
tree | 07980b8e5a9604d403397b5ebd3619d4ecf5c3cb /tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp | |
parent | bc292422885b64d369c3420e1eb55a039dfdeeec (diff) |
NativeHandle.java: dup() with O_CLOEXEC
Don't use Os.dup(), as it creates file handles which leak across exec()
boundaries. Instead, use fcntl(F_DUPFD_CLOEXEC);
O_CLOEXEC is essential for ensuring that file descriptors do not leak
across an exec() boundary. Setting O_CLOEXEC ensures that file
descriptors can't linger around unnecessarily in an exec()ed process
which doesn't use them, making more efficient use of resources.
Additionally, O_CLOEXEC is important in ensuring that untrusted
exec()ed code cannot take advantage of leaked file descriptors.
Test: Android compiles and boots
Bug: 120983106
Change-Id: I99a66834cc6b9bb25e1b4daf75384ec6a91ae9e2
Diffstat (limited to 'tests/DynamicCodeLoggerIntegrationTests/src/cpp/test_executable.cpp')
0 files changed, 0 insertions, 0 deletions