aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-03-06 16:08:48 -0600
committerLinus Torvalds <torvalds@linux-foundation.org>2020-03-06 16:08:48 -0600
commit2f501bb1802dbbf1467e7999954588da31f635ad (patch)
treeb2eb776eff40c989a0b1c64fe613e5cfddb6ab51 /drivers
parentMerge tag 'for-5.6-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux (diff)
parentvgacon: Fix a UAF in vgacon_invert_region (diff)
downloadwireguard-linux-2f501bb1802dbbf1467e7999954588da31f635ad.tar.xz
wireguard-linux-2f501bb1802dbbf1467e7999954588da31f635ad.zip
Merge tag 'drm-fixes-2020-03-06-1' of git://anongit.freedesktop.org/drm/drm
Pull vgacon fix from Daniel Vetter: "One vgacon input check for stable" * tag 'drm-fixes-2020-03-06-1' of git://anongit.freedesktop.org/drm/drm: vgacon: Fix a UAF in vgacon_invert_region
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console/vgacon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index de7b8382aba9..998b0de1812f 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1316,6 +1316,9 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
static int vgacon_resize(struct vc_data *c, unsigned int width,
unsigned int height, unsigned int user)
{
+ if ((width << 1) * height > vga_vram_size)
+ return -EINVAL;
+
if (width % 2 || width > screen_info.orig_video_cols ||
height > (screen_info.orig_video_lines * vga_default_font_height)/
c->vc_font.height)