Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324Ab2FOGgF (ORCPT ); Fri, 15 Jun 2012 02:36:05 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:58794 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715Ab2FOGgC (ORCPT ); Fri, 15 Jun 2012 02:36:02 -0400 Date: Fri, 15 Jun 2012 11:52:58 +0530 From: Srikar Dronamraju To: Oleg Nesterov Cc: Hugh Dickins , Ingo Molnar , Peter Zijlstra , Ananth N Mavinakayanahalli , Anton Arapov , Linus Torvalds , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] uprobes: valid_vma() should reject VM_HUGETLB Message-ID: <20120615062258.GA3811@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20120607165942.GA31966@redhat.com> <20120607170002.GA31974@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20120607170002.GA31974@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061506-5112-0000-0000-0000090DB7F1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1270 Lines: 35 * Oleg Nesterov [2012-06-07 19:00:02]: > __replace_page() obviously can't work with the hugetlbfs mappings, > uprobe_register() will likely crash the kernel. Change valid_vma() > to check VM_HUGETLB as well. > > As for PageTransHuge() no need to worry, vma->vm_file != NULL. > > Signed-off-by: Oleg Nesterov > --- > kernel/events/uprobes.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c > index 6e3b181..48d53af 100644 > --- a/kernel/events/uprobes.c > +++ b/kernel/events/uprobes.c > @@ -105,7 +105,8 @@ static bool valid_vma(struct vm_area_struct *vma, bool is_register) > if (!is_register) > return true; > > - if ((vma->vm_flags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) == (VM_READ|VM_EXEC)) > + if ((vma->vm_flags & (VM_HUGETLB|VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) > + == (VM_READ|VM_EXEC)) > return true; > > return false; Acked-by: Srikar Dronamraju -- 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/