All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.ibm.com>
To: Yizhuo Zhai <yzhai003@ucr.edu>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chengyu Song <csong@cs.ucr.edu>, Zhiyun Qian <zhiyunq@cs.ucr.edu>
Subject: Re: Potential NULL pointer deference in scsi: scsi_transport_spi
Date: Mon, 07 Oct 2019 13:54:27 -0700	[thread overview]
Message-ID: <1570481667.4242.4.camel@linux.ibm.com> (raw)
In-Reply-To: <CABvMjLSoa6WfdmvwCCPgAUtc1ZmQ8+14xrDnz5Q8MrpFstMDsg@mail.gmail.com>

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.
> 


      reply	other threads:[~2019-10-07 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 20:30 Potential NULL pointer deference in scsi: scsi_transport_spi Yizhuo Zhai
2019-10-07 20:54 ` James Bottomley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1570481667.4242.4.camel@linux.ibm.com \
    --to=jejb@linux.ibm.com \
    --cc=csong@cs.ucr.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yzhai003@ucr.edu \
    --cc=zhiyunq@cs.ucr.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.