This is a note to let you know that I've just added the patch titled fbcon: set_con2fb_map needs to set con2fb_map! to the 6.2-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-set_con2fb_map-needs-to-set-con2fb_map.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From fffb0b52d5258554c645c966c6cbef7de50b851d Mon Sep 17 00:00:00 2001 From: Daniel Vetter <daniel.vetter@xxxxxxxx> Date: Wed, 12 Apr 2023 17:31:46 +0200 Subject: fbcon: set_con2fb_map needs to set con2fb_map! From: Daniel Vetter <daniel.vetter@xxxxxxxx> commit fffb0b52d5258554c645c966c6cbef7de50b851d upstream. I got really badly confused in d443d9386472 ("fbcon: move more common code into fb_open()") because we set the con2fb_map before the failure points, which didn't look good. But in trying to fix that I moved the assignment into the wrong path - we need to do it for _all_ vc we take over, not just the first one (which additionally requires the call to con2fb_acquire_newinfo). I've figured this out because of a KASAN bug report, where the fbcon_registered_fb and fbcon_display arrays went out of sync in fbcon_mode_deleted() because the con2fb_map pointed at the old fb_info, but the modes and everything was updated for the new one. Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx> Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx> Acked-by: Helge Deller <deller@xxxxxx> Tested-by: Xingyuan Mo <hdthky0@xxxxxxxxx> Fixes: d443d9386472 ("fbcon: move more common code into fb_open()") Reported-by: Xingyuan Mo <hdthky0@xxxxxxxxx> Cc: Thomas Zimmermann <tzimmermann@xxxxxxx> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx> Cc: Xingyuan Mo <hdthky0@xxxxxxxxx> Cc: Thomas Zimmermann <tzimmermann@xxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> # v5.19+ Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/video/fbdev/core/fbcon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -846,10 +846,11 @@ static int set_con2fb_map(int unit, int if (err) return err; - con2fb_map[unit] = newidx; fbcon_add_cursor_work(info); } + con2fb_map[unit] = newidx; + /* * If old fb is not mapped to any of the consoles, * fbcon should release it. Patches currently in stable-queue which might be from daniel.vetter@xxxxxxxx are queue-6.2/fbcon-fix-error-paths-in-set_con2fb_map.patch queue-6.2/fbcon-set_con2fb_map-needs-to-set-con2fb_map.patch queue-6.2/fbmem-reject-fb_activate_kd_text-from-userspace.patch