/dev/ptmx kernel panic PATCH

Troy Benjegerdes (hozer@drgw.net)
Sun, 1 Nov 1998 20:12:51 -0600 (CST)


I don't know if anyone has already fixed this, so here goes:

If UNIX98_PTY is disabled and dev/ptmx exists, I was getting a kernel
panic when trying to log in via SSH on glibc-2.0.98.

With this patch it simply refuses the pty. (much preferable to a kernel
panic I think)

(this is with kernel 2.1.125 from the vger CVS archive on a PPC system)

[hozer@kalmia char]$ cvs diff -uN tty_io.c
Index: tty_io.c
===================================================================
RCS file: /cvsroot/linux/drivers/char/tty_io.c,v
retrieving revision 1.75
diff -u -r1.75 tty_io.c
--- tty_io.c 1998/10/07 03:44:38 1.75
+++ tty_io.c 1998/10/21 21:46:57
@@ -1286,7 +1286,11 @@
noctty = 1;
goto init_dev_done;
}
-#endif
+#else /* CONFIG_UNIX_98_PTYS */
+ if ( device == PTMX_DEV )
+ /* Don't allow this if we don't support it */
+ return ENODEV;
+#endif /* CONFIG_UNIX_98_PTYS */

retval = init_dev(device, &tty);
if (retval)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/