lkml.org 
[lkml]   [2011]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 3.0-rc2-tip 4/22] 4: Uprobes: register/unregister probes.
From
Date
On Tue, 2011-06-07 at 18:29 +0530, Srikar Dronamraju wrote:
> + vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, 0, 0) {
> + loff_t vaddr;
> + struct task_struct *tsk;
> +
> + if (!atomic_inc_not_zero(&vma->vm_mm->mm_users))
> + continue;
> +
> + mm = vma->vm_mm;
> + if (!valid_vma(vma)) {
> + mmput(mm);
> + continue;
> + }
> +
> + vaddr = vma->vm_start + offset;
> + vaddr -= vma->vm_pgoff << PAGE_SHIFT;
> + if (vaddr < vma->vm_start || vaddr > vma->vm_end) {
> + /* Not in this vma */
> + mmput(mm);
> + continue;
> + }
> + tsk = get_mm_owner(mm);
> + if (tsk && vaddr > TASK_SIZE_OF(tsk)) {
> + /*
> + * We cannot have a virtual address that is
> + * greater than TASK_SIZE_OF(tsk)
> + */
> + put_task_struct(tsk);
> + mmput(mm);
> + continue;
> + }
> + put_task_struct(tsk);
> + mm->uprobes_vaddr = (unsigned long) vaddr;
> + list_add(&mm->uprobes_list, &try_list);
> + }

This still falls flat on its face when there's multiple maps of the same
text in one mm.



\
 
 \ /
  Last update: 2011-06-10 01:03    [W:0.587 / U:0.400 seconds]
©2003-2014 Jasper Spaans. Advertise on this site