aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/android
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 19:20:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 19:20:22 -0400
commitabf7dba7c4f77d781f6df50fefb19a64c5dc331f (patch)
tree38648731b502d5aec508f3b33f6616190e598eb6 /drivers/android
parent07c4dd3435aa387d3b58f4e941dc516513f14507 (diff)
parentb23220fe054e92f616b82450fae8cd3ab176cc60 (diff)
Merge tag 'char-misc-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the "big" char and misc driver patches for 4.18-rc1. It's not a lot of stuff here, but there are some highlights: - coreboot driver updates - soundwire driver updates - android binder updates - fpga big sync, mostly documentation - lots of minor driver updates All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (81 commits) vmw_balloon: fixing double free when batching mode is off MAINTAINERS: Add driver-api/fpga path fpga: clarify that unregister functions also free documentation: fpga: move fpga-region.txt to driver-api documentation: fpga: add bridge document to driver-api documentation: fpga: move fpga-mgr.txt to driver-api Documentation: fpga: move fpga overview to driver-api fpga: region: kernel-doc fixes fpga: bridge: kernel-doc fixes fpga: mgr: kernel-doc fixes fpga: use SPDX fpga: region: change api, add fpga_region_create/free fpga: bridge: change api, don't use drvdata fpga: manager: change api, don't use drvdata fpga: region: don't use drvdata in common fpga code Drivers: hv: vmbus: Removed an unnecessary cast from void * ver_linux: Drop redundant calls to system() to test if file is readable ver_linux: Move stderr redirection from function parameter to function body misc: IBM Virtual Management Channel Driver (VMC) rpmsg: Correct support for MODULE_DEVICE_TABLE() ...
Diffstat (limited to 'drivers/android')
-rw-r--r--drivers/android/Kconfig15
-rw-r--r--drivers/android/binder.c17
-rw-r--r--drivers/android/binder_alloc.c6
3 files changed, 12 insertions, 26 deletions
diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
index 7dce3795b887..ee4880bfdcdc 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -10,7 +10,7 @@ if ANDROID
10 10
11config ANDROID_BINDER_IPC 11config ANDROID_BINDER_IPC
12 bool "Android Binder IPC Driver" 12 bool "Android Binder IPC Driver"
13 depends on MMU 13 depends on MMU && !M68K
14 default n 14 default n
15 ---help--- 15 ---help---
16 Binder is used in Android for both communication between processes, 16 Binder is used in Android for both communication between processes,
@@ -32,19 +32,6 @@ config ANDROID_BINDER_DEVICES
32 created. Each binder device has its own context manager, and is 32 created. Each binder device has its own context manager, and is
33 therefore logically separated from the other devices. 33 therefore logically separated from the other devices.
34 34
35config ANDROID_BINDER_IPC_32BIT
36 bool "Use old (Android 4.4 and earlier) 32-bit binder API"
37 depends on !64BIT && ANDROID_BINDER_IPC
38 default y
39 ---help---
40 The Binder API has been changed to support both 32 and 64bit
41 applications in a mixed environment.
42
43 Enable this to support an old 32-bit Android user-space (v4.4 and
44 earlier).
45
46 Note that enabling this will break newer Android user-space.
47
48config ANDROID_BINDER_IPC_SELFTEST 35config ANDROID_BINDER_IPC_SELFTEST
49 bool "Android Binder IPC Driver Selftest" 36 bool "Android Binder IPC Driver Selftest"
50 depends on ANDROID_BINDER_IPC 37 depends on ANDROID_BINDER_IPC
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index e578eee31589..95283f3bb51c 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -72,10 +72,6 @@
72#include <linux/security.h> 72#include <linux/security.h>
73#include <linux/spinlock.h> 73#include <linux/spinlock.h>
74 74
75#ifdef CONFIG_ANDROID_BINDER_IPC_32BIT
76#define BINDER_IPC_32BIT 1
77#endif
78
79#include <uapi/linux/android/binder.h> 75#include <uapi/linux/android/binder.h>
80#include "binder_alloc.h" 76#include "binder_alloc.h"
81#include "binder_trace.h" 77#include "binder_trace.h"
@@ -2058,8 +2054,8 @@ static size_t binder_validate_object(struct binder_buffer *buffer, u64 offset)
2058 struct binder_object_header *hdr; 2054 struct binder_object_header *hdr;
2059 size_t object_size = 0; 2055 size_t object_size = 0;
2060 2056
2061 if (offset > buffer->data_size - sizeof(*hdr) || 2057 if (buffer->data_size < sizeof(*hdr) ||
2062 buffer->data_size < sizeof(*hdr) || 2058 offset > buffer->data_size - sizeof(*hdr) ||
2063 !IS_ALIGNED(offset, sizeof(u32))) 2059 !IS_ALIGNED(offset, sizeof(u32)))
2064 return 0; 2060 return 0;
2065 2061
@@ -3925,10 +3921,11 @@ retry:
3925 binder_inner_proc_unlock(proc); 3921 binder_inner_proc_unlock(proc);
3926 if (put_user(e->cmd, (uint32_t __user *)ptr)) 3922 if (put_user(e->cmd, (uint32_t __user *)ptr))
3927 return -EFAULT; 3923 return -EFAULT;
3924 cmd = e->cmd;
3928 e->cmd = BR_OK; 3925 e->cmd = BR_OK;
3929 ptr += sizeof(uint32_t); 3926 ptr += sizeof(uint32_t);
3930 3927
3931 binder_stat_br(proc, thread, e->cmd); 3928 binder_stat_br(proc, thread, cmd);
3932 } break; 3929 } break;
3933 case BINDER_WORK_TRANSACTION_COMPLETE: { 3930 case BINDER_WORK_TRANSACTION_COMPLETE: {
3934 binder_inner_proc_unlock(proc); 3931 binder_inner_proc_unlock(proc);
@@ -4696,7 +4693,7 @@ static void binder_vma_close(struct vm_area_struct *vma)
4696 binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES); 4693 binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES);
4697} 4694}
4698 4695
4699static int binder_vm_fault(struct vm_fault *vmf) 4696static vm_fault_t binder_vm_fault(struct vm_fault *vmf)
4700{ 4697{
4701 return VM_FAULT_SIGBUS; 4698 return VM_FAULT_SIGBUS;
4702} 4699}
@@ -4730,7 +4727,9 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
4730 failure_string = "bad vm_flags"; 4727 failure_string = "bad vm_flags";
4731 goto err_bad_arg; 4728 goto err_bad_arg;
4732 } 4729 }
4733 vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE; 4730 vma->vm_flags |= VM_DONTCOPY | VM_MIXEDMAP;
4731 vma->vm_flags &= ~VM_MAYWRITE;
4732
4734 vma->vm_ops = &binder_vm_ops; 4733 vma->vm_ops = &binder_vm_ops;
4735 vma->vm_private_data = proc; 4734 vma->vm_private_data = proc;
4736 4735
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 5a426c877dfb..4f382d51def1 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -219,7 +219,7 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
219 mm = alloc->vma_vm_mm; 219 mm = alloc->vma_vm_mm;
220 220
221 if (mm) { 221 if (mm) {
222 down_write(&mm->mmap_sem); 222 down_read(&mm->mmap_sem);
223 vma = alloc->vma; 223 vma = alloc->vma;
224 } 224 }
225 225
@@ -288,7 +288,7 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
288 /* vm_insert_page does not seem to increment the refcount */ 288 /* vm_insert_page does not seem to increment the refcount */
289 } 289 }
290 if (mm) { 290 if (mm) {
291 up_write(&mm->mmap_sem); 291 up_read(&mm->mmap_sem);
292 mmput(mm); 292 mmput(mm);
293 } 293 }
294 return 0; 294 return 0;
@@ -321,7 +321,7 @@ err_page_ptr_cleared:
321 } 321 }
322err_no_vma: 322err_no_vma:
323 if (mm) { 323 if (mm) {
324 up_write(&mm->mmap_sem); 324 up_read(&mm->mmap_sem);
325 mmput(mm); 325 mmput(mm);
326 } 326 }
327 return vma ? -ENOMEM : -ESRCH; 327 return vma ? -ENOMEM : -ESRCH;