diff options
| author | Martijn Coenen <maco@android.com> | 2017-07-28 07:56:06 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-22 21:43:23 -0400 |
| commit | 5cdcf4c6a638591ec0e98c57404a19e7f9997567 (patch) | |
| tree | 6283d4bca0f2749894552eac2f90502bf43d19e9 /include/uapi/linux/android | |
| parent | 6f3d791f300618caf82a2be0c27456edd76d5164 (diff) | |
ANDROID: binder: add padding to binder_fd_array_object.
binder_fd_array_object starts with a 4-byte header,
followed by a few fields that are 8 bytes when
ANDROID_BINDER_IPC_32BIT=N.
This can cause alignment issues in a 64-bit kernel
with a 32-bit userspace, as on x86_32 an 8-byte primitive
may be aligned to a 4-byte address. Pad with a __u32
to fix this.
Signed-off-by: Martijn Coenen <maco@android.com>
Cc: stable <stable@vger.kernel.org> # 4.11+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/android')
| -rw-r--r-- | include/uapi/linux/android/binder.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h index 51f891fb1b18..7668b5791c91 100644 --- a/include/uapi/linux/android/binder.h +++ b/include/uapi/linux/android/binder.h | |||
| @@ -132,6 +132,7 @@ enum { | |||
| 132 | 132 | ||
| 133 | /* struct binder_fd_array_object - object describing an array of fds in a buffer | 133 | /* struct binder_fd_array_object - object describing an array of fds in a buffer |
| 134 | * @hdr: common header structure | 134 | * @hdr: common header structure |
| 135 | * @pad: padding to ensure correct alignment | ||
| 135 | * @num_fds: number of file descriptors in the buffer | 136 | * @num_fds: number of file descriptors in the buffer |
| 136 | * @parent: index in offset array to buffer holding the fd array | 137 | * @parent: index in offset array to buffer holding the fd array |
| 137 | * @parent_offset: start offset of fd array in the buffer | 138 | * @parent_offset: start offset of fd array in the buffer |
| @@ -152,6 +153,7 @@ enum { | |||
| 152 | */ | 153 | */ |
| 153 | struct binder_fd_array_object { | 154 | struct binder_fd_array_object { |
| 154 | struct binder_object_header hdr; | 155 | struct binder_object_header hdr; |
| 156 | __u32 pad; | ||
| 155 | binder_size_t num_fds; | 157 | binder_size_t num_fds; |
| 156 | binder_size_t parent; | 158 | binder_size_t parent; |
| 157 | binder_size_t parent_offset; | 159 | binder_size_t parent_offset; |
