From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Laibin Qiu <qiulaibin@huawei.com>,
jejb@linux.ibm.com, martin.petersen@oracle.com, hare@suse.de,
linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH -next] [SCSI] Fix NULL pointer dereference in handling for passthrough commands
Date: Tue, 7 Sep 2021 08:54:38 +0200 [thread overview]
Message-ID: <20210907065438.GA29528@lst.de> (raw)
In-Reply-To: <1b056b0b-fd96-03db-b19a-8bff6c40f8f0@acm.org>
On Mon, Sep 06, 2021 at 05:40:35PM -0700, Bart Van Assche wrote:
> On 9/3/21 23:45, Laibin Qiu wrote:
>> cmd->cmd_len = scsi_req(req)->cmd_len;
>> + cmd->cmnd = scsi_req(req)->cmd;
>> if (cmd->cmd_len == 0)
>> cmd->cmd_len = scsi_command_size(cmd->cmnd);
>> - cmd->cmnd = scsi_req(req)->cmd;
>> cmd->transfersize = blk_rq_bytes(req);
>
> Thinking further about this: is there any code left that depends on
> scsi_setup_scsi_cmnd() setting cmd->cmd_len? Can the cmd->cmd_len
> assignment be removed from scsi_setup_scsi_cmnd()?
cmd_len should never be 0 now, so I think we can remove it.
prev parent reply other threads:[~2021-09-07 6:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-04 6:45 [PATCH -next] [SCSI] Fix NULL pointer dereference in handling for passthrough commands Laibin Qiu
2021-09-05 4:49 ` Bart Van Assche
2021-09-07 0:40 ` Bart Van Assche
2021-09-07 6:54 ` Christoph Hellwig [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=20210907065438.GA29528@lst.de \
--to=hch@lst.de \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=qiulaibin@huawei.com \
/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 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).