mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Tadeusz Struk <tadeusz.struk@linaro.org>, linux-scsi@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	syzbot+5516b30f5401d4dcbcae@syzkaller.appspotmail.com,
	Doug Gilbert <dgilbert@interlog.com>
Subject: Re: [PATCH] scsi: core: initialize cmd->cmnd before it is used
Date: Mon, 1 Nov 2021 13:20:19 -0700	[thread overview]
Message-ID: <da8d3418-b95c-203d-16c3-8c4086ceaf73@acm.org> (raw)
In-Reply-To: <0024e0e1-589c-e2cd-2468-f4af8ec1cb95@linaro.org>

On 11/1/21 1:13 PM, Tadeusz Struk wrote:
> On 11/1/21 13:06, Bart Van Assche wrote:
>> This patch is a duplicate and has been posted before.
>>
>> Please take a look at https://lore.kernel.org/linux-scsi/20210904064534.1919476-1-qiulaibin@huawei.com/.
>>  From the replies to that email:
>> "> 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."
> 
> Thanks for quick response, but I'm not sure if statement
> "cmd_len should never be 0 now" is correct, because the cmd_len is
> in fact equal to 0 here and this BUG can be triggered on mainline, 5.14,
> and 5.10 stable kernels.

(+Doug Gilbert)

One of the functions in the call stack in the first message of this email
thread is sg_io(). I am not aware of any documentation that specifies whether
it is valid to set cmd_len in the sg_io header to zero. My opinion is that
the SG_IO implementation should either reject cmd_len == 0 or set cmd_len
to a valid value if it is zero.

Bart.



  reply	other threads:[~2021-11-01 20:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 19:24 Tadeusz Struk
2021-11-01 20:06 ` Bart Van Assche
2021-11-01 20:13   ` Tadeusz Struk
2021-11-01 20:20     ` Bart Van Assche [this message]
2021-11-02  1:56       ` Douglas Gilbert
2021-11-02  3:06         ` Bart Van Assche
2021-11-02 21:33           ` Douglas Gilbert
2021-11-02 22:22             ` Tadeusz Struk
2021-11-02 22:27               ` Bart Van Assche
2021-11-02 23:01                 ` Tadeusz Struk

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=da8d3418-b95c-203d-16c3-8c4086ceaf73@acm.org \
    --to=bvanassche@acm.org \
    --cc=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+5516b30f5401d4dcbcae@syzkaller.appspotmail.com \
    --cc=tadeusz.struk@linaro.org \
    /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

all inboxes | Powered by JetHome®