aboutsummaryrefslogtreecommitdiff
path: root/drivers/android
AgeCommit message (Collapse)AuthorFilesLines
2017-07-17binder: refactor queue management in binder_thread_readTodd Kjos1-57/+94
In binder_thread_read, the BINDER_WORK_NODE command is used to communicate the references on the node to userspace. It can take a couple of iterations in the loop to construct the list of commands for user space. When locking is added, the lock would need to be release on each iteration which means the state could change. The work item is not dequeued during this process which prevents a simpler queue management that can just dequeue up front and handle the work item. Fixed by changing the BINDER_WORK_NODE algorithm in binder_thread_read to determine which commands to send to userspace atomically in 1 pass so it stays consistent with the kernel view. The work item is now dequeued immediately since only 1 pass is needed. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: add log information for binder transaction failuresTodd Kjos2-19/+88
Add additional information to determine the cause of binder failures. Adds the following to failed transaction log and kernel messages: return_error : value returned for transaction return_error_param : errno returned by binder allocator return_error_line : line number where error detected Also, return BR_DEAD_REPLY if an allocation error indicates a dead proc (-ESRCH) Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: make binder_last_id an atomicTodd Kjos1-4/+4
Use an atomic for binder_last_id to avoid locking it Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: change binder_stats to atomicsBadhri Jagan Sridharan1-20/+28
Use atomics for stats to avoid needing to lock for increments/decrements Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: add protection for non-perf casesTodd Kjos1-18/+63
Add binder_dead_nodes_lock, binder_procs_lock, and binder_context_mgr_node_lock to protect the associated global lists Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: remove binder_debug_no_lock mechanismTodd Kjos1-23/+8
With the global lock, there was a mechanism to access binder driver debugging information with the global lock disabled to debug deadlocks or other issues. This mechanism is rarely (if ever) used anymore and wasn't needed during the development of fine-grained locking in the binder driver. Removing it. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: move binder_alloc to separate fileTodd Kjos4-763/+923
Move the binder allocator functionality to its own file Continuation of splitting the binder allocator from the binder driver. Split binder_alloc functions from normal binder functions. Add kernel doc comments to functions declared extern in binder_alloc.h Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: separate out binder_alloc functionsTodd Kjos2-248/+410
Continuation of splitting the binder allocator from the binder driver. Separate binder_alloc functions from normal binder functions. Protect the allocator with a separate mutex. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: remove unneeded cleanup codeTodd Kjos1-9/+2
The buffer's transaction has already been freed before binder_deferred_release. No need to do it again. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: separate binder allocator structure from binder procTodd Kjos2-85/+129
The binder allocator is logically separate from the rest of the binder drivers. Separating the data structures to prepare for splitting into separate file with separate locking. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: Use wake up hint for synchronous transactions.Riley Andrews1-2/+6
Use wake_up_interruptible_sync() to hint to the scheduler binder transactions are synchronous wakeups. Disable preemption while waking to avoid ping-ponging on the binder lock. Signed-off-by: Todd Kjos <[email protected]> Signed-off-by: Omprakash Dhyade <[email protected]> Cc: stable <[email protected]> # 4.4+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17binder: use group leader instead of open threadTodd Kjos1-2/+2
The binder allocator assumes that the thread that called binder_open will never die for the lifetime of that proc. That thread is normally the group_leader, however it may not be. Use the group_leader instead of current. Signed-off-by: Todd Kjos <[email protected]> Cc: stable <[email protected]> # 4.4+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-07-17Revert "android: binder: Sanity check at binder ioctl"Todd Kjos1-5/+0
This reverts commit a906d6931f3ccaf7de805643190765ddd7378e27. The patch introduced a race in the binder driver. An attempt to fix the race was submitted in "[PATCH v2] android: binder: fix dangling pointer comparison", however the conclusion in the discussion for that patch was that the original patch should be reverted. The reversion is being done as part of the fine-grained locking patchset since the patch would need to be refactored when proc->vmm_vm_mm is removed from struct binder_proc and added in the binder allocator. Signed-off-by: Todd Kjos <[email protected]> Cc: stable <[email protected]> # 4.6+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-03-17binder: Add 'hwbinder' to the default devicesRob Herring1-1/+1
As AOSP master is now starting to require a hwbinder device, add it to the the default Kconfig. Having the hwbinder device when not needed shouldn't hurt anything either. Cc: Greg Kroah-Hartman <[email protected]> Cc: John Stultz <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to ↵Ingo Molnar1-1/+1
<linux/sched/signal.h> We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/signal.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to ↵Ingo Molnar1-0/+1
<linux/sched/mm.h> We are going to split <linux/sched/mm.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/mm.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. The APIs that are going to be moved first are: mm_alloc() __mmdrop() mmdrop() mmdrop_async_fn() mmdrop_async() mmget_not_zero() mmput() mmput_async() get_task_mm() mm_access() mm_release() Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
2017-02-24mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmfDave Jiang1-1/+1
->fault(), ->page_mkwrite(), and ->pfn_mkwrite() calls do not need to take a vma and vmf parameter when the vma already resides in vmf. Remove the vma parameter to simplify things. [[email protected]: fix ARM build] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/148521301778.19116.10840599906674778980.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Dave Jiang <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Ross Zwisler <[email protected]> Cc: Theodore Ts'o <[email protected]> Cc: Darrick J. Wong <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Jan Kara <[email protected]> Cc: Dan Williams <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2017-02-22mm: drop unused argument of zap_page_range()Kirill A. Shutemov1-1/+1
There's no users of zap_page_range() who wants non-NULL 'details'. Let's drop it. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2017-02-10binder: Add support for file-descriptor arraysMartijn Coenen1-0/+137
This patch introduces a new binder_fd_array object, that allows us to support one or more file descriptors embedded in a buffer that is scatter-gathered. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Add support for scatter-gatherMartijn Coenen1-13/+231
Previously all data passed over binder needed to be serialized, with the exception of Binder objects and file descriptors. This patchs adds support for scatter-gathering raw memory buffers into a binder transaction, avoiding the need to first serialize them into a Parcel. To remain backwards compatibile with existing binder clients, it introduces two new command ioctls for this purpose - BC_TRANSACTION_SG and BC_REPLY_SG. These commands may only be used with the new binder_transaction_data_sg structure, which adds a field for the total size of the buffers we are scatter-gathering. Because memory buffers may contain pointers to other buffers, we allow callers to specify a parent buffer and an offset into it, to indicate this is a location pointing to the buffer that we are fixing up. The kernel will then take care of fixing up the pointer to that buffer as well. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> [jstultz: Fold in small fix from Amit Pundir <[email protected]>] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Add extra size to allocatorMartijn Coenen1-13/+28
The binder_buffer allocator currently only allocates space for the data and offsets buffers of a Parcel. This change allows for requesting an additional chunk of data in the buffer, which can for example be used to hold additional meta-data about the transaction (eg a security context). Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Refactor binder_transact()Martijn Coenen1-137/+172
Moved handling of fixup for binder objects, handles and file descriptors into separate functions. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Support multiple /dev instancesMartijn Coenen2-11/+84
Add a new module parameter 'devices', that can be used to specify the names of the binder device nodes we want to populate in /dev. Each device node has its own context manager, and is therefore logically separated from all the other device nodes. The config option CONFIG_ANDROID_BINDER_DEVICES can be used to set the default value of the parameter. This approach was favored over using IPC namespaces, mostly because we require a single process to be a part of multiple binder contexts, which seemed harder to achieve with namespaces. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> [jstultz: minor checkpatch warning fix] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Deal with contexts in debugfsMartijn Coenen1-13/+23
Properly print the context in debugfs entries. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Support multiple context managersMartijn Coenen1-21/+38
Move the context manager state into a separate struct context, and allow for each process to have its own context associated with it. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> [jstultz: Minor checkpatch fix] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-02-10binder: Split flat_binder_objectMartijn Coenen1-49/+109
flat_binder_object is used for both handling binder objects and file descriptors, even though the two are mostly independent. Since we'll have more fixup objects in binder in the future, instead of extending flat_binder_object again, split out file descriptors to their own object while retaining backwards compatibility to existing user-space clients. All binder objects just share a header. Cc: Greg Kroah-Hartman <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Amit Pundir <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-24ANDROID: binder: Clear binder and cookie when setting handle in flat binder ↵Arve Hjønnevåg1-0/+5
struct Prevents leaking pointers between processes Signed-off-by: Arve Hjønnevåg <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-24ANDROID: binder: Add strong ref checksArve Hjønnevåg1-9/+21
Prevent using a binder_ref with only weak references where a strong reference is required. Signed-off-by: Arve Hjønnevåg <[email protected]> Signed-off-by: Martijn Coenen <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-08-15android: binder: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-6/+1
The workqueue is being used to run deferred work for the android binder. The "binder_deferred_workqueue" queues only a single work item and hence does not require ordering. Also, this workqueue is not being used on a memory recliam path. Hence, the singlethreaded workqueue has been replaced with the use of system_wq. System workqueues have been able to handle high level of concurrency for a long time now and hence it's not required to have a singlethreaded workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue created with create_singlethread_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantee unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. Signed-off-by: Bhaktipriya Shridhar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-01Merge 4.5-rc6 into staging-nextGreg Kroah-Hartman1-1/+1
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-22Merge char-misc-next into staging-nextGreg Kroah-Hartman1-4/+22
This resolves the merge issues and confusions people were having with the goldfish drivers due to changes for them showing up in two different trees. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-20drivers: android: correct the size of struct binder_uintptr_t for ↵Lisa Du1-1/+1
BC_DEAD_BINDER_DONE There's one point was missed in the patch commit da49889deb34 ("staging: binder: Support concurrent 32 bit and 64 bit processes."). When configure BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of void * is 64bit on 64bit system. Correct it here. Signed-off-by: Lisa Du <[email protected]> Signed-off-by: Nicolas Boichat <[email protected]> Fixes: da49889deb34 ("staging: binder: Support concurrent 32 bit and 64 bit processes.") Cc: <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-11android: drivers: Avoid debugfs race in binderRiley Andrews1-2/+13
If a /d/binder/proc/[pid] entry is kept open after linux has torn down the associated process, binder_proc_show can deference an invalid binder_proc that has been stashed in the debugfs inode. Validate that the binder_proc ptr passed into binder_proc_show has not been freed by looking for it within the global process list whilst the global lock is held. If the ptr is not valid, print nothing. Cc: Colin Cross <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Dmitry Shmidt <[email protected]> [jstultz: Minor commit message tweaks] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-11android: binder: More offset validationArve Hjønnevåg1-2/+9
Make sure offsets don't point to overlapping flat_binder_object structs. Cc: Colin Cross <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Dmitry Shmidt <[email protected]> Cc: Rom Lemarchand <[email protected]> Cc: Serban Constantinescu <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Android Kernel Team <[email protected]> Signed-off-by: Dmitry Shmidt <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-07android: binder: Sanity check at binder ioctlChen Feng1-0/+5
Sanity check at binder ioctl function, Only allow the shared mm_struct to use the same binder-object to do binder operate. And add proc->vma_vm_mm = current->mm at the open function. The libbinder do ioctl before mmap called. V2: Fix compile error for error commit V3: Change the condition to proc->vma_vm_mm Signed-off-by: Chen Feng <[email protected]> Signed-off-by: Wei Dong <[email protected]> Signed-off-by: Junmin Zhao <[email protected]> Reviewed-by: Zhuangluan Su <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-09-10mm: mark most vm_operations_struct constKirill A. Shutemov1-1/+1
With two exceptions (drm/qxl and drm/radeon) all vm_operations_struct structs should be constant. Signed-off-by: Kirill A. Shutemov <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-03-01android: binder: fix binder mmap failuresAndrey Ryabinin1-5/+5
binder_update_page_range() initializes only addr and size fields in 'struct vm_struct tmp_area;' and passes it to map_vm_area(). Before 71394fe50146 ("mm: vmalloc: add flag preventing guard hole allocation") this was because map_vm_area() didn't use any other fields in vm_struct except addr and size. Now get_vm_area_size() (used in map_vm_area()) reads vm_struct's flags to determine whether vm area has guard hole or not. binder_update_page_range() don't initialize flags field, so this causes following binder mmap failures: -----------[ cut here ]------------ WARNING: CPU: 0 PID: 1971 at mm/vmalloc.c:130 vmap_page_range_noflush+0x119/0x144() CPU: 0 PID: 1971 Comm: healthd Not tainted 4.0.0-rc1-00399-g7da3fdc-dirty #157 Hardware name: ARM-Versatile Express [<c001246d>] (unwind_backtrace) from [<c000f7f9>] (show_stack+0x11/0x14) [<c000f7f9>] (show_stack) from [<c049a221>] (dump_stack+0x59/0x7c) [<c049a221>] (dump_stack) from [<c001cf21>] (warn_slowpath_common+0x55/0x84) [<c001cf21>] (warn_slowpath_common) from [<c001cfe3>] (warn_slowpath_null+0x17/0x1c) [<c001cfe3>] (warn_slowpath_null) from [<c00c66c5>] (vmap_page_range_noflush+0x119/0x144) [<c00c66c5>] (vmap_page_range_noflush) from [<c00c716b>] (map_vm_area+0x27/0x48) [<c00c716b>] (map_vm_area) from [<c038ddaf>] (binder_update_page_range+0x12f/0x27c) [<c038ddaf>] (binder_update_page_range) from [<c038e857>] (binder_mmap+0xbf/0x1ac) [<c038e857>] (binder_mmap) from [<c00c2dc7>] (mmap_region+0x2eb/0x4d4) [<c00c2dc7>] (mmap_region) from [<c00c3197>] (do_mmap_pgoff+0x1e7/0x250) [<c00c3197>] (do_mmap_pgoff) from [<c00b35b5>] (vm_mmap_pgoff+0x45/0x60) [<c00b35b5>] (vm_mmap_pgoff) from [<c00c1f39>] (SyS_mmap_pgoff+0x5d/0x80) [<c00c1f39>] (SyS_mmap_pgoff) from [<c000ce81>] (ret_fast_syscall+0x1/0x5c) ---[ end trace 48c2c4b9a1349e54 ]--- binder: 1982: binder_alloc_buf failed to map page at f0e00000 in kernel binder: binder_mmap: 1982 b6bde000-b6cdc000 alloc small buf failed -12 Use map_kernel_range_noflush() instead of map_vm_area() as this is better API for binder's purposes and it allows to get rid of 'vm_struct tmp_area' at all. Fixes: 71394fe50146 ("mm: vmalloc: add flag preventing guard hole allocation") Signed-off-by: Andrey Ryabinin <[email protected]> Reported-by: Amit Pundir <[email protected]> Tested-by: Amit Pundir <[email protected]> Acked-by: David Rientjes <[email protected]> Tested-by: John Stultz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-01-25Add security hooks to binder and implement the hooks for SELinux.Stephen Smalley1-0/+26
Add security hooks to the binder and implement the hooks for SELinux. The security hooks enable security modules such as SELinux to implement controls over binder IPC. The security hooks include support for controlling what process can become the binder context manager (binder_set_context_mgr), controlling the ability of a process to invoke a binder transaction/IPC to another process (binder_transaction), controlling the ability of a process to transfer a binder reference to another process (binder_transfer_binder), and controlling the ability of a process to transfer an open file to another process (binder_transfer_file). These hooks have been included in the Android kernel trees since Android 4.3. (Updated to reflect upstream relocation and changes to the binder driver, changes to the LSM audit data structures, coding style cleanups, and to add inline documentation for the hooks). Signed-off-by: Stephen Smalley <[email protected]> Acked-by: Nick Kralevich <[email protected]> Acked-by: Jeffrey Vander Stoep <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-10-20android: binder: remove binder.hGreg Kroah-Hartman2-31/+5
binder.h isn't needed to just include a uapi file and set a single define, so move it into binder.c to save a few lines of code. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-10-20staging: android: binder: move to the "real" part of the kernelGreg Kroah-Hartman5-0/+4072
The Android binder code has been "stable" for many years now. No matter what comes in the future, we are going to have to support this API, so might as well move it to the "real" part of the kernel as there's no real work that needs to be done to the existing code. Signed-off-by: Greg Kroah-Hartman <[email protected]>