exynos-linux-stable/drivers/tty
Dmitry Vyukov 2a47e7de08 tty: fix data race in tty_ldisc_ref_wait()
[ Upstream commit a4a3e061149f09c075f108b6f1cf04d9739a6bc2 ]

tty_ldisc_ref_wait() checks tty->ldisc under tty->ldisc_sem.
But if ldisc==NULL it releases them sem and reloads
tty->ldisc without holding the sem. This is wrong and
can lead to returning non-NULL ldisc without protection.

Don't reload tty->ldisc second time.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: syzkaller@googlegroups.com
Cc: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-20 10:07:26 +01:00
..
hvc
ipwireless
serial serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X 2017-12-09 22:01:48 +01:00
vt vt: fix unchecked __put_user() in tioclinux ioctls 2017-07-21 07:42:22 +02:00
amiserial.c
bfin_jtag_comm.c
cyclades.c
ehv_bytechan.c
goldfish.c tty: goldfish: Fix a parameter of a call to free_irq 2017-10-08 10:26:05 +02:00
isicom.c
Kconfig
Makefile
metag_da.c
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c
n_hdlc.c tty: n_hdlc: get rid of racy n_hdlc.tbuf 2017-03-15 10:02:40 +08:00
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c
nozomi.c
pty.c tty: pty: Fix ldisc flush after userspace become aware of the data already 2017-05-20 14:28:41 +02:00
rocket.c
rocket.h
rocket_int.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c sysrq : fix Show Regs call trace on ARM 2017-12-09 22:01:49 +01:00
tty_audit.c
tty_buffer.c tty: fix __tty_insert_flip_char regression 2017-09-27 14:39:19 +02:00
tty_io.c
tty_ioctl.c
tty_ldisc.c tty: fix data race in tty_ldisc_ref_wait() 2017-12-20 10:07:26 +01:00
tty_ldsem.c
tty_mutex.c
tty_port.c