tty: Fix hung task on pty hangup
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 5 Nov 2014 17:13:07 +0000 (12:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 02:50:43 +0000 (18:50 -0800)
commitfae76e9adfa450f4c2dd5773265eb3c811a9c484
tree88f6086470fe19b2299568b24e4b27d8e3c608f7
parente80a10ee4de8f654cf34170da00f989470331da8
tty: Fix hung task on pty hangup

When hanging up one end of a pty pair, there may be waiting
readers/writers on the other end which may not exit, preventing
tty_ldisc_lock_pair() from acquiring the other side's ldisc lock.

Only acquire this side's ldisc lock; although this will no longer
prevent the other side from writing new input, that input will not
be processing until after the ldisc hangup is complete.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldisc.c