summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-11-09 15:52:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:24:14 +0100
commit6ceec07cc84a26152e5678e121c824f3d1097de6 (patch)
tree40912693fbbdf83a0bdac141fbf70b1a9f9671cb /fs/fuse
parenta42d933dc28180d92c88131e4cc77fe1b747b5e3 (diff)
fuse: fix leaked notify reply
commit 7fabaf303458fcabb694999d6fa772cc13d4e217 upstream. 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: 2d45ba381a74 ("fuse: add retrieve request") Fixes: b8f95e5d13f5 ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index a8b114ae931f..f7280c44cd4b 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1721,8 +1721,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;
}