Skip to content

Commit 5cec7bf

Browse files
peterhurleygregkh
authored andcommitted
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>
1 parent 93a8d41 commit 5cec7bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/tty_ioctl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,9 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
12011201
}
12021202
return 0;
12031203
case TCFLSH:
1204+
retval = tty_check_change(tty);
1205+
if (retval)
1206+
return retval;
12041207
return __tty_perform_flush(tty, arg);
12051208
default:
12061209
/* Try the mode commands */

0 commit comments

Comments
 (0)