From: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
Newsgroups: comp.os.linux.announce
Subject: New version of Serial patches
Date: 20 Dec 1993 01:56:29 +0200
Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
Message-ID: <2f2pnd$dkt@klaava.Helsinki.FI>

I have a new version of serial patches available on tsx-11.mit.edu, in
/pub/linux/ALPHA/serial.  It fixes a very serious race condition bug
which was always present in the serial code, but (fortunately) the first
set of patches I set out a few days ago made the problem much worse.
(Fortunately becauase now I've been able to fix it once and for all.)

So if you run serial ports with a lot of incoming and/or outgoing
traffic, please try this patch out.  If you took the December 8th serial
patches, you should definitely back those changes out, and take this
one.

As always, please send bugs, comments, etc. to me (tytso@mit.edu).

							- Ted

This is the second set of patches to the serial drive in 0.99pl14,
dated December 14, 1993.  It contains the following improvements over
the last set of patches:

	* Fix a nasty race condition in rs_close() and tty_hangup()
		which caused kernel hangs or outright panics in
		rs_interrupt().  This would tend to happen only on
		machines which serial ports serving as both as callout
		and dialup devices.

	* Line disciplines are now reset when a terminal is completely
		freed.  This allows a Linux box which is working as a
		SLIP or PPP server to do the right thing when user
		hangs up.

	* Fix security hole in TIOCSTTY handling; if a root process
		forcibly takes over a tty as its controlling tty while
		another session group still has that tty, the tty is
		disassociated from the old session group before it is
		given to the calling process as the controlling tty.

		(NOTE: getty's really shouldn't be using TIOCSTTY
		anyway, since processes which have the tty open can
		still read/write to it.  getty/login should be using
		vhangup instead.)

It also contains the following improves over the serial driver in
0.99pl14:

	* Set FIFO trigger level to 1 if baud rate is under 2400.
		This will improve response time on 16550A's when they
		are operating at slow speeds; specifically when you're 
		using them with a mouse. 

	* Overrun conditions are now passed up to tty_io.c, and an
		appropriate warning message is printed.  (Previously,
		tty_io.c would handle it as a randomly as either a
		frame error, a parity error, or a break.)

	* Use a separate flag for hardware flow control, so that
		the right thing happens when both XON/XOFF and RTS/CTS
		flow control are enabled.

	* Allow the callout devices to be a controlling tty.

	* Hangup handling fixed; some race conditions removed.  The
		device specific close now happens at the instant when
		the hangup is signaled, instead of waiting until the
		the process closed the file descriptor.  This should
		fix the problems with background processes that still
		have the tty opened when the modem hangs up.  Linux
		will now deal correctly with this case.

Please try these changes out, especially if you support dialup via
modems.  There are a bunch of tricky race conditions with the hangup
code, which I *think* that I've resolved.  I want to make sure that
they work, though, before submitting them to Linux for inclusion in
the mainline kernel.  Please try them out and let me know how they
work on your system.  

					Ted Ts'o
					tytso@mit.edu
					12/14/93

--
Mail submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
PLEASE remember Keywords: and a short description of the software.
