Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932111Ab1FIW74 (ORCPT ); Thu, 9 Jun 2011 18:59:56 -0400 Received: from casper.infradead.org ([85.118.1.10]:45555 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757221Ab1FIW7w (ORCPT ); Thu, 9 Jun 2011 18:59:52 -0400 Subject: Re: [PATCH v4 3.0-rc2-tip 4/22] 4: Uprobes: register/unregister probes. From: Peter Zijlstra To: Srikar Dronamraju Cc: Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Ananth N Mavinakayanahalli , Hugh Dickins , Christoph Hellwig , Jonathan Corbet , Thomas Gleixner , Masami Hiramatsu , Oleg Nesterov , Andrew Morton , Jim Keniston , Roland McGrath , Andi Kleen , LKML In-Reply-To: <20110607125900.28590.16071.sendpatchset@localhost6.localdomain6> References: <20110607125804.28590.92092.sendpatchset@localhost6.localdomain6> <20110607125900.28590.16071.sendpatchset@localhost6.localdomain6> Content-Type: text/plain; charset="UTF-8" Date: Fri, 10 Jun 2011 01:03:24 +0200 Message-ID: <1307660604.2497.1769.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1744 Lines: 44 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/