patch-pre2.0.13 linux/drivers/char/tty_io.c

Next file: linux/drivers/char/vesa_blank.c
Previous file: linux/drivers/char/serial.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.12/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -431,6 +431,9 @@
 	tty->session = 0;
 	tty->pgrp = -1;
 	tty->ctrl_status = 0;
+	tty->packet = 0;
+	if (tty->link)
+		tty->link->packet = 0;
 	if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS)
 		*tty->termios = tty->driver.init_termios;
 	if (tty->driver.hangup)
@@ -1520,6 +1523,10 @@
 			retval = tty_check_change(tty);
 			if (retval)
 				return retval;
+			retval = verify_area(VERIFY_READ, (void *) arg,
+					     sizeof (int));
+			if (retval)
+				return retval;
 			arg = get_user((int *) arg);
 			return tty_set_ldisc(tty, arg);
 		case TIOCLINUX:
@@ -1558,9 +1565,15 @@
 			 * kernel-internal variable; programs not closely
 			 * related to the kernel should not use this.
 			 */
+					retval = verify_area(VERIFY_WRITE, (void *) arg, 1);
+					if (retval)
+						return retval;
 					put_user(shift_state,(char *) arg);
 					return 0;
 				case 7:
+					retval = verify_area(VERIFY_WRITE, (void *) arg, 1);
+					if (retval)
+						return retval;
 					put_user(mouse_reporting(),(char *) arg);
 					return 0;
 				case 10:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this