hidl_memory: fail on transfer if size > SIZE_MAX
hidl_memory's size is stored in uint64_t, but mapMemory's mmap will map
size in size_t. If size is over SIZE_MAX, mapMemory could succeed
but the mapped memory's actual size will be smaller than the reported size.
This CL makes sure that if hidl_memory enters from another process
and then is used in other functions (but not mapMemory), it will
still trigger this bug.
(cherry picked from commit 45f69c6a4400aaf9d521207ffa7c1aa446bf1c21)
1 file changed