n_tty: Lock access to tty->pgrp for POSIX job control
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 6 Mar 2013 13:38:20 +0000 (08:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2013 23:13:59 +0000 (16:13 -0700)
commit01a5e440c91dc6065cf3dbc38aa7276fc4ce2f26
tree681cd21901b56dca6046fbc9516bb74221fa8b7a
parent8c985d18b136c5d511445d15f0c6650003a8946b
n_tty: Lock access to tty->pgrp for POSIX job control

Concurrent access to tty->pgrp must be protected with tty->ctrl_lock.
Also, as noted in the comments, reading current->signal->tty is
safe because either,
  1) current->signal->tty is assigned by current, or
  2) current->signal->tty is set to NULL.

NB: for reference, tty_check_change() implements a similar POSIX
check for the ioctls corresponding to tcflush(), tcdrain(),
tcsetattr(), tcsetpgrp(), tcflow() and tcsendbreak().

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