]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fbcon: check return value of con2fb_acquire_newinfo()
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Wed, 17 Dec 2025 09:11:05 +0000 (09:11 +0000)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:31 +0000 (07:21 -0500)
[ Upstream commit 011a0502801c8536f64141a2b61362c14f456544 ]

If fbcon_open() fails when called from con2fb_acquire_newinfo() then
info->fbcon_par pointer remains NULL which is later dereferenced.

Add check for return value of the function con2fb_acquire_newinfo() to
avoid it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d1baa4ffa677 ("fbcon: set_con2fb_map fixes")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/core/fbcon.c

index e7e07eb2142eb2e4f63b4838d09ade39737284f1..7453377f34336e043702e7fbfba2108fbc43a447 100644 (file)
@@ -1047,7 +1047,8 @@ static void fbcon_init(struct vc_data *vc, bool init)
                return;
 
        if (!info->fbcon_par)
-               con2fb_acquire_newinfo(vc, info, vc->vc_num);
+               if (con2fb_acquire_newinfo(vc, info, vc->vc_num))
+                       return;
 
        /* If we are not the first console on this
           fb, copy the font from that console */