diff --git a/patches.kernel.org/6.2.12-027-fbcon-set_con2fb_map-needs-to-set-con2fb_map.patch b/patches.kernel.org/6.2.12-027-fbcon-set_con2fb_map-needs-to-set-con2fb_map.patch new file mode 100644 index 0000000..d9f78d5 --- /dev/null +++ b/patches.kernel.org/6.2.12-027-fbcon-set_con2fb_map-needs-to-set-con2fb_map.patch @@ -0,0 +1,60 @@ +From: Daniel Vetter +Date: Wed, 12 Apr 2023 17:31:46 +0200 +Subject: [PATCH] fbcon: set_con2fb_map needs to set con2fb_map! +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: fffb0b52d5258554c645c966c6cbef7de50b851d + +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 +Reviewed-by: Javier Martinez Canillas +Acked-by: Helge Deller +Tested-by: Xingyuan Mo +Fixes: d443d9386472 ("fbcon: move more common code into fb_open()") +Reported-by: Xingyuan Mo +Cc: Thomas Zimmermann +Cc: Sam Ravnborg +Cc: Xingyuan Mo +Cc: Thomas Zimmermann +Cc: Helge Deller +Cc: # v5.19+ +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + drivers/video/fbdev/core/fbcon.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c +index b9dc29d6..fa205be9 100644 +--- 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 newidx, int user) + 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. +-- +2.35.3 + diff --git a/series.conf b/series.conf index 1863c69..b6b07b4 100644 --- a/series.conf +++ b/series.conf @@ -2254,6 +2254,7 @@ patches.kernel.org/6.2.12-024-mtd-rawnand-stm32_fmc2-use-timings.mode-instea.patch patches.kernel.org/6.2.12-025-KVM-arm64-PMU-Restore-the-guest-s-EL0-event-co.patch patches.kernel.org/6.2.12-026-fbcon-Fix-error-paths-in-set_con2fb_map.patch + patches.kernel.org/6.2.12-027-fbcon-set_con2fb_map-needs-to-set-con2fb_map.patch ######################################################## # Build fixes that apply to the vanilla kernel too.