diff options
author | Josh Gao <jmgao@google.com> | 2019-01-07 19:16:21 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2019-02-13 13:21:54 -0800 |
commit | 14f9500a35390e2e0252ccc1c03c9c850444e2b6 (patch) | |
tree | f077e9888c7faeea00fc2e8dc532152e772a7fce /trusty/coverage/coverage_test.cpp | |
parent | 5272f9b017e2e32551ec53c680b9869b0ec135d2 (diff) |
base: add helpers for sending/receiving file descriptors.
Almost all of the uses of cmsg(3) in our source tree are wrong in at
least one of the following ways:
- not aligning the cmsg buffer
- leaking fds if more fds are received than expected
- blindly dereferencing CMSG_DATA without checking the header
- using CMSG_SPACE instead of CMSG_LEN for .cmsg_len
- using CMSG_LEN instead of CMSG_SPACE for .msg_controllen
- using a length specified in number of fds instead of bytes
Implement wrapper functions that implement this dumpster fire of an
API correctly.
Bug: http://b/122047630
Test: libbase_test32
Change-Id: I6ac34d67bbbf1bfa9727ab598248fc178ea19df9
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions