diff --git a/TTY-do-not-reset-master-s-packet-mode.patch b/TTY-do-not-reset-master-s-packet-mode.patch new file mode 100644 index 0000000..633bfcf --- /dev/null +++ b/TTY-do-not-reset-master-s-packet-mode.patch @@ -0,0 +1,63 @@ +From b81273a132177edd806476b953f6afeb17b786d5 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Tue, 15 Jan 2013 23:26:22 +0100 +Subject: [PATCH] TTY: do not reset master's packet mode + +Now that login from util-linux is forced to drop all references to a +TTY which it wants to hangup (to reach reference count 1) we are +seeing issues with telnet. When login closes its last reference to the +slave PTY, it also resets packet mode on the *master* side. And we +have a race here. + +What telnet does is fork+exec of `login'. Then there are two +scenarios: +* `login' closes the slave TTY and resets thus master's packet mode, + but even now telnet properly sets the mode, or +* `telnetd' sets packet mode on the master, `login' closes the slave + TTY and resets master's packet mode. + +The former case is OK. However the latter happens in much more cases, +by the order of magnitude to be precise. So when one tries to login to +such a messed telnet setup, they see the following: +inux login: + ogin incorrect + +Note the missing first letters -- telnet thinks it is still in the +packet mode, so when it receives "linux login" from `login', it +considers "l" as the type of the packet and strips it. + +SuS does not mention how the implementation should behave. Both BSDs I +checked (Free and Net) do not reset the flag upon the last close. + +By this I am resurrecting an old bug, see References. We are hitting +it regularly now, i.e. with updated util-linux, ergo login. + +Here, I am changing a behavior introduced back in 2.1 times. It would +better have a long time testing before goes upstream. + +Signed-off-by: Jiri Slaby +Cc: Mauro Carvalho Chehab +Cc: Bryan Mason +References: https://lkml.org/lkml/2009/11/11/223 +References: https://bugzilla.redhat.com/show_bug.cgi?id=504703 +References: https://bugzilla.novell.com/show_bug.cgi?id=797042 +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/pty.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c +index 4ec11f3..40ff2bf 100644 +--- a/drivers/tty/pty.c ++++ b/drivers/tty/pty.c +@@ -47,7 +47,6 @@ static void pty_close(struct tty_struct *tty, struct file *filp) + /* Review - krefs on tty_link ?? */ + if (!tty->link) + return; +- tty->link->packet = 0; + set_bit(TTY_OTHER_CLOSED, &tty->link->flags); + wake_up_interruptible(&tty->link->read_wait); + wake_up_interruptible(&tty->link->write_wait); +-- +1.8.1.2 + diff --git a/kernel.spec b/kernel.spec index 63fd667..7ac3840 100644 --- a/kernel.spec +++ b/kernel.spec @@ -54,7 +54,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 106 +%global baserelease 107 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -763,6 +763,9 @@ Patch24102: backlight_revert.patch Patch24103: turbostat-makefile.diff +#rhbz 904182 +Patch24104: TTY-do-not-reset-master-s-packet-mode.patch + # END OF PATCH DEFINITIONS %endif @@ -1484,6 +1487,9 @@ ApplyPatch backlight_revert.patch -R ApplyPatch turbostat-makefile.diff +#rhbz 904182 +ApplyPatch TTY-do-not-reset-master-s-packet-mode.patch + # END OF PATCH APPLICATIONS %endif @@ -2340,6 +2346,9 @@ fi # '-' | | # '-' %changelog +* Mon Mar 11 2013 Josh Boyer +- Add patch to fix broken tty handling (rhbz 904182) + * Fri Mar 08 2013 Josh Boyer - Add turbostat and x86_engery_perf_policy debuginfo to kernel-tools-debuginfo