WSL2-Linux-Kernel/drivers/vme/bridges
Chen Zhongjin 4bc217b25e vme: Fix error not catched in fake_init()
[ Upstream commit 7bef797d70 ]

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: 658bcdae9c ("vme: Adding Fake VME driver")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221205084805.147436-1-chenzhongjin@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:30 +01:00
..
Kconfig
Makefile
vme_ca91cx42.c vme: switch from 'pci_' to 'dma_' API 2020-12-09 19:44:34 +01:00
vme_ca91cx42.h
vme_fake.c vme: Fix error not catched in fake_init() 2022-12-31 13:14:30 +01:00
vme_tsi148.c staging: vme_user: Fix possible UAF in tsi148_dma_list_add 2022-12-31 13:14:27 +01:00
vme_tsi148.h