patch-2.1.33 linux/drivers/char/console.c

Next file: linux/drivers/char/consolemap.c
Previous file: linux/drivers/char/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.32/linux/drivers/char/console.c linux/drivers/char/console.c
@@ -884,10 +884,10 @@
 	 * related to the kernel should not use this.
 	 */
 	 		data = shift_state;
-			return put_user(data, (char *) arg);
+			return __put_user(data, (char *) arg);
 		case 7:
 			data = mouse_reporting();
-			return put_user(data, (char *) arg);
+			return __put_user(data, (char *) arg);
 		case 10:
 			set_vesa_blanking(arg);
 			return 0;
@@ -1337,11 +1337,17 @@
 	if (currcons == sel_cons)
 		clear_selection();
 
+	if (from_user) {
+		/* just to make sure that noone lurks at places he shouldn't see. */
+		if (verify_area(VERIFY_READ, buf, count))
+			return 0; /* ?? are error codes legal here ?? */
+	}
+
 	disable_bh(CONSOLE_BH);
 	while (!tty->stopped &&	count) {
 		enable_bh(CONSOLE_BH);
 		if (from_user)
-			get_user(c, buf);
+			__get_user(c, buf);
 		else
 			c = *buf;
 		buf++; n++; count--;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov