staging: android: binder: fix alignment issues
authorSerban Constantinescu <serban.constantinescu@arm.com>
Thu, 4 Jul 2013 09:54:46 +0000 (10:54 +0100)
committerArve Hjønnevåg <arve@android.com>
Sat, 1 Feb 2014 01:35:46 +0000 (01:35 +0000)
commit74a9e70a3f31c2175541d935658bfedbe386d2a0
tree0dfe8c84687d6037902e32188c5f2f1f8c88a177
parent032f0c2707ac7f21114eda0889bacda10156a2da
staging: android: binder: fix alignment issues

The Android userspace aligns the data written to the binder buffers to
4bytes. Thus for 32bit platforms or 64bit platforms running an 32bit
Android userspace we can have a buffer looking like this:

platform    buffer(binder_cmd   pointer)      size
32/32                 32b         32b          8B
64/32                 32b         64b          12B
64/64                 32b         64b          12B

Thus the kernel needs to check that the buffer size is aligned to 4bytes
not to (void *) that will be 8bytes on 64bit machines.

The change does not affect existing 32bit ABI.

Change-Id: I7535f07301519623ea6334f525d312d687407ed4
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/binder.c