This is a note to let you know that I've just added the patch titled fbcon: Disallow setting font bigger than screen size to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: fbcon-disallow-setting-font-bigger-than-screen-size.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 65a01e601dbba8b7a51a2677811f70f783766682 Mon Sep 17 00:00:00 2001 From: Helge Deller <deller@xxxxxx> Date: Sat, 25 Jun 2022 12:56:49 +0200 Subject: fbcon: Disallow setting font bigger than screen size From: Helge Deller <deller@xxxxxx> commit 65a01e601dbba8b7a51a2677811f70f783766682 upstream. Prevent that users set a font size which is bigger than the physical screen. It's unlikely this may happen (because screens are usually much larger than the fonts and each font char is limited to 32x32 pixels), but it may happen on smaller screens/LCD displays. Signed-off-by: Helge Deller <deller@xxxxxx> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx> Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v4.14+ Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/video/fbdev/core/fbcon.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -2480,6 +2480,11 @@ static int fbcon_set_font(struct vc_data if (charcount != 256 && charcount != 512) return -EINVAL; + /* font bigger than screen resolution ? */ + if (w > FBCON_SWAP(info->var.rotate, info->var.xres, info->var.yres) || + h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres)) + return -EINVAL; + /* Make sure drawing engine can handle the font */ if (!(info->pixmap.blit_x & (1 << (font->width - 1))) || !(info->pixmap.blit_y & (1 << (font->height - 1)))) Patches currently in stable-queue which might be from deller@xxxxxx are queue-5.18/fbcon-disallow-setting-font-bigger-than-screen-size.patch queue-5.18/fbmem-check-virtual-screen-sizes-in-fb_set_var.patch queue-5.18/fbcon-prevent-that-screen-size-is-smaller-than-font-size.patch queue-5.18/fbdev-fbmem-fix-logo-center-image-dx-issue.patch queue-5.18/video-of_display_timing.h-include-errno.h.patch