All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/cxl: suspected null pointer dereference in core/bus.c
@ 2021-10-27 11:35 YE Chengfeng
  2021-10-27 15:04 ` Ben Widawsky
  0 siblings, 1 reply; 3+ messages in thread
From: YE Chengfeng @ 2021-10-27 11:35 UTC (permalink / raw)
  To: alison.schofield, vishal.l.verma, ira.weiny, ben.widawsky,
	dan.j.williams, Jonathan.Cameron
  Cc: linux-kernel

Hi,

https://github.com/torvalds/linux/blob/master/drivers/cxl/core/bus.c#L98

We notice that in multiple call sites, the return pointer of to_cxl_decoder is not null-checked, could it be a potential null-pointer-dereference problem?

This is detected by our experimental static analysis tool, it could be false positive, we manually check and report those we think may be true issues. Would you like to have a look at them?

Thanks so much,
Chengfeng

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/cxl: suspected null pointer dereference in core/bus.c
  2021-10-27 11:35 drivers/cxl: suspected null pointer dereference in core/bus.c YE Chengfeng
@ 2021-10-27 15:04 ` Ben Widawsky
  2021-10-28  2:20   ` 回复: " YE Chengfeng
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Widawsky @ 2021-10-27 15:04 UTC (permalink / raw)
  To: YE Chengfeng
  Cc: alison.schofield, vishal.l.verma, ira.weiny, dan.j.williams,
	Jonathan.Cameron, linux-kernel, linux-cxl

On 21-10-27 11:35:25, YE Chengfeng wrote:
> Hi,
> 
> https://github.com/torvalds/linux/blob/master/drivers/cxl/core/bus.c#L98
> 
> We notice that in multiple call sites, the return pointer of to_cxl_decoder is not null-checked, could it be a potential null-pointer-dereference problem?
> 
> This is detected by our experimental static analysis tool, it could be false positive, we manually check and report those we think may be true issues. Would you like to have a look at them?
> 
> Thanks so much,
> Chengfeng

add linux-cxl...

If NULL is returned, it's a driver bug. The WARN_ON and subsequent NULL deref
oops is desirable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 回复: drivers/cxl: suspected null pointer dereference in core/bus.c
  2021-10-27 15:04 ` Ben Widawsky
@ 2021-10-28  2:20   ` YE Chengfeng
  0 siblings, 0 replies; 3+ messages in thread
From: YE Chengfeng @ 2021-10-28  2:20 UTC (permalink / raw)
  To: Ben Widawsky
  Cc: alison.schofield, vishal.l.verma, ira.weiny, dan.j.williams,
	Jonathan.Cameron, linux-kernel, linux-cxl

Got it.
Thanks for your reply.

Best regards,
Chengfeng

-----邮件原件-----
发件人: Ben Widawsky <ben.widawsky@intel.com> 
发送时间: 2021年10月27日 23:04
收件人: YE Chengfeng <cyeaa@connect.ust.hk>
抄送: alison.schofield@intel.com; vishal.l.verma@intel.com; ira.weiny@intel.com; dan.j.williams@intel.com; Jonathan.Cameron@huawei.com; linux-kernel@vger.kernel.org; linux-cxl@vger.kernel.org
主题: Re: drivers/cxl: suspected null pointer dereference in core/bus.c

On 21-10-27 11:35:25, YE Chengfeng wrote:
> Hi,
> 
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftorvalds%2Flinux%2Fblob%2Fmaster%2Fdrivers%2Fcxl%2Fcore%2Fbus
> .c%23L98&amp;data=04%7C01%7Ccyeaa%40connect.ust.hk%7C778468ba05844313f
> f7108d9995b19ad%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637709438
> 820451633%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIi
> LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Tz4HyXAH6ov5wZ7ijhLBva
> IyEC9JojDZMWMSUY7pHLg%3D&amp;reserved=0
> 
> We notice that in multiple call sites, the return pointer of to_cxl_decoder is not null-checked, could it be a potential null-pointer-dereference problem?
> 
> This is detected by our experimental static analysis tool, it could be false positive, we manually check and report those we think may be true issues. Would you like to have a look at them?
> 
> Thanks so much,
> Chengfeng

add linux-cxl...

If NULL is returned, it's a driver bug. The WARN_ON and subsequent NULL deref oops is desirable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-28  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 11:35 drivers/cxl: suspected null pointer dereference in core/bus.c YE Chengfeng
2021-10-27 15:04 ` Ben Widawsky
2021-10-28  2:20   ` 回复: " YE Chengfeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.