n_tty: Fix unsafe driver-side signals
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 6 Mar 2013 13:38:19 +0000 (08:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2013 23:13:59 +0000 (16:13 -0700)
commit8c985d18b136c5d511445d15f0c6650003a8946b
tree37bccfd3f1c965f793bc8f039360e460d38f5a44
parente91e52e42814b130c20d17bc1e2adf813c50db11
n_tty: Fix unsafe driver-side signals

An ldisc reference is insufficient guarantee the foreground process
group is not in the process of being signalled from a hangup.

1) Reads of tty->pgrp must be locked with ctrl_lock
2) The group pid must be referenced for the duration of signalling.
   Because the driver-side is not process-context, a pid reference
   must be acquired.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c