linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fuse: Put leaked request on error path of fuse_retrieve()
Date: Tue, 6 Nov 2018 10:23:28 +0100	[thread overview]
Message-ID: <CAJfpegtMmrvnZE3xtMDNTmF=pSmqFROtehamivbLeAh2E_qZ6Q@mail.gmail.com> (raw)
In-Reply-To: <154149557692.17196.12607896696117775780.stgit@localhost.localdomain>

On Tue, Nov 6, 2018 at 10:13 AM, Kirill Tkhai <ktkhai@virtuozzo.com> wrote:
> fuse_request_send_notify_reply() may fail, and this case
> it remains leaked (fuse_retrieve_end(), which is called
> on error path, does not do that). Also, fc->num_waiting,
> will never be decremented, and fuse_wait_aborted() will
> never finish. So, put the request patently.
>
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

Posted same patch yesterday for a syzbot report.   How did you notice this?

Thanks,
Miklos


> ---
>  fs/fuse/dev.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index ae813e609932..6fe330cc9709 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -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;
>  }
>

  reply	other threads:[~2018-11-06 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  9:13 [PATCH] fuse: Put leaked request on error path of fuse_retrieve() Kirill Tkhai
2018-11-06  9:23 ` Miklos Szeredi [this message]
2018-11-06  9:25   ` Kirill Tkhai
2018-11-06  9:33     ` Miklos Szeredi
2018-11-06  9:34       ` Kirill Tkhai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJfpegtMmrvnZE3xtMDNTmF=pSmqFROtehamivbLeAh2E_qZ6Q@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).