Re: [PATCHv5 6/7] tty/ldsem: Add lockdep asserts for ldisc_sem

2018-09-18 Thread Dmitry Safonov
On Tue, 2018-09-18 at 15:49 +0200, Greg Kroah-Hartman wrote: > On Tue, Sep 18, 2018 at 12:52:57AM +0100, Dmitry Safonov wrote: > > Make sure under CONFIG_LOCKDEP that each change to line discipline > > is done with held write semaphor. > > Otherwise potential reader will have a good time dereferenc

Re: [PATCHv5 6/7] tty/ldsem: Add lockdep asserts for ldisc_sem

2018-09-18 Thread Greg Kroah-Hartman
On Tue, Sep 18, 2018 at 12:52:57AM +0100, Dmitry Safonov wrote: > Make sure under CONFIG_LOCKDEP that each change to line discipline > is done with held write semaphor. > Otherwise potential reader will have a good time dereferencing > incomplete/uninitialized ldisc. Note, I don't see patch 5/7 he

[PATCHv5 6/7] tty/ldsem: Add lockdep asserts for ldisc_sem

2018-09-17 Thread Dmitry Safonov
Make sure under CONFIG_LOCKDEP that each change to line discipline is done with held write semaphor. Otherwise potential reader will have a good time dereferencing incomplete/uninitialized ldisc. An exception here is tty_ldisc_open(), as it's called without ldisc_sem locked by tty_init_dev() => tt