io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: syzbot <syzbot+996f91b6ec3812c48042@syzkaller.appspotmail.com>,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	viro@zeniv.linux.org.uk
Subject: Re: possible deadlock in __io_queue_deferred
Date: Tue, 11 Aug 2020 08:45:46 -0600	[thread overview]
Message-ID: <23b58871-b8b6-9f5c-2a7b-f4bade6dee6e@kernel.dk> (raw)
In-Reply-To: <20200811144419.blu4wufu7t4dfqin@steredhat>

On 8/11/20 8:44 AM, Stefano Garzarella wrote:
> On Tue, Aug 11, 2020 at 08:21:12AM -0600, Jens Axboe wrote:
>> On 8/11/20 8:00 AM, Stefano Garzarella wrote:
>>> On Mon, Aug 10, 2020 at 09:55:17AM -0600, Jens Axboe wrote:
>>>> On 8/10/20 9:36 AM, syzbot wrote:
>>>>> Hello,
>>>>>
>>>>> syzbot found the following issue on:
>>>>>
>>>>> HEAD commit:    449dc8c9 Merge tag 'for-v5.9' of git://git.kernel.org/pub/..
>>>>> git tree:       upstream
>>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=14d41e02900000
>>>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=9d25235bf0162fbc
>>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=996f91b6ec3812c48042
>>>>> compiler:       clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
>>>>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=133c9006900000
>>>>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1191cb1a900000
>>>>>
>>>>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>>>>> Reported-by: syzbot+996f91b6ec3812c48042@syzkaller.appspotmail.com
>>>>
>>>> Thanks, the below should fix this one.
>>>
>>> Yeah, it seems right to me, since only __io_queue_deferred() (invoked by
>>> io_commit_cqring()) can be called with 'completion_lock' held.
>>
>> Right
>>
>>> Just out of curiosity, while exploring the code I noticed that we call
>>> io_commit_cqring() always with the 'completion_lock' held, except in the
>>> io_poll_* functions.
>>>
>>> That's because then there can't be any concurrency?
>>
>> Do you mean the iopoll functions? Because we're definitely holding it
>> for the io_poll_* functions.
> 
> Right, the only one seems io_iopoll_complete().
> 
> So, IIUC, in this case we are actively polling the level below,
> so there shouldn't be any asynchronous events, is it right?

Right, that's serialized by itself.

-- 
Jens Axboe


      reply	other threads:[~2020-08-11 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 15:36 possible deadlock in __io_queue_deferred syzbot
2020-08-10 15:55 ` Jens Axboe
2020-08-11 14:00   ` Stefano Garzarella
2020-08-11 14:21     ` Jens Axboe
2020-08-11 14:44       ` Stefano Garzarella
2020-08-11 14:45         ` Jens Axboe [this message]

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=23b58871-b8b6-9f5c-2a7b-f4bade6dee6e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=syzbot+996f91b6ec3812c48042@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).