summaryrefslogtreecommitdiffstats
path: root/drivers/android/binder_alloc.h
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@android.com>2019-02-08 19:35:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-12 10:43:57 +0100
commitbde4a19fc04f5f46298c86b1acb7a4af1d5f138d (patch)
tree1062d8eaaf1dbfc760c295387390de1f4022e64c /drivers/android/binder_alloc.h
parentbinder: remove user_buffer_offset (diff)
downloadlinux-bde4a19fc04f5f46298c86b1acb7a4af1d5f138d.tar.xz
linux-bde4a19fc04f5f46298c86b1acb7a4af1d5f138d.zip
binder: use userspace pointer as base of buffer space
Now that alloc->buffer points to the userspace vm_area rename buffer->data to buffer->user_data and rename local pointers that hold user addresses. Also use the "__user" tag to annotate all user pointers so sparse can flag cases where user pointer vaues are copied to kernel pointers. Refactor code to use offsets instead of user pointers. Signed-off-by: Todd Kjos <tkjos@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder_alloc.h')
-rw-r--r--drivers/android/binder_alloc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h
index 1026e9fb20db..b60d161b7a7a 100644
--- a/drivers/android/binder_alloc.h
+++ b/drivers/android/binder_alloc.h
@@ -40,7 +40,7 @@ struct binder_transaction;
* @data_size: size of @transaction data
* @offsets_size: size of array of offsets
* @extra_buffers_size: size of space for other objects (like sg lists)
- * @data: pointer to base of buffer space
+ * @user_data: user pointer to base of buffer space
*
* Bookkeeping structure for binder transaction buffers
*/
@@ -59,7 +59,7 @@ struct binder_buffer {
size_t data_size;
size_t offsets_size;
size_t extra_buffers_size;
- void *data;
+ void __user *user_data;
};
/**
@@ -102,7 +102,7 @@ struct binder_alloc {
struct mutex mutex;
struct vm_area_struct *vma;
struct mm_struct *vma_vm_mm;
- void *buffer;
+ void __user *buffer;
struct list_head buffers;
struct rb_root free_buffers;
struct rb_root allocated_buffers;