Skip to content

Commit 2939a79

Browse files
committed
Merge tag 'fbdev-for-6.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev fixes for 6.17-rc1: - Revert a patch which broke VGA console - Fix an out-of-bounds access bug which may happen during console resizing when a console is mapped to a frame buffer * tag 'fbdev-for-6.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: Revert "vgacon: Add check for vc_origin address range in vgacon_scroll()" fbdev: Fix vmalloc out-of-bounds write in fast_imageblit
2 parents 83affac + e4fc307 commit 2939a79

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

drivers/video/console/vgacon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
11681168
c->vc_screenbuf_size - delta);
11691169
c->vc_origin = vga_vram_end - c->vc_screenbuf_size;
11701170
vga_rolled_over = 0;
1171-
} else if (oldo - delta >= (unsigned long)c->vc_screenbuf)
1171+
} else
11721172
c->vc_origin -= delta;
11731173
c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
11741174
scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char,

drivers/video/fbdev/core/fbcon.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
837837
fg_vc->vc_rows);
838838
}
839839

840-
update_screen(vc_cons[fg_console].d);
840+
if (fg_console != unit)
841+
update_screen(vc_cons[fg_console].d);
841842
}
842843

843844
/**
@@ -1375,6 +1376,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
13751376
struct vc_data *svc;
13761377
struct fbcon_ops *ops = info->fbcon_par;
13771378
int rows, cols;
1379+
unsigned long ret = 0;
13781380

13791381
p = &fb_display[unit];
13801382

@@ -1425,11 +1427,10 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
14251427
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
14261428
cols /= vc->vc_font.width;
14271429
rows /= vc->vc_font.height;
1428-
vc_resize(vc, cols, rows);
1430+
ret = vc_resize(vc, cols, rows);
14291431

1430-
if (con_is_visible(vc)) {
1432+
if (con_is_visible(vc) && !ret)
14311433
update_screen(vc);
1432-
}
14331434
}
14341435

14351436
static __inline__ void ywrap_up(struct vc_data *vc, int count)

0 commit comments

Comments
 (0)