[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8f90dbbe-51b0-67c8-d6cb-3bd9c1d9d481@huawei.com>
Date: Tue, 6 Dec 2022 09:53:38 +0800
From: Chen Zhongjin <chenzhongjin@...wei.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: <linux-staging@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
<martyn@...chs.me.uk>, <manohar.vanga@...il.com>, <arnd@...db.de>
Subject: Re: [PATCH] vme: Fix error not catched in fake_init()
Hi,
On 2022/12/5 20:31, Greg KH wrote:
> On Mon, Dec 05, 2022 at 04:48:05PM +0800, Chen Zhongjin wrote:
>> 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@...wei.com>
>> ---
>> drivers/staging/vme_user/vme_fake.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> 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);
> This should be calling root_device_register() as well, not this version
> of the call.
Of course it should. Have sent another patch for it.
Thanks for your time!
Chen
> thanks,
>
> greg k-h
Powered by blists - more mailing lists