This is a note to let you know that I've just added the patch titled fbmem: Check virtual screen sizes in fb_set_var() to the 5.10-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: fbmem-check-virtual-screen-sizes-in-fb_set_var.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6c11df58fd1ac0aefcb3b227f72769272b939e56 Mon Sep 17 00:00:00 2001 From: Helge Deller <deller@xxxxxx> Date: Wed, 29 Jun 2022 15:53:55 +0200 Subject: fbmem: Check virtual screen sizes in fb_set_var() From: Helge Deller <deller@xxxxxx> commit 6c11df58fd1ac0aefcb3b227f72769272b939e56 upstream. Verify that the fbdev or drm driver correctly adjusted the virtual screen sizes. On failure report the failing driver and reject the screen size change. Signed-off-by: Helge Deller <deller@xxxxxx> Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v5.4+ Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/video/fbdev/core/fbmem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1019,6 +1019,16 @@ fb_set_var(struct fb_info *info, struct if (ret) return ret; + /* verify that virtual resolution >= physical resolution */ + if (var->xres_virtual < var->xres || + var->yres_virtual < var->yres) { + pr_warn("WARNING: fbcon: Driver '%s' missed to adjust virtual screen size (%ux%u vs. %ux%u)\n", + info->fix.id, + var->xres_virtual, var->yres_virtual, + var->xres, var->yres); + return -EINVAL; + } + if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) return 0; Patches currently in stable-queue which might be from deller@xxxxxx are queue-5.10/fbcon-disallow-setting-font-bigger-than-screen-size.patch queue-5.10/fbmem-check-virtual-screen-sizes-in-fb_set_var.patch queue-5.10/fbcon-prevent-that-screen-size-is-smaller-than-font-size.patch queue-5.10/fbdev-fbmem-fix-logo-center-image-dx-issue.patch queue-5.10/video-of_display_timing.h-include-errno.h.patch