]> git.baikalelectronics.ru Git - kernel.git/commit
tty: Fix race in the flush for some ldiscs
authorAlan Cox <alan@redhat.com>
Thu, 15 Jan 2009 13:30:25 +0000 (13:30 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 Jan 2009 20:48:35 +0000 (12:48 -0800)
commit23e697b0e3d5b85f26e4dcf25c945aff01e4dfd0
treec48dc5283ca4f01005295a97a28e532818aedce6
parente7770e0545fbd1bab805faf4413a9bc4c04db25d
tty: Fix race in the flush for some ldiscs

If you issue an ioctl to flush a tty as the line discipline is changing or
otherwise unplugged you can get a crash. The bug is very old but the rest
of the BKL lock dropping and some very "good" luck on Ingo's part caught
an example.

Use the correct ldisc_ref form so that we wait for the ldisc change to
complete and then flush

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_ioctl.c