linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	syzbot <syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmail.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: WARNING in request_end
Date: Tue, 25 Sep 2018 11:38:01 +0200	[thread overview]
Message-ID: <CACT4Y+ZiVgNj6h4f7aNDyzCwH0e84Onvb6n3yZ-p690duJki2g@mail.gmail.com> (raw)
In-Reply-To: <274aafd2-5076-6b14-f55e-360411fb8169@virtuozzo.com>

On Tue, Sep 25, 2018 at 11:18 AM, Kirill Tkhai <ktkhai@virtuozzo.com> wrote:
> On 24.09.2018 17:44, Miklos Szeredi wrote:
>> On Mon, Sep 24, 2018 at 2:29 PM, syzbot
>> <syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmail.com> wrote:
>>> Hello,
>>>
>>> syzbot found the following crash on:
>>>
>>> HEAD commit:    6bf4ca7fbc85 Linux 4.19-rc5
>>> git tree:       upstream
>>> console output: https://syzkaller.appspot.com/x/log.txt?x=159149c6400000
>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=22a62640793a83c9
>>> dashboard link: https://syzkaller.appspot.com/bug?extid=ef054c4d3f64cd7f7cec
>>> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
>>>
>>> Unfortunately, I don't have any reproducer for this crash yet.
>>>
>>> IMPORTANT: if you fix the bug, please add the following tag to the commit:
>>> Reported-by: syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmail.com
>>>
>>> WARNING: CPU: 0 PID: 9445 at fs/fuse/dev.c:390 request_end+0x82e/0xaa0
>>
>> And  there we have the bug likely caused by the set_bit(FR_SENT, ...)
>> not being inside the fpq->lock-ed region.
>>
>> So that needs to be fixed anyway, apparently.
>
> I can't confirm, since I haven't found yet the direct way, that set_bit() results
> in this stack...
>
> We have one more (unrelated) possible use-after-free here:
>
> cpu0                                       cpu1
> fuse_dev_do_write()                     fuse_dev_do_write()
>   req = request_find(fpq, oh.unique)    ...
>   spin_unlock(&fpq->lock)               ...
>   ...                                   req = request_find(fpq, oh.unique)
>   ...                                   spin_unlock(&fpq->lock)
>   queue_interrupt(&fc->iq, req);        ...
>   ...                                   ...
>   ...                                   ...
> request freed                           ...
> ...                                     queue_interrupt(&fc->iq, req); <- use after free
>
> Something like below is needed:

There is a bunch of open bugs in fuse on syzbot dashboard, perhaps
it's one of them:

https://syzkaller.appspot.com/bug?id=19aabec97cbf73dd0475d6e599113a7861c4b306
https://syzkaller.appspot.com/bug?id=24aa489e6929205e40ec4aa52cd8f47897f2ad63
https://syzkaller.appspot.com/bug?id=400d6a977a0dbd8836d7c7ec8481782a674ee855
https://syzkaller.appspot.com/bug?id=ff9ab4a23afa7553fb79f745a92be87ba4144508
https://syzkaller.appspot.com/bug?id=d0f258de27b6d7ccecbba09385b3376cc4a12ffe
https://syzkaller.appspot.com/bug?id=e8077bce636d52d9c40e1ea904699c27b7454354


> @@ -1875,16 +1877,20 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
>
>         /* Is it an interrupt reply? */
>         if (req->intr_unique == oh.unique) {
> +               __fuse_get_request(req);
>                 spin_unlock(&fpq->lock);
>
>                 err = -EINVAL;
> -               if (nbytes != sizeof(struct fuse_out_header))
> +               if (nbytes != sizeof(struct fuse_out_header)) {
> +                       fuse_put_request(fc, req);
>                         goto err_finish;
> +               }
>
>                 if (oh.error == -ENOSYS)
>                         fc->no_interrupt = 1;
>                 else if (oh.error == -EAGAIN)
>                         queue_interrupt(&fc->iq, req);
> +               fuse_put_request(fc, req);
>
>                 fuse_copy_finish(cs);
>                 return nbytes;
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/274aafd2-5076-6b14-f55e-360411fb8169%40virtuozzo.com.
> For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2018-09-25 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 12:29 WARNING in request_end syzbot
2018-09-24 14:44 ` Miklos Szeredi
2018-09-25  9:18   ` Kirill Tkhai
2018-09-25  9:38     ` Dmitry Vyukov [this message]
2018-09-25  9:49       ` Kirill Tkhai
2018-10-08  9:38 ` syzbot
2019-03-23  7:50 ` syzbot
2019-03-23 15:51   ` Eric W. Biederman
2019-03-23 19:48     ` Miklos Szeredi
2019-03-23 20:16       ` syzbot
2019-11-07 13:42 ` syzbot

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=CACT4Y+ZiVgNj6h4f7aNDyzCwH0e84Onvb6n3yZ-p690duJki2g@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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).