Validate incoming data from the kernel.

Make sure that every buffer we read from the kernel
has the size we expect, that its parent buffer (if any)
and the offset within that buffer is what we expect.

Also added code for verifying native_handle_t properly.
Note that this changes the wire format for sending native
handles across.

Bug: 30498700
Test: hidl_test, hidl_test_java, Youtube, Maps, Netflix, Camera
Change-Id: I14cc0b3c43d774d29da61b8f037bc1c25ea58c17
Merged-In: I14cc0b3c43d774d29da61b8f037bc1c25ea58c17
2 files changed