Skip to content

Commit

Permalink
fuse: fix leaked notify reply
Browse files Browse the repository at this point in the history
fuse_request_send_notify_reply() may fail if the connection was reset for
some reason (e.g. fs was unmounted).  Don't leak request reference in this
case.  Besides leaking memory, this resulted in fc->num_waiting not being
decremented and hence fuse_wait_aborted() left in a hanging and unkillable
state.

Fixes: 2d45ba3 ("fuse: add retrieve request")
Fixes: b8f95e5 ("fuse: umount should wait for all requests")
Reported-and-tested-by: syzbot+6339eda9cb4ebbc4c37b@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> #v2.6.36
  • Loading branch information
Miklos Szeredi committed Nov 9, 2018
1 parent 6510223 commit 7fabaf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,8 +1768,10 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
req->in.args[1].size = total_len;

err = fuse_request_send_notify_reply(fc, req, outarg->notify_unique);
if (err)
if (err) {
fuse_retrieve_end(fc, req);
fuse_put_request(fc, req);
}

return err;
}
Expand Down

0 comments on commit 7fabaf3

Please sign in to comment.