Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 5.10] fbcon: Add check for return value
@ 2025-12-23  6:31 Ваторопин Андрей
  2025-12-23  6:32 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Ваторопин Андрей @ 2025-12-23  6:31 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Ваторопин Андрей,
	Thomas Zimmermann, Greg Kroah-Hartman, Samasth Norway Ananda,
	Zsolt Kajtar, Lucas De Marchi, Antonino A. Daplas, Andrew Morton,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org,
	stable@vger.kernel.org

From: Andrey Vatoropin <a.vatoropin@crpt.ru>

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>
---
 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 3dd03e02bf97..d9b2b54f00db 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1057,7 +1057,8 @@ static void fbcon_init(struct vc_data *vc, int init)
 		return;
 
 	if (!info->fbcon_par)
-		con2fb_acquire_newinfo(vc, info, vc->vc_num, -1);
+		if (con2fb_acquire_newinfo(vc, info, vc->vc_num, -1))
+			return;
 
 	/* If we are not the first console on this
 	   fb, copy the font from that console */
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.10] fbcon: Add check for return value
  2025-12-23  6:31 [PATCH 5.10] fbcon: Add check for return value Ваторопин Андрей
@ 2025-12-23  6:32 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-12-23  6:32 UTC (permalink / raw)
  To: Ваторопин Андрей
  Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3

Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 5.10] fbcon: Add check for return value
Link: https://lore.kernel.org/stable/20251223063055.77545-1-a.vatoropin%40crpt.ru

Please ignore this mail if the patch is not relevant for upstream.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-23  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23  6:31 [PATCH 5.10] fbcon: Add check for return value Ваторопин Андрей
2025-12-23  6:32 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox