aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>2006-12-06 23:38:38 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:40 -0500
commit403aac965eba17a360a93c3b679f57b21030d4cd (patch)
tree00af3dff083b0834da60fa793749ac973aa9e126 /drivers/char/vt.c
parentdb68b189f4b8026b2f532e1b1bbdba5fcb36638c (diff)
[PATCH] add return value checking of get_user() in set_vesa_blanking()
[akpm@osdl.org: bugfix] Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Cc: James Simmons <jsimmons@infradead.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 75ff0286e1ad..a8239dac994f 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -152,7 +152,7 @@ static void gotoxy(struct vc_data *vc, int new_x, int new_y);
152static void save_cur(struct vc_data *vc); 152static void save_cur(struct vc_data *vc);
153static void reset_terminal(struct vc_data *vc, int do_clear); 153static void reset_terminal(struct vc_data *vc, int do_clear);
154static void con_flush_chars(struct tty_struct *tty); 154static void con_flush_chars(struct tty_struct *tty);
155static void set_vesa_blanking(char __user *p); 155static int set_vesa_blanking(char __user *p);
156static void set_cursor(struct vc_data *vc); 156static void set_cursor(struct vc_data *vc);
157static void hide_cursor(struct vc_data *vc); 157static void hide_cursor(struct vc_data *vc);
158static void console_callback(struct work_struct *ignored); 158static void console_callback(struct work_struct *ignored);
@@ -2369,7 +2369,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
2369 ret = __put_user(data, p); 2369 ret = __put_user(data, p);
2370 break; 2370 break;
2371 case TIOCL_SETVESABLANK: 2371 case TIOCL_SETVESABLANK:
2372 set_vesa_blanking(p); 2372 ret = set_vesa_blanking(p);
2373 break; 2373 break;
2374 case TIOCL_GETKMSGREDIRECT: 2374 case TIOCL_GETKMSGREDIRECT:
2375 data = kmsg_redirect; 2375 data = kmsg_redirect;
@@ -3313,11 +3313,15 @@ postcore_initcall(vtconsole_class_init);
3313 * Screen blanking 3313 * Screen blanking
3314 */ 3314 */
3315 3315
3316static void set_vesa_blanking(char __user *p) 3316static int set_vesa_blanking(char __user *p)
3317{ 3317{
3318 unsigned int mode; 3318 unsigned int mode;
3319 get_user(mode, p + 1); 3319
3320 vesa_blank_mode = (mode < 4) ? mode : 0; 3320 if (get_user(mode, p + 1))
3321 return -EFAULT;
3322
3323 vesa_blank_mode = (mode < 4) ? mode : 0;
3324 return 0;
3321} 3325}
3322 3326
3323void do_blank_screen(int entering_gfx) 3327void do_blank_screen(int entering_gfx)