summaryrefslogtreecommitdiff
path: root/libs/gui/ScreenCaptureResults.cpp
diff options
context:
space:
mode:
author Brian Duddie <bduddie@google.com> 2022-08-25 18:54:13 +0000
committer Brian Duddie <bduddie@google.com> 2022-08-27 01:16:40 +0000
commit00c6200208198ded9de3d8238963f9432df8a643 (patch)
tree9a3093ba61a4122b17a85f0b880b58d1fbe131ae /libs/gui/ScreenCaptureResults.cpp
parent5c641af5cf5d9f7a0c1c4904363cc1509f42b9b9 (diff)
Fix double-close on direct channel registration
In the AIDL sensor HAL wrapper, file descriptors associated with a direct channel were being wrapped in the AIDL NativeHandle type using makeToAidl(), which ends up taking ownership of the fds, and unintentionally closing them when the object goes out of scope (via ndk::ScopedFileDescriptor), so the same fds would be closed at a later point when the original native_handle_t is closed. Switch to dupToAidl() which does not take ownership of the input file handles. Bug: 234456046 Test: apply fdsan protection (in different CL), confirm via test-sensorservice that the file descriptor is not closed twice Change-Id: I51c0ba0f31b43c56bf055d186a599b289ca0065f
Diffstat (limited to 'libs/gui/ScreenCaptureResults.cpp')
0 files changed, 0 insertions, 0 deletions