]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit972fce19b8b32e756d3c397b3864546ac4b889fc
tree681cd21901b56dca6046fbc9516bb74221fa8b7a
parentfd051c3d2a1be89885f85ca73ab60b766813e151
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