From: Peter Hurley Date: Sun, 8 Nov 2015 14:06:05 +0000 (-0500) Subject: tty: Only allow slave pty as controlling tty X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d1d3a0f7448fe038ce7e94e2c281dcd2f91b23c6;p=linux.git tty: Only allow slave pty as controlling tty A master pty should never be a controlling tty in Linux; if the master pty is specified to ioctl(TIOCSCTTY), silently substitute the slave pty as the controlling tty. Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index f38ae01c3917f..892c923547450 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2866,7 +2866,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) no_tty(); return 0; case TIOCSCTTY: - return tiocsctty(tty, file, arg); + return tiocsctty(real_tty, file, arg); case TIOCGPGRP: return tiocgpgrp(tty, real_tty, p); case TIOCSPGRP: