[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120615062258.GA3811@linux.vnet.ibm.com>
Date: Fri, 15 Jun 2012 11:52:58 +0530
From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Hugh Dickins <hughd@...gle.com>, Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anton Arapov <anton@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] uprobes: valid_vma() should reject VM_HUGETLB
* Oleg Nesterov <oleg@...hat.com> [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 <oleg@...hat.com>
> ---
> 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 <srikar@...ux.vnet.ibm.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists