lkml.org 
[lkml]   [2015]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.2 148/152] vfs: Fix vfsmount_lock imbalance in path_init()
    3.2.67-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Ben Hutchings <ben@decadent.org.uk>

    When backporting commit 4023bfc9f351 ("be careful with nd->inode in
    path_init() and follow_dotdot_rcu()"), I failed to account for the
    vfsmount_lock that is used in 3.2 but not upstream. path_init() takes
    the lock if performing RCU lookup, but must drop it if (and only if)
    it subsequently fails.

    Reported-by: nuxi@vault24.org
    References: https://bugzilla.kernel.org/show_bug.cgi?id=92531
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Tested-by: nuxi@vault24.org
    ---
    --- a/fs/namei.c
    +++ b/fs/namei.c
    @@ -1567,6 +1567,7 @@ static int path_init(int dfd, const char
    if (!(nd->flags & LOOKUP_ROOT))
    nd->root.mnt = NULL;
    rcu_read_unlock();
    + br_read_unlock(vfsmount_lock);
    return -ECHILD;

    fput_fail:


    \
     
     \ /
      Last update: 2015-02-17 04:21    [W:4.277 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site