Commit 03e12617 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

tty: disassociate_ctty() sends the extra SIGCONT

Starting from v3.10 (probably commit f91e2590: "tty: Signal
foreground group processes in hangup") disassociate_ctty() sends SIGCONT
if tty && on_exit.  This breaks LSB test-suite, in particular test8 in
_exit.c and test40 in sigcon5.c.

Put the "!on_exit" check back to restore the old behaviour.

Review by Peter Hurley:
 "Yes, this regression was introduced by me in that commit.  The effect
  of the regression is that ptys will receive a SIGCONT when, in similar
  circumstances, ttys would not.

  The fact that two test vectors accidentally tripped over this
  regression suggests that some other apps may as well.

  Thanks for catching this"

Cc: stable@vger.kernel.org # v3.10+
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Reported-by: default avatarKarel Srot <ksrot@redhat.com>
Reviewed-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent de0bc3df
...@@ -854,7 +854,8 @@ void disassociate_ctty(int on_exit) ...@@ -854,7 +854,8 @@ void disassociate_ctty(int on_exit)
struct pid *tty_pgrp = tty_get_pgrp(tty); struct pid *tty_pgrp = tty_get_pgrp(tty);
if (tty_pgrp) { if (tty_pgrp) {
kill_pgrp(tty_pgrp, SIGHUP, on_exit); kill_pgrp(tty_pgrp, SIGHUP, on_exit);
kill_pgrp(tty_pgrp, SIGCONT, on_exit); if (!on_exit)
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
put_pid(tty_pgrp); put_pid(tty_pgrp);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment