2017-06-07 00:42:17

by Bart Van Assche

[permalink] [raw]
Subject: Re: tty: possible deadlock in tty_buffer_flush

On Mon, 2017-05-29 at 17:19 +0200, Andrey Konovalov wrote:
> I've got the following error report while fuzzing the kernel with syzkaller.
>
> On commit 5ed02dbb497422bf225783f46e6eadd237d23d6b (4.12-rc3).
>
> ======================================================
> WARNING: possible circular locking dependency detected
> 4.12.0-rc3+ #369 Not tainted
> ------------------------------------------------------
> kworker/u9:1/31 is trying to acquire lock:
> (&buf->lock){+.+...}, at: [<ffffffff823dd42b>]
> tty_buffer_flush+0xbb/0x3b0 drivers/tty/tty_buffer.c:221
>
> but task is already holding lock:
> (&o_tty->termios_rwsem/1){++++..}, at: [<ffffffff823cd5d1>]
> isig+0xa1/0x4d0 drivers/tty/n_tty.c:1100
>
> which lock already depends on the new lock.

Hello Andrey,

I also see this warning but during regular boot (without running syzkaller).
Do you perhaps have the time to bisect this?

Thanks,

Bart.


2017-06-07 08:50:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: tty: possible deadlock in tty_buffer_flush

On Wed, Jun 07, 2017 at 12:42:12AM +0000, Bart Van Assche wrote:
> On Mon, 2017-05-29 at 17:19 +0200, Andrey Konovalov wrote:
> > I've got the following error report while fuzzing the kernel with syzkaller.
> >
> > On commit 5ed02dbb497422bf225783f46e6eadd237d23d6b (4.12-rc3).
> >
> > ======================================================
> > WARNING: possible circular locking dependency detected
> > 4.12.0-rc3+ #369 Not tainted
> > ------------------------------------------------------
> > kworker/u9:1/31 is trying to acquire lock:
> > (&buf->lock){+.+...}, at: [<ffffffff823dd42b>]
> > tty_buffer_flush+0xbb/0x3b0 drivers/tty/tty_buffer.c:221
> >
> > but task is already holding lock:
> > (&o_tty->termios_rwsem/1){++++..}, at: [<ffffffff823cd5d1>]
> > isig+0xa1/0x4d0 drivers/tty/n_tty.c:1100
> >
> > which lock already depends on the new lock.
>
> Hello Andrey,
>
> I also see this warning but during regular boot (without running syzkaller).
> Do you perhaps have the time to bisect this?

Should be fixed in 4.12-rc4, right?

thanks,

greg k-h

2017-06-07 17:39:37

by Bart Van Assche

[permalink] [raw]
Subject: Re: tty: possible deadlock in tty_buffer_flush

On Wed, 2017-06-07 at 10:50 +0200, [email protected] wrote:
> On Wed, Jun 07, 2017 at 12:42:12AM +0000, Bart Van Assche wrote:
> > On Mon, 2017-05-29 at 17:19 +0200, Andrey Konovalov wrote:
> > > I've got the following error report while fuzzing the kernel with syzkaller.
> > >
> > > On commit 5ed02dbb497422bf225783f46e6eadd237d23d6b (4.12-rc3).
> > >
> > > ======================================================
> > > WARNING: possible circular locking dependency detected
> > > 4.12.0-rc3+ #369 Not tainted
> > > ------------------------------------------------------
> > > kworker/u9:1/31 is trying to acquire lock:
> > > (&buf->lock){+.+...}, at: [<ffffffff823dd42b>]
> > > tty_buffer_flush+0xbb/0x3b0 drivers/tty/tty_buffer.c:221
> > >
> > > but task is already holding lock:
> > > (&o_tty->termios_rwsem/1){++++..}, at: [<ffffffff823cd5d1>]
> > > isig+0xa1/0x4d0 drivers/tty/n_tty.c:1100
> > >
> > > which lock already depends on the new lock.
> >
> > Hello Andrey,
> >
> > I also see this warning but during regular boot (without running syzkaller).
> > Do you perhaps have the time to bisect this?
>
> Should be fixed in 4.12-rc4, right?

That's right.

Thanks!

Bart.