lkml.org 
[lkml]   [2019]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 15/25] NFS: Cleanup if nfs_match_client is interrupted
    Date
    From: Benjamin Coddington <bcodding@redhat.com>

    commit 9f7761cf0409465075dadb875d5d4b8ef2f890c8 upstream.

    Don't bail out before cleaning up a new allocation if the wait for
    searching for a matching nfs client is interrupted. Memory leaks.

    Reported-by: syzbot+7fe11b49c1cc30e3fce2@syzkaller.appspotmail.com
    Fixes: 950a578c6128 ("NFS: make nfs_match_client killable")
    Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/nfs/client.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/nfs/client.c
    +++ b/fs/nfs/client.c
    @@ -416,10 +416,10 @@ struct nfs_client *nfs_get_client(const
    clp = nfs_match_client(cl_init);
    if (clp) {
    spin_unlock(&nn->nfs_client_lock);
    - if (IS_ERR(clp))
    - return clp;
    if (new)
    new->rpc_ops->free_client(new);
    + if (IS_ERR(clp))
    + return clp;
    return nfs_found_client(cl_init, clp);
    }
    if (new) {

    \
     
     \ /
      Last update: 2019-08-02 12:09    [W:2.349 / U:0.360 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site