Re: Problems in tty_ioctl?

Magnus Sjoegren (m-23347@mailbox.swipnet.se)
Tue, 30 Dec 1997 07:40:25 +0100 (MET)


On Mon, 29 Dec 1997, T Taneli Vahakangas wrote:

> Hello, Kernel Hackers!
>
> I am using kernel version 2.1.76. Today, I tried a program called
> 9term (it's a terminal emulator for X) and wondered why did it exit
> right after pressing a key. To my amusement, the program died because
> of an oops (attached, but looks weird). The kernel stumbled in
> tty_ioctl().
>

I get the same oops when using sz/rz transfers since atleast 2.1.66.
Haven't recieved any answers explaining what happends.

> The following patch cures the problem, but probably not the cause:
>
[snip]

This works. No more oops'es for me.

> The oops was triggered because tty->driver.ioctl was a NULL pointer
> (the ptys don't have driver.ioctl?). This makes me wonder what would
> be the right fix? Should ptys have ioctl()? A simple one would do
> pretty well:
>
> pty_driver_ioctl(...)
> {
> return -ENOIOCTLCMD;
> }
>
> Or some such... But clearly the current behavior is broken, since an
> usermode program reproducibly triggers an oops...
>
> (BTW, what use is 9term? Couldn't think of any...)

sz/rz is widely used and triggers it too.

Magnus