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.

Bug: 79376389
Test: hidl_test
Merged-In: Id5c8682627fdb1701e95b049d198bbcd0e3513d3
Change-Id: Id5c8682627fdb1701e95b049d198bbcd0e3513d3
(cherry picked from commit 45f69c6a4400aaf9d521207ffa7c1aa446bf1c21)
1 file changed