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 4.14-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-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sun Jul 31 01:15:12 PM CEST 2022 From: Chen Jun <chenjun102@xxxxxxxxxx> Date: Fri, 29 Jul 2022 03:11:40 +0000 Subject: fbmem: Check virtual screen sizes in fb_set_var() To: <stable@xxxxxxxxxxxxxxx>, <deller@xxxxxx>, <geert@xxxxxxxxxxxxxx>, <b.zolnierkie@xxxxxxxxxxx>, <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: <xuqiang36@xxxxxxxxxx>, <xiujianfeng@xxxxxxxxxx> Message-ID: <20220729031140.21806-3-chenjun102@xxxxxxxxxx> 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> Link: https://lore.kernel.org/all/20220706150253.2186-1-deller@xxxxxx/ [sudip: adjust context] Signed-off-by: Chen Jun <chenjun102@xxxxxxxxxx> 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) goto done; + /* 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) { struct fb_var_screeninfo old_var; struct fb_videomode mode; Patches currently in stable-queue which might be from chenjun102@xxxxxxxxxx are queue-4.14/fbmem-check-virtual-screen-sizes-in-fb_set_var.patch queue-4.14/fbcon-prevent-that-screen-size-is-smaller-than-font-size.patch