tty: Fix SIGTTOU not sent with tcflush()

Commit 'e7f3880cd9b98c5bf9391ae7acdec82b75403776'
tty: Fix recursive deadlock in tty_perform_flush()
introduced a regression where tcflush() does not generate
SIGTTOU for background process groups.

Make sure ioctl(TCFLSH) calls tty_check_change() when
invoked from the line discipline.

Cc: stable@vger.kernel.org # v3.10+
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by Peter Hurley and committed by Greg Kroah-Hartman 5cec7bf6 93a8d416

Changed files
+3
drivers
+3
drivers/tty/tty_ioctl.c
··· 1201 1201 } 1202 1202 return 0; 1203 1203 case TCFLSH: 1204 + retval = tty_check_change(tty); 1205 + if (retval) 1206 + return retval; 1204 1207 return __tty_perform_flush(tty, arg); 1205 1208 default: 1206 1209 /* Try the mode commands */