lkml.org 
[lkml]   [2014]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: mm: NULL ptr deref in unlink_file_vma
    From
    Date
    On Mon, 2014-12-22 at 21:14 +0200, Kirill A. Shutemov wrote:
    > Other thing:
    >
    > unmap_mapping_range()
    > i_mmap_lock_read(mapping);
    > unmap_mapping_range_tree()
    > unmap_mapping_range_vma()
    > zap_page_range_single()
    > unmap_single_vma()
    > untrack_pfn()
    > vma->vm_flags &= ~VM_PAT;
    >
    > It seems we modify ->vm_flags without mmap_sem taken, means we can corrupt
    > them.

    yep. Although one thing that wouldn't match this would be the mlock'd
    bad page when freeing in both of Sasha's previous reports, as we would
    need to have VM_PFNMAP when calling untrack_pfn().

    > Sasha could you check if you hit untrack_pfn()?
    >
    > The problem probably was hidden by exclusive i_mmap_lock on
    > unmap_mapping_range(), but it's not exclusive anymore afrer Dave's
    > patchset.
    >
    > Konstantin, you've modified untrack_pfn() back in 2012 to change
    > ->vm_flags. Any coments?
    >
    > For now, I would propose to revert the commit and probably re-introduce it
    > after v3.19:
    >
    > From 14392c69fcfeeda34eb9f75d983dad32698cdd5c Mon Sep 17 00:00:00 2001
    > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    > Date: Mon, 22 Dec 2014 21:01:54 +0200
    > Subject: [PATCH] Revert "mm/memory.c: share the i_mmap_rwsem"
    >
    > This reverts commit c8475d144abb1e62958cc5ec281d2a9e161c1946.
    >
    > There are several[1][2] of bug reports which points to this commit as potential
    > cause[3].
    >
    > Let's revert it until we figure out what's going on.
    >
    > [1] https://lkml.org/lkml/2014/11/14/342
    > [2] https://lkml.org/lkml/2014/12/22/213
    > [3] https://lkml.org/lkml/2014/12/9/741
    >
    > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    > Reported-by: Sasha Levin <sasha.levin@oracle.com>
    > Cc: Davidlohr Bueso <dave@stgolabs.net>

    I certainly have no problem with this. Furthermore we snuck this one in
    kinda last minute, so:

    Acked-by: Davidlohr Bueso <dave@stgolabs.net>

    Thanks,
    Davidlohr



    \
     
     \ /
      Last update: 2014-12-22 23:41    [W:2.220 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site