Files
Gaurav Kohli 3c538ad935 tty: fix data race between tty_init_dev and flush of buf
commit b027e2298b upstream.

There can be a race, if receive_buf call comes before
tty initialization completes in n_tty_open and tty->disc_data
may be NULL.

CPU0					CPU1
----					----
 000|n_tty_receive_buf_common()   	n_tty_open()
-001|n_tty_receive_buf2()		tty_ldisc_open.isra.3()
-002|tty_ldisc_receive_buf(inline)	tty_ldisc_setup()

Using ldisc semaphore lock in tty_init_dev till disc_data
initializes completely.

Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-03 17:39:19 +01:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-29 17:53:47 +01:00
…
2017-12-25 14:26:33 +01:00
…
…
…
…
…
…
…
…
…
…
…
2017-08-30 14:40:40 +02:00
…
2018-01-17 09:45:27 +01:00
2017-09-04 00:06:02 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-09-08 18:26:46 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-08-28 20:51:22 +02:00
…
…
2017-09-07 11:53:11 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
2017-09-25 08:56:05 -06:00
…
…
…
…
…
…
…
2017-12-20 10:10:18 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2018-01-02 20:31:07 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-08-31 18:50:14 +02:00
…
…
…
…
…
…
…
…
…
…