Patch "vme: Fix error not catched in fake_init()" has been added to the 6.0-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

    vme: Fix error not catched in fake_init()

to the 6.0-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:
     vme-fix-error-not-catched-in-fake_init.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 0787d6f742943b96a80bc62cd01482830c00b66b
Author: Chen Zhongjin <chenzhongjin@xxxxxxxxxx>
Date:   Mon Dec 5 16:48:05 2022 +0800

    vme: Fix error not catched in fake_init()
    
    [ Upstream commit 7bef797d707f1744f71156b21d41e3b8c946631f ]
    
    In fake_init(), __root_device_register() is possible to fail but it's
    ignored, which can cause unregistering vme_root fail when exit.
    
     general protection fault,
     probably for non-canonical address 0xdffffc000000008c
     KASAN: null-ptr-deref in range [0x0000000000000460-0x0000000000000467]
     RIP: 0010:root_device_unregister+0x26/0x60
     Call Trace:
      <TASK>
      __x64_sys_delete_module+0x34f/0x540
      do_syscall_64+0x38/0x90
      entry_SYSCALL_64_after_hwframe+0x63/0xcd
    
    Return error when __root_device_register() fails.
    
    Fixes: 658bcdae9c67 ("vme: Adding Fake VME driver")
    Signed-off-by: Chen Zhongjin <chenzhongjin@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221205084805.147436-1-chenzhongjin@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
index dd646b0c531d..1ee432c223e2 100644
--- a/drivers/staging/vme_user/vme_fake.c
+++ b/drivers/staging/vme_user/vme_fake.c
@@ -1073,6 +1073,8 @@ static int __init fake_init(void)
 
 	/* We need a fake parent device */
 	vme_root = __root_device_register("vme", THIS_MODULE);
+	if (IS_ERR(vme_root))
+		return PTR_ERR(vme_root);
 
 	/* If we want to support more than one bridge at some point, we need to
 	 * dynamically allocate this so we get one per device.



[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