diff options
Diffstat (limited to 'drivers/staging/android/binder.c')
-rw-r--r-- | drivers/staging/android/binder.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 6a4ceacb33f..758131cad08 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c | |||
@@ -319,6 +319,7 @@ int task_get_unused_fd_flags(struct task_struct *tsk, int flags) | |||
319 | int fd, error; | 319 | int fd, error; |
320 | struct fdtable *fdt; | 320 | struct fdtable *fdt; |
321 | unsigned long rlim_cur; | 321 | unsigned long rlim_cur; |
322 | unsigned long irqs; | ||
322 | 323 | ||
323 | if (files == NULL) | 324 | if (files == NULL) |
324 | return -ESRCH; | 325 | return -ESRCH; |
@@ -335,12 +336,11 @@ repeat: | |||
335 | * N.B. For clone tasks sharing a files structure, this test | 336 | * N.B. For clone tasks sharing a files structure, this test |
336 | * will limit the total number of files that can be opened. | 337 | * will limit the total number of files that can be opened. |
337 | */ | 338 | */ |
338 | rcu_read_lock(); | 339 | rlim_cur = 0; |
339 | if (tsk->signal) | 340 | if (lock_task_sighand(tsk, &irqs)) { |
340 | rlim_cur = tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur; | 341 | rlim_cur = tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur; |
341 | else | 342 | unlock_task_sighand(tsk, &irqs); |
342 | rlim_cur = 0; | 343 | } |
343 | rcu_read_unlock(); | ||
344 | if (fd >= rlim_cur) | 344 | if (fd >= rlim_cur) |
345 | goto out; | 345 | goto out; |
346 | 346 | ||
@@ -2649,14 +2649,14 @@ static void binder_vma_open(struct vm_area_struct *vma) | |||
2649 | { | 2649 | { |
2650 | struct binder_proc *proc = vma->vm_private_data; | 2650 | struct binder_proc *proc = vma->vm_private_data; |
2651 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) | 2651 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) |
2652 | printk(KERN_INFO "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot); | 2652 | printk(KERN_INFO "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot)); |
2653 | dump_stack(); | 2653 | dump_stack(); |
2654 | } | 2654 | } |
2655 | static void binder_vma_close(struct vm_area_struct *vma) | 2655 | static void binder_vma_close(struct vm_area_struct *vma) |
2656 | { | 2656 | { |
2657 | struct binder_proc *proc = vma->vm_private_data; | 2657 | struct binder_proc *proc = vma->vm_private_data; |
2658 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) | 2658 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) |
2659 | printk(KERN_INFO "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot); | 2659 | printk(KERN_INFO "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot)); |
2660 | proc->vma = NULL; | 2660 | proc->vma = NULL; |
2661 | } | 2661 | } |
2662 | 2662 | ||
@@ -2677,7 +2677,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma) | |||
2677 | vma->vm_end = vma->vm_start + SZ_4M; | 2677 | vma->vm_end = vma->vm_start + SZ_4M; |
2678 | 2678 | ||
2679 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) | 2679 | if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE) |
2680 | printk(KERN_INFO "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot); | 2680 | printk(KERN_INFO "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot)); |
2681 | 2681 | ||
2682 | if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) { | 2682 | if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) { |
2683 | ret = -EPERM; | 2683 | ret = -EPERM; |