diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 13:42:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 13:42:10 +0300 |
commit | 5131dcd7810806fe4ff81ca23dadb47921285e36 (patch) | |
tree | e3fb4dd65c6807fae3a5215cf1310eafecdeb86f /drivers/tty/vt | |
parent | 463e2a2b8996aabc0dca67cc716a00e30bffc110 (diff) | |
parent | a909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff) | |
download | linux-5131dcd7810806fe4ff81ca23dadb47921285e36.tar.xz |
Merge 4.9-rc3 into tty-next
We want the serial/tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r-- | drivers/tty/vt/vt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 804cc3151b13..623264445100 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -859,10 +859,15 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) return 0; + if (new_screen_size > (4 << 20)) + return -EINVAL; newscreen = kmalloc(new_screen_size, GFP_USER); if (!newscreen) return -ENOMEM; + if (vc == sel_cons) + clear_selection(); + old_rows = vc->vc_rows; old_row_size = vc->vc_size_row; @@ -1165,7 +1170,7 @@ static void csi_J(struct vc_data *vc, int vpar) break; case 3: /* erase scroll-back buffer (and whole display) */ scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char, - vc->vc_screenbuf_size >> 1); + vc->vc_screenbuf_size); set_origin(vc); if (con_is_visible(vc)) update_screen(vc); |