* driver/bug: suspected missing null check in hisi_lpc.c
@ 2021-10-25 15:22 YE Chengfeng
2021-10-25 15:31 ` 回复: " YE Chengfeng
0 siblings, 1 reply; 4+ messages in thread
From: YE Chengfeng @ 2021-10-25 15:22 UTC (permalink / raw)
To: linux-kernel, john.garry
Hi,
https://github.com/torvalds/linux/blob/master/drivers/bus/hisi_lpc.c#L483
Our experimental static analysis tool detects a null-ptr-reference problem. It could be false positive, we report this to you just in case.
Null check is missing for the return pointer of ACPI_COMPANION at line 483 and line 504. It seems that there could be potential null-ptr-dereference problem at line 488 and line 509. Could you spare some time to have a look at it?
Thanks so much,
Chengfeng
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复: driver/bug: suspected missing null check in hisi_lpc.c
2021-10-25 15:22 driver/bug: suspected missing null check in hisi_lpc.c YE Chengfeng
@ 2021-10-25 15:31 ` YE Chengfeng
2021-10-26 10:32 ` John Garry
0 siblings, 1 reply; 4+ messages in thread
From: YE Chengfeng @ 2021-10-25 15:31 UTC (permalink / raw)
To: linux-kernel, john.garry
It is driver/bus, sorry for the typo.
-----邮件原件-----
发件人: YE Chengfeng
发送时间: 2021年10月25日 23:22
收件人: linux-kernel@vger.kernel.org; john.garry@huawei.com
主题: driver/bug: suspected missing null check in hisi_lpc.c
Hi,
https://github.com/torvalds/linux/blob/master/drivers/bus/hisi_lpc.c#L483
Our experimental static analysis tool detects a null-ptr-reference problem. It could be false positive, we report this to you just in case.
Null check is missing for the return pointer of ACPI_COMPANION at line 483 and line 504. It seems that there could be potential null-ptr-dereference problem at line 488 and line 509. Could you spare some time to have a look at it?
Thanks so much,
Chengfeng
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 回复: driver/bug: suspected missing null check in hisi_lpc.c
2021-10-25 15:31 ` 回复: " YE Chengfeng
@ 2021-10-26 10:32 ` John Garry
2021-10-26 12:25 ` 回复: " YE Chengfeng
0 siblings, 1 reply; 4+ messages in thread
From: John Garry @ 2021-10-26 10:32 UTC (permalink / raw)
To: YE Chengfeng, linux-kernel
On 25/10/2021 16:31, YE Chengfeng wrote:
> It is driver/bus, sorry for the typo.
>
> -----邮件原件-----
> 发件人: YE Chengfeng
> 发送时间: 2021年10月25日 23:22
> 收件人: linux-kernel@vger.kernel.org; john.garry@huawei.com
> 主题: driver/bug: suspected missing null check in hisi_lpc.c
>
> Hi,
>
> https://github.com/torvalds/linux/blob/master/drivers/bus/hisi_lpc.c#L483
>
> Our experimental static analysis tool detects a null-ptr-reference problem. It could be false positive, we report this to you just in case.
>
> Null check is missing for the return pointer of ACPI_COMPANION at line 483 and line 504. It seems that there could be potential null-ptr-dereference problem at line 488 and line 509. Could you spare some time to have a look at it?
>
> Thanks so much,
> Chengfeng
>
I don't think that we should have a problem as ACPI_COMPANION() should
just not return NULL for us. But I can't give you a better reason than
that without fully examining the ACPI code, which I'm not keen on...
Thanks,
John
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复: 回复: driver/bug: suspected missing null check in hisi_lpc.c
2021-10-26 10:32 ` John Garry
@ 2021-10-26 12:25 ` YE Chengfeng
0 siblings, 0 replies; 4+ messages in thread
From: YE Chengfeng @ 2021-10-26 12:25 UTC (permalink / raw)
To: John Garry, linux-kernel
Thanks for your reply.
You are right. I found that null-check is already performed in the caller of this two function. Sorry for the bothering.
Best Regards,
Chengfeng
-----邮件原件-----
发件人: John Garry <john.garry@huawei.com>
发送时间: 2021年10月26日 18:33
收件人: YE Chengfeng <cyeaa@connect.ust.hk>; linux-kernel@vger.kernel.org
主题: Re: 回复: driver/bug: suspected missing null check in hisi_lpc.c
On 25/10/2021 16:31, YE Chengfeng wrote:
> It is driver/bus, sorry for the typo.
>
> -----邮件原件-----
> 发件人: YE Chengfeng
> 发送时间: 2021年10月25日 23:22
> 收件人: linux-kernel@vger.kernel.org; john.garry@huawei.com
> 主题: driver/bug: suspected missing null check in hisi_lpc.c
>
> Hi,
>
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2Fdrivers%2Fbus%2Fhisi_lpc.c
> %23L483&data=04%7C01%7Ccyeaa%40connect.ust.hk%7Cc26f0b4a52504737c2
> 7508d9986bf5ae%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C6377084117
> 14447677%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL
> CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lkx93QoK%2FN1ilG0u5il5l
> hVjUiAbVY6RX%2FuJh%2BBHmuI%3D&reserved=0
>
> Our experimental static analysis tool detects a null-ptr-reference problem. It could be false positive, we report this to you just in case.
>
> Null check is missing for the return pointer of ACPI_COMPANION at line 483 and line 504. It seems that there could be potential null-ptr-dereference problem at line 488 and line 509. Could you spare some time to have a look at it?
>
> Thanks so much,
> Chengfeng
>
I don't think that we should have a problem as ACPI_COMPANION() should just not return NULL for us. But I can't give you a better reason than that without fully examining the ACPI code, which I'm not keen on...
Thanks,
John
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-26 12:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 15:22 driver/bug: suspected missing null check in hisi_lpc.c YE Chengfeng
2021-10-25 15:31 ` 回复: " YE Chengfeng
2021-10-26 10:32 ` John Garry
2021-10-26 12:25 ` 回复: " YE Chengfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).