lkml.org 
[lkml]   [2009]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] Fix OOPS in mmap_region() when merging adjacent VM_LOCKED file segments
    From
    Date
    On Thu, 2009-01-29 at 15:02 -0800, Linus Torvalds wrote:
    >
    > On Thu, 29 Jan 2009, Hugh Dickins wrote:
    > >
    > > The problem has always been that file->f_op->mmap(file, vma) on a
    > > special file can do various strange things, changing surprising
    > > fields of the struct vma passed to it, changing its mergeability.
    >
    > Ahh, you're right. That's somewhat bogus, but it does explain why we have
    > those two separate merge_vma() calls.
    >
    > And as you also point out:
    >
    > > Now it may well be that every driver which does something strange
    > > there already sets one of the VM_SPECIAL flags which prevent merging,
    > > or can easily be fixed to do so, or otherwise clearly cannot pose a
    > > problem.
    >
    > .. and I think this is the right answer. If a device driver really does
    > something as odd as play games with the offset that would make merging
    > wrong, it had better set some of the VM_SPECIAL bits (presumably VM_IO) in
    > order to never merge at all.

    Just want to note that install_special_mappings()--used for, e.g., the
    vdso--sets VM_DONTEXPAND [one of the VM_SPECIAL flags] which, if we want
    to prevent merging, makes a lot of sense to me. It appears that
    get_user_pages() will balk at addresses in vmas with VM_IO [and
    VM_PFNMAP] which might not be what one wants. For example, you can't
    pre-populate the ptes via make_pages_present() with this flag.

    Lee



    \
     
     \ /
      Last update: 2009-01-30 05:47    [W:3.702 / U:0.248 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site