From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757639Ab2GMOFG (ORCPT ); Fri, 13 Jul 2012 10:05:06 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:38746 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751545Ab2GMOFB (ORCPT ); Fri, 13 Jul 2012 10:05:01 -0400 Date: Fri, 13 Jul 2012 19:32:59 +0530 From: Srikar Dronamraju To: Oleg Nesterov Cc: Ingo Molnar , Ananth N Mavinakayanahalli , Anton Arapov , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] uprobes: kill insert_vm_struct()->uprobe_mmap() Message-ID: <20120713140259.GB4741@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20120708202917.GA18188@redhat.com> <20120708203011.GA18243@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20120708203011.GA18243@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071314-5930-0000-0000-000009D7E077 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Oleg Nesterov [2012-07-08 22:30:11]: > Kill insert_vm_struct()->uprobe_mmap(). It is not needed, nobody > except arch/ia64/kernel/perfmon.c uses insert_vm_struct(vma) with > vma->vm_file != NULL. > > And it is wrong. Again, get_user_pages() can not succeed before > vma_link(vma) makes is visible to find_vma(). And even if this > worked, we must not insert the new bp before this mapping is > visible to vma_prio_tree_foreach() for uprobe_unregister(). > > Signed-off-by: Oleg Nesterov Acked-by: Srikar Dronamraju > --- > mm/mmap.c | 3 --- > 1 files changed, 0 insertions(+), 3 deletions(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index e5a4614..4fe2697 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -2345,9 +2345,6 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) > security_vm_enough_memory_mm(mm, vma_pages(vma))) > return -ENOMEM; > > - if (vma->vm_file && uprobe_mmap(vma)) > - return -EINVAL; > - > vma_link(mm, vma, prev, rb_link, rb_parent); > return 0; > } > -- > 1.5.5.1 >