* Potential NULL pointer deference in scsi: scsi_transport_spi
@ 2019-10-07 20:30 Yizhuo Zhai
2019-10-07 20:54 ` James Bottomley
0 siblings, 1 reply; 2+ messages in thread
From: Yizhuo Zhai @ 2019-10-07 20:30 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, Chengyu Song, Zhiyun Qian
Hi All:
drivers/scsi/scsi_transport_spi.c:
Inside function store_spi_transport_period(), dev_to_shost()
could return NULL, however, the return value shost is not
checked and get used. This could potentially be unsafe.
--
Kind Regards,
Yizhuo Zhai
Computer Science, Graduate Student
University of California, Riverside
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Potential NULL pointer deference in scsi: scsi_transport_spi
2019-10-07 20:30 Potential NULL pointer deference in scsi: scsi_transport_spi Yizhuo Zhai
@ 2019-10-07 20:54 ` James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2019-10-07 20:54 UTC (permalink / raw)
To: Yizhuo Zhai, Martin K. Petersen, linux-scsi, linux-kernel,
Chengyu Song, Zhiyun Qian
On Mon, 2019-10-07 at 13:30 -0700, Yizhuo Zhai wrote:
> Hi All:
>
> drivers/scsi/scsi_transport_spi.c:
>
> Inside function store_spi_transport_period(), dev_to_shost()
> could return NULL
No, it can't. The device model ensures that a SCSI target or device
must be parented to a host.
James
> , however, the return value shost is not
> checked and get used. This could potentially be unsafe.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-07 20:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 20:30 Potential NULL pointer deference in scsi: scsi_transport_spi Yizhuo Zhai
2019-10-07 20:54 ` James Bottomley
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).