Henri reported a regression that when a custom bootlogo is exactly as big as the screen, a white bar with the size of the font height is displayed at the bottom of the display. This patch fixes this off-by-one bug, but now -as sashiko-bot noticed- since the logo covers the whole screen there is no area left in which the text can be scrolled. To avoid accesses outside the screen memory simply keep the text area covering the full screen (and possibly overwriting) the full-screen logo. Fixes: 94e6a058b168 ("fbcon: Fix KASAN slab-out-of-bounds Read in fbcon_prepare_logo") Tested-by: Henri Roosen Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v7.3+ --- drivers/video/fbdev/core/fbcon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index d7890e119dc7..cc311dc0e2e4 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -666,7 +666,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, logo_height = fb_prepare_logo(info, par->rotate); logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height); logo_lines = min(logo_lines, rows); - logo_lines = min(logo_lines, new_rows - 1); + logo_lines = min(logo_lines, new_rows); if (logo_lines <= 0) { logo_lines = 0; logo_shown = FBCON_LOGO_DONTSHOW; @@ -734,7 +734,9 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, pr_info("fbcon: disable boot-logo (boot-logo bigger than screen).\n"); } else { logo_shown = FBCON_LOGO_DRAW; - vc->vc_top = logo_lines; + /* keep vc_top if logo covers whole screen */ + if (logo_lines < vc->vc_bottom) + vc->vc_top = logo_lines; } } #endif /* MODULE */ -- 2.56.1