summaryrefslogtreecommitdiff
path: root/libcutils/socket_local_server_unix.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-06-19 10:27:38 -0700
committerAdam Lesinski <adamlesinski@google.com>2017-07-25 18:12:12 +0000
commitde117e4a49d6ed047c0c1a9270be5d8a191aa2db (patch)
tree6980dbd94bc71f9de0f56e4289ae7c925bfe5930 /libcutils/socket_local_server_unix.cpp
parentc31963b5c255d57e162f4666f80b438ac74413ac (diff)
libziparchive: Use ReadAtOffset exclusively
The use of ReadAtOffset is meant to allow concurrent access to the zip archive once it has been loaded. There were places where this was the case, and some places that did a seek + read combination, which could lead to data races. NOTE: On Windows, we are not using pread as the implementation of ReadAtOffset, therefore the guarantees on Windows are weaker. On Linux, pread allows the file descriptor to be read at a specific offset without changing the read pointer. This allows inherited fd's and duped fds to be read concurrently. On Windows, we use the ReadFile API, which allows for an atomic seek + read operation, but modifies the read pointer. This means that any mix use of ReadAtOffset and Read will have races. Just using ReadAtOffset is safe. For the Windows case, this is fine as the libziparchive code now only uses ReadAtOffset. Bug: 62184114 Bug: 62101783 Test: make ziparchive-tests (existing tests pass) Change-Id: Ia7f9a30af2216682cdd9d578d26e84bc46773bb9
Diffstat (limited to 'libcutils/socket_local_server_unix.cpp')
0 files changed, 0 insertions, 0 deletions