~ubuntu-branches/ubuntu/maverick/linux-mvl-dove/maverick-updates

« back to all changes in this revision

Viewing changes to drivers/staging/android/binder.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 2.6.32-40.87
  • Date: 2012-03-07 15:23:30 UTC
  • Revision ID: package-import@ubuntu.com-20120307152330-85gn9uo2nfx8m1sw
Tags: 2.6.32-424.43
* Release Tracking Bug
  - LP: #947896

[ Paolo Pisati ]

* Rebased to 2.6.32-40.87

[ Ubuntu: 2.6.32-40.87 ]

* Release Tracking Bug
  - LP: #947375
* IB/mlx4: pass SMP vendor-specific attribute MADs to firmware
  - LP: #932043
* mm/filemap_xip.c: fix race condition in xip_file_fault()
  - LP: #932043
* NFSv4: Fix up the callers of nfs4_state_end_reclaim_reboot
  - LP: #932043
* NFSv4: The state manager shouldn't exit on errors that were handled
  - LP: #932043
* NFSv4: Ensure the state manager handles NFS4ERR_NO_GRACE correctly
  - LP: #932043
* NFSv4: Handle NFS4ERR_GRACE when recovering an expired lease.
  - LP: #932043
* NFSv4: Fix open recovery
  - LP: #932043
* rpc client can not deal with ENOSOCK, so translate it into ENOCONN
  - LP: #932043
* udf: Mark LVID buffer as uptodate before marking it dirty
  - LP: #932043
* eCryptfs: Infinite loop due to overflow in ecryptfs_write()
  - LP: #932043
* atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
  - LP: #932043
* Staging: asus_oled: fix image processing
  - LP: #932043
* Staging: android: binder: Don't call dump_stack in binder_vma_open
  - LP: #932043
* Staging: android: binder: Fix crashes when sharing a binder file
  between processes
  - LP: #932043
* usb: gadget: zero: fix bug in loopback autoresume handling
  - LP: #932043
* usb: Skip PCI USB quirk handling for Netlogic XLP
  - LP: #932043
* USB: usbserial: add new PID number (0xa951) to the ftdi driver
  - LP: #932043
* mmc: cb710 core: Add missing spin_lock_init for irq_lock of struct
  cb710_chip
  - LP: #932043
* net: fix sk_forward_alloc corruptions
  - LP: #932043
* net: sock_queue_err_skb() dont mess with sk_forward_alloc
  - LP: #932043
* Linux 2.6.32.57
  - LP: #932043
* Ban ecryptfs over ecryptfs
  - LP: #932987
* eCryptfs: Remove mmap from directory operations
  - LP: #400443
* eCryptfs: Use notify_change for truncating lower inodes
  - LP: #451368
* ecryptfs: read on a directory should return EISDIR if not supported
  - LP: #719691
* eCryptfs: Remove extra d_delete in ecryptfs_rmdir
  - LP: #723518
* eCryptfs: Clear i_nlink in rmdir
  - LP: #723518
* KVM: Device assignment permission checks
  - LP: #897812
  - CVE-2011-4347
* block: Fix io_context leak after clone with CLONE_IO
  - LP: #940743
  - CVE-2012-0879
* block: Fix io_context leak after failure of clone with CLONE_IO
  - LP: #940743
  - CVE-2012-0879
* eCryptfs: Handle failed metadata read in lookup
  - LP: #509180
* drm/i915: Fix TV Out refresh rate.
  - LP: #945114
* Linux 2.6.32.57+drm33.23
  - LP: #945114

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
static DEFINE_MUTEX(binder_lock);
38
38
static DEFINE_MUTEX(binder_deferred_lock);
 
39
static DEFINE_MUTEX(binder_mmap_lock);
39
40
 
40
41
static HLIST_HEAD(binder_procs);
41
42
static HLIST_HEAD(binder_deferred_list);
615
616
        if (mm) {
616
617
                down_write(&mm->mmap_sem);
617
618
                vma = proc->vma;
 
619
                if (vma && mm != vma->vm_mm) {
 
620
                        pr_err("binder: %d: vma mm and task mm mismatch\n",
 
621
                                proc->pid);
 
622
                        vma = NULL;
 
623
                }
618
624
        }
619
625
 
620
626
        if (allocate == 0)
2742
2748
                     proc->pid, vma->vm_start, vma->vm_end,
2743
2749
                     (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
2744
2750
                     (unsigned long)pgprot_val(vma->vm_page_prot));
2745
 
        dump_stack();
2746
2751
}
2747
2752
 
2748
2753
static void binder_vma_close(struct vm_area_struct *vma)
2786
2791
        }
2787
2792
        vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
2788
2793
 
 
2794
        mutex_lock(&binder_mmap_lock);
2789
2795
        if (proc->buffer) {
2790
2796
                ret = -EBUSY;
2791
2797
                failure_string = "already mapped";
2800
2806
        }
2801
2807
        proc->buffer = area->addr;
2802
2808
        proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
 
2809
        mutex_unlock(&binder_mmap_lock);
2803
2810
 
2804
2811
#ifdef CONFIG_CPU_CACHE_VIPT
2805
2812
        if (cache_is_vipt_aliasing()) {
2832
2839
        binder_insert_free_buffer(proc, buffer);
2833
2840
        proc->free_async_space = proc->buffer_size / 2;
2834
2841
        barrier();
2835
 
        proc->files = get_files_struct(current);
 
2842
        proc->files = get_files_struct(proc->tsk);
2836
2843
        proc->vma = vma;
2837
2844
 
2838
2845
        /*printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p\n",
2843
2850
        kfree(proc->pages);
2844
2851
        proc->pages = NULL;
2845
2852
err_alloc_pages_failed:
 
2853
        mutex_lock(&binder_mmap_lock);
2846
2854
        vfree(proc->buffer);
2847
2855
        proc->buffer = NULL;
2848
2856
err_get_vm_area_failed:
2849
2857
err_already_mapped:
 
2858
        mutex_unlock(&binder_mmap_lock);
2850
2859
err_bad_arg:
2851
2860
        printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n",
2852
2861
               proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);