lkml.org 
[lkml]   [2003]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] Fix for vma merging refcounting bug
    From
    Date
    When a new vma can be merged simultaneously with its two immediate
    neighbours in both directions, vma_merge() extends the predecessor vma
    and deletes the successor. However, if the vma maps a file, it fails to
    fput() when doing the delete, leaving the file's refcount inconsistent.

    # This is a BitKeeper generated patch for the following project:
    # Project Name: Linux kernel tree
    # This patch format is intended for GNU patch command version 2.5 or higher.
    # This patch includes the following deltas:
    # ChangeSet 1.1083 -> 1.1084
    # mm/mmap.c 1.79 -> 1.80
    #
    # The following is the BitKeeper ChangeSet Log
    # --------------------------------------------
    # 03/05/09 sct@sisko.scot.redhat.com 1.1084
    # Fix vma merging problem leading to file refcount getting out of sync.
    # --------------------------------------------
    #
    diff -Nru a/mm/mmap.c b/mm/mmap.c
    --- a/mm/mmap.c Fri May 9 13:26:53 2003
    +++ b/mm/mmap.c Fri May 9 13:26:53 2003
    @@ -471,6 +471,8 @@
    spin_unlock(lock);
    if (need_up)
    up(&inode->i_mapping->i_shared_sem);
    + if (file)
    + fput(file);

    mm->map_count--;
    kmem_cache_free(vm_area_cachep, next);

    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:35    [W:2.492 / U:0.196 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site