linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: syzbot <syzbot+d86c4426a01f60feddc7@syzkaller.appspotmail.com>,
	bcrl <bcrl@kvack.org>, linux-aio <linux-aio@kvack.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: possible deadlock in free_ioctx_users
Date: Mon, 10 Sep 2018 11:50:43 +0200	[thread overview]
Message-ID: <CAJfpegs72smmBfLdAwaOgQsLGsfdvWATv9BaNVvb0o4KdY3shA@mail.gmail.com> (raw)
In-Reply-To: <CACT4Y+bhGKrHk_BB4g9nDtRYD9VaaPyBTRxTo98r1BufAh6Z8A@mail.gmail.com>

On Mon, Sep 10, 2018 at 11:43 AM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Mon, Sep 10, 2018 at 11:28 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Sun, Sep 9, 2018 at 8:41 PM, syzbot
>> <syzbot+d86c4426a01f60feddc7@syzkaller.appspotmail.com> wrote:
>>> Hello,
>>>
>>> syzbot found the following crash on:
>>>
>>> HEAD commit:    f8f65382c98a Merge tag 'for-linus' of git://git.kernel.org..
>>> git tree:       upstream
>>> console output: https://syzkaller.appspot.com/x/log.txt?x=113260ae400000
>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=8f59875069d721b6
>>> dashboard link: https://syzkaller.appspot.com/bug?extid=d86c4426a01f60feddc7
>>> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
>>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=120baa9e400000
>>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13979cbe400000
>>>
>>> IMPORTANT: if you fix the bug, please add the following tag to the commit:
>>> Reported-by: syzbot+d86c4426a01f60feddc7@syzkaller.appspotmail.com
>>>
>>> random: sshd: uninitialized urandom read (32 bytes read)
>>> random: sshd: uninitialized urandom read (32 bytes read)
>>> random: sshd: uninitialized urandom read (32 bytes read)
>>>
>>> ========================================================
>>> WARNING: possible irq lock inversion dependency detected
>>> 4.19.0-rc2+ #229 Not tainted
>>> --------------------------------------------------------
>>> swapper/0/0 just changed the state of lock:
>>> 00000000c02bddef (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq
>>> include/linux/spinlock.h:354 [inline]
>>> 00000000c02bddef (&(&ctx->ctx_lock)->rlock){..-.}, at:
>>> free_ioctx_users+0xbc/0x710 fs/aio.c:603
>>> but this lock took another, SOFTIRQ-unsafe lock in the past:
>>>  (&fiq->waitq){+.+.}
>>>
>>>
>>> and interrupts could create inverse lock ordering between them.
>>>
>>>
>>> other info that might help us debug this:
>>>  Possible interrupt unsafe locking scenario:
>>>
>>>        CPU0                    CPU1
>>>        ----                    ----
>>>   lock(&fiq->waitq);
>>>                                local_irq_disable();
>>>                                lock(&(&ctx->ctx_lock)->rlock);
>>>                                lock(&fiq->waitq);
>>>   <Interrupt>
>>>     lock(&(&ctx->ctx_lock)->rlock);
>>
>> Fuse device doesn't support AIO ops.  So false positive, AFAICS.
>
> Hi Miklos,
>
> We still need to annotate this. How?

Good question.

Isn't lockdep assuming too much here?  It hasn't shown that that
ctx_lock instance was actually called from interrupt context, has it?

Thanks,
Miklos

  reply	other threads:[~2018-09-10 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-09 18:41 possible deadlock in free_ioctx_users syzbot
2018-09-09 19:11 ` Matthew Wilcox
2018-09-10  9:28 ` Miklos Szeredi
2018-09-10  9:43   ` Dmitry Vyukov
2018-09-10  9:50     ` Miklos Szeredi [this message]
2018-09-10 10:03       ` Dmitry Vyukov

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=CAJfpegs72smmBfLdAwaOgQsLGsfdvWATv9BaNVvb0o4KdY3shA@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=bcrl@kvack.org \
    --cc=dvyukov@google.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+d86c4426a01f60feddc7@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).