From: Tadeusz Struk <tadeusz.struk@linaro.org>
To: Bart Van Assche <bvanassche@acm.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
Subject: Re: [PATCH 1/2] scsi: scsi_ioctl: Validate command size
Date: Wed, 3 Nov 2021 07:40:50 -0700 [thread overview]
Message-ID: <9e820a6e-a42e-1098-4044-5b6786ad7b2e@linaro.org> (raw)
In-Reply-To: <d1259a80-ac2f-a164-685a-4d1763653021@acm.org>
On 11/2/21 20:32, Bart Van Assche wrote:
>> + if (hdr->cmd_len < 6 || hdr->cmd_len > sizeof(req->__cmd))
>> + return -EMSGSIZE;
>
> That doesn't look right to me since sg_io() allocates req->cmd if necessary:
>
> if (hdr->cmd_len > BLK_MAX_CDB) {
> req->cmd = kzalloc(hdr->cmd_len, GFP_KERNEL);
> if (!req->cmd)
> goto out_put_request;
> }
I missed that. I will send a v2 soon.
--
Thanks,
Tadeusz
prev parent reply other threads:[~2021-11-03 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 0:37 Tadeusz Struk
2021-11-03 0:37 ` [PATCH 2/2] scsi: core: remove command size deduction from scsi_setup_scsi_cmnd Tadeusz Struk
2021-11-03 3:34 ` Bart Van Assche
2021-11-03 3:32 ` [PATCH 1/2] scsi: scsi_ioctl: Validate command size Bart Van Assche
2021-11-03 14:40 ` Tadeusz Struk [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=9e820a6e-a42e-1098-4044-5b6786ad7b2e@linaro.org \
--to=tadeusz.struk@linaro.org \
--cc=bvanassche@acm.org \
--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 \
/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®