[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d1259a80-ac2f-a164-685a-4d1763653021@acm.org>
Date: Tue, 2 Nov 2021 20:32:33 -0700
From: Bart Van Assche <bvanassche@....org>
To: Tadeusz Struk <tadeusz.struk@...aro.org>,
linux-scsi@...r.kernel.org
Cc: Christoph Hellwig <hch@....de>,
"James E . J . Bottomley" <jejb@...ux.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 1/2] scsi: scsi_ioctl: Validate command size
On 11/2/21 17:37, Tadeusz Struk 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;
}
Bart.
Powered by blists - more mailing lists