lkml.org 
[lkml]   [2012]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 01/15] uprobes: valid_vma() should reject VM_HUGETLB
    __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@redhat.com>
    Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.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 b52376d..f0d0453 100644
    --- a/kernel/events/uprobes.c
    +++ b/kernel/events/uprobes.c
    @@ -99,7 +99,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;
    --
    1.5.5.1


    \
     
     \ /
      Last update: 2012-06-15 18:21    [W:5.003 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site