Patch "fbcon: Use kzalloc() in fbcon_prepare_logo()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    fbcon: Use kzalloc() in fbcon_prepare_logo()

to the 5.15-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-use-kzalloc-in-fbcon_prepare_logo.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8bfcef83422886e108c91a908f62bcc88826c244
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Fri Nov 18 00:27:58 2022 +0900

    fbcon: Use kzalloc() in fbcon_prepare_logo()
    
    [ Upstream commit a6a00d7e8ffd78d1cdb7a43f1278f081038c638f ]
    
    A kernel built with syzbot's config file reported that
    
      scr_memcpyw(q, save, array3_size(logo_lines, new_cols, 2))
    
    causes uninitialized "save" to be copied.
    
      ----------
      [drm] Initialized vgem 1.0.0 20120112 for vgem on minor 0
      [drm] Initialized vkms 1.0.0 20180514 for vkms on minor 1
      Console: switching to colour frame buffer device 128x48
      =====================================================
      BUG: KMSAN: uninit-value in do_update_region+0x4b8/0xba0
       do_update_region+0x4b8/0xba0
       update_region+0x40d/0x840
       fbcon_switch+0x3364/0x35e0
       redraw_screen+0xae3/0x18a0
       do_bind_con_driver+0x1cb3/0x1df0
       do_take_over_console+0x11cb/0x13f0
       fbcon_fb_registered+0xacc/0xfd0
       register_framebuffer+0x1179/0x1320
       __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40
       drm_fbdev_client_hotplug+0xbea/0xda0
       drm_fbdev_generic_setup+0x65e/0x9d0
       vkms_init+0x9f3/0xc76
       (...snipped...)
    
      Uninit was stored to memory at:
       fbcon_prepare_logo+0x143b/0x1940
       fbcon_init+0x2c1b/0x31c0
       visual_init+0x3e7/0x820
       do_bind_con_driver+0x14a4/0x1df0
       do_take_over_console+0x11cb/0x13f0
       fbcon_fb_registered+0xacc/0xfd0
       register_framebuffer+0x1179/0x1320
       __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40
       drm_fbdev_client_hotplug+0xbea/0xda0
       drm_fbdev_generic_setup+0x65e/0x9d0
       vkms_init+0x9f3/0xc76
       (...snipped...)
    
      Uninit was created at:
       __kmem_cache_alloc_node+0xb69/0x1020
       __kmalloc+0x379/0x680
       fbcon_prepare_logo+0x704/0x1940
       fbcon_init+0x2c1b/0x31c0
       visual_init+0x3e7/0x820
       do_bind_con_driver+0x14a4/0x1df0
       do_take_over_console+0x11cb/0x13f0
       fbcon_fb_registered+0xacc/0xfd0
       register_framebuffer+0x1179/0x1320
       __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40
       drm_fbdev_client_hotplug+0xbea/0xda0
       drm_fbdev_generic_setup+0x65e/0x9d0
       vkms_init+0x9f3/0xc76
       (...snipped...)
    
      CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc4-00356-g8f2975c2bb4c #924
      Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      ----------
    
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/cad03d25-0ea0-32c4-8173-fd1895314bce@xxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index e035a63bbe5b..1f37904b0405 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -601,7 +601,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		if (scr_readw(r) != vc->vc_video_erase_char)
 			break;
 	if (r != q && new_rows >= rows + logo_lines) {
-		save = kmalloc(array3_size(logo_lines, new_cols, 2),
+		save = kzalloc(array3_size(logo_lines, new_cols, 2),
 			       GFP_KERNEL);
 		if (save) {
 			int i = cols < new_cols ? cols : new_cols;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux