lkml.org 
[lkml]   [2019]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.3 41/71] fuse: fix memleak in cuse_channel_open
    Date
    From: zhengbin <zhengbin13@huawei.com>

    [ Upstream commit 9ad09b1976c562061636ff1e01bfc3a57aebe56b ]

    If cuse_send_init fails, need to fuse_conn_put cc->fc.

    cuse_channel_open->fuse_conn_init->refcount_set(&fc->count, 1)
    ->fuse_dev_alloc->fuse_conn_get
    ->fuse_dev_free->fuse_conn_put

    Fixes: cc080e9e9be1 ("fuse: introduce per-instance fuse_dev structure")
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: zhengbin <zhengbin13@huawei.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/fuse/cuse.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
    index bab7a0db81dd4..f3b7208846506 100644
    --- a/fs/fuse/cuse.c
    +++ b/fs/fuse/cuse.c
    @@ -519,6 +519,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file)
    rc = cuse_send_init(cc);
    if (rc) {
    fuse_dev_free(fud);
    + fuse_conn_put(&cc->fc);
    return rc;
    }
    file->private_data = fud;
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-10-01 19:02    [W:4.036 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site