Re: patch "Revert "tty: Fix ldisc crash on reopened tty"" added to tty-next

From: Mikulas Patocka
Date: Tue Apr 04 2017 - 11:59:15 EST




On Tue, 4 Apr 2017, Michael Neuling wrote:

> On Sat, 2017-04-01 at 15:42 -0400, Mikulas Patocka wrote:
> > With that patch reverted, I'm still getting this crash. Will there beÂ
> > another fix for this bug?
>
> Yeah, this patch was trying to fix the issue.
>
> Is this crash parisc? We are seeing it on powerpc although I'm having issues
> reproducing it reliably.
>
> Mikey

Yes, it's parisc.

I can reproduce this crash reliably with the old Debian 5 installation
when I connect to the machine with ssh and type something before the
prompt appears.

You can try to install Debian 5 on powerpc and maybe then you can
reproduce it the same way.

Mikulas

> >
> > Kernel Fault: Code=15 (Data TLB miss fault) regs=000000007ace4740
> > (Addr=0000000000002260)
> > CPU: 0 PID: 24563 Comm: kworker/u8:1 Not tainted 4.11.0-rc4 #1
> > Workqueue: events_unbound flush_to_ldisc
> > task: 000000007ae39b00 task.stack: 000000007ace4000
> >
> > ÂÂÂÂ YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
> > PSW: 00001000000001000000000000001111 Not tainted
> > r00-03Â 000000000804000f 00000000405b68c0 00000000403d35e0 0000000000000001
> > r04-07Â 00000000405948c0 000000007ac14c00 000000007ace4410 0000000000000000
> > r08-11Â 0000000000000002 000000007ac16c2a 0000000000000000 00000000405a40c0
> > r12-15Â 00000000405a40c0 00000000406b2880 000000007ace42c0 000000007fc0c020
> > r16-19Â 000000007fc0c078 00000000406b2880 000000007fc0c2a8 0000000000002260
> > r20-23Â 000000007ac14df0 000000007ac14cc8 0000000000000001 0000000000000002
> > r24-27Â 0000000000000000 000000000800000f 000000007ac14cc4 00000000405948c0
> > r28-31Â 0000000000000001 000000007ace4850 000000007ace4740 0000000000000001
> > sr00-03Â 0000000000290000 0000000000000000 0000000000000000 0000000000290000
> > sr04-07Â 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> >
> > IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000403d35fc
> > 00000000403d3600
> > ÂIIR: 0e6a00d6ÂÂÂ ISR: 0000000000000000Â IOR: 0000000000002260
> > ÂCPU:ÂÂÂÂÂÂÂ 0ÂÂ CR30: 000000007ace4000 CR31: ffffffffffffffff
> > ÂORIG_R28: 00000000405948c0
> > ÂIAOQ[0]: n_tty_receive_buf_common+0xac/0xd20
> > ÂIAOQ[1]: n_tty_receive_buf_common+0xb0/0xd20
> > ÂRP(r2): n_tty_receive_buf_common+0x90/0xd20
> > Backtrace:
> > Â[<00000000403d4284>] n_tty_receive_buf2+0x14/0x20
> > Â[<00000000403d7980>] tty_ldisc_receive_buf+0x30/0x88
> > Â[<00000000403d88d4>] tty_port_default_receive_buf+0x5c/0xa8
> > Â[<00000000403d7c84>] flush_to_ldisc+0x10c/0x128
> > Â[<0000000040188740>] process_one_work+0x1b0/0x4e8
> > Â[<0000000040188d7c>] worker_thread+0x304/0x698
> > Â[<0000000040190c34>] kthread+0x17c/0x1d8
> > Â[<0000000040134020>] end_fault_vector+0x20/0x28
> > Â[<00000000401bdbd8>] handle_irq_event_percpu+0x70/0x90
> > Â[<00000000401b546c>] up_read+0x14/0x20
> > Â[<0000000040217ce8>] free_hot_cold_page_list+0x48/0x80
> > Â[<0000000040221644>] release_pages+0x3a4/0x478
> >
> > Kernel panic - not syncing: Kernel Fault
> > Rebooting in 1 seconds..
> >
> > On Wed, 29 Mar 2017, gregkh@xxxxxxxxxxxxxxxxxxxÂwrote:
> >
> > >Â
> > > This is a note to let you know that I've just added the patch titled
> > >Â
> > >ÂÂÂÂ Revert "tty: Fix ldisc crash on reopened tty"
> > >Â
> > > to my tty git tree which can be found at
> > >ÂÂÂÂ git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
> > > in the tty-next branch.
> > >Â
> > > The patch will show up in the next release of the linux-next tree
> > > (usually sometime within the next 24 hours during the week.)
> > >Â
> > > The patch will also be merged in the next major kernel release
> > > during the merge window.
> > >Â
> > > If you have any questions about this process, please let me know.
> > >Â
> > >Â
> > > >From 896d81fefe5d1919537db2c2150ab6384e4a6610 Mon Sep 17 00:00:00 2001
> > > From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > Date: Wed, 29 Mar 2017 07:50:49 +0200
> > > Subject: Revert "tty: Fix ldisc crash on reopened tty"
> > >Â
> > > This reverts commit 71472fa9c52b1da27663c275d416d8654b905f05. It caused
> > > merge issues, and Dmitry found some review issues.
> > >Â
> > > Reported-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> > > Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> > > Cc: Mikulas Patocka <mpatocka@xxxxxxxxxx>
> > > Cc: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>
> > > Cc: Michael Neuling <mikey@xxxxxxxxxxx>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > ---
> > >Â drivers/tty/tty_ldisc.c | 11 +++++------
> > >Â 1 file changed, 5 insertions(+), 6 deletions(-)
> > >Â
> > > diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
> > > index 4ee7742dced3..68947f6de5ad 100644
> > > --- a/drivers/tty/tty_ldisc.c
> > > +++ b/drivers/tty/tty_ldisc.c
> > > @@ -669,17 +669,16 @@ int tty_ldisc_reinit(struct tty_struct *tty, int disc)
> > >ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtty_ldisc_put(tty->ldisc);
> > >ÂÂÂÂÂÂÂ}
> > >ÂÂ
> > > +ÂÂÂÂÂ/* switch the line discipline */
> > > +ÂÂÂÂÂtty->ldisc = ld;
> > >ÂÂÂÂÂÂÂtty_set_termios_ldisc(tty, disc);
> > > -ÂÂÂÂÂretval = tty_ldisc_open(tty, ld);
> > > +ÂÂÂÂÂretval = tty_ldisc_open(tty, tty->ldisc);
> > >ÂÂÂÂÂÂÂif (retval) {
> > >ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (!WARN_ON(disc == N_TTY)) {
> > > -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtty_ldisc_put(ld);
> > > -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂld = NULL;
> > > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtty_ldisc_put(tty->ldisc);
> > > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtty->ldisc = NULL;
> > >ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
> > >ÂÂÂÂÂÂÂ}
> > > -
> > > -ÂÂÂÂÂ/* switch the line discipline */
> > > -ÂÂÂÂÂsmp_store_release(&tty->ldisc, ld);
> > >ÂÂÂÂÂÂÂreturn retval;
> > >Â }
> > >ÂÂ
> > > --Â
> > > 2.12.1
> > >Â
> > >Â
> >
>