PATCH: Ooops at location 0, kernel 2.1.76, in pty.c

Kip Rugger (kbr@pangea.ca)
Mon, 5 Jan 98 01:35 CST


SYMPTOM: Ooops at location 0 during vile initialization on a pty.

KERNEL VERSION: 2.1.76

SYNOPSIS: vile initialization does ioctl(,TCSBRK, 1); on a pty
tty_ioctl accesses the pty_driver vector for method ioctl
the pty_driver.ioctl word is zero, system Ooops at location 0.

--- pty.c~ Sat Jun 28 12:31:36 1997
+++ pty.c Mon Jan 5 01:07:58 1998
@@ -191,6 +191,15 @@
return ((count < N_TTY_BUF_SIZE/2) ? 0 : count);
}

+/*
+* Dummy ioctl routine to satisfy tty_ioctl calling conventions.
+*/
+static int pty_ioctl(struct tty_struct *tty, struct file * file,
+ unsigned int cmd, unsigned long arg)
+{
+ return -ENOIOCTLCMD;
+}
+
static void pty_flush_buffer(struct tty_struct *tty)
{
struct tty_struct *to = tty->link;
@@ -272,6 +281,7 @@
pty_driver.write_room = pty_write_room;
pty_driver.flush_buffer = pty_flush_buffer;
pty_driver.chars_in_buffer = pty_chars_in_buffer;
+ pty_driver.ioctl = pty_ioctl;
pty_driver.unthrottle = pty_unthrottle;
pty_driver.set_termios = pty_set_termios;