lkml.org 
[lkml]   [2021]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] scsi: scsi_ioctl: Validate command size
From
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

\
 
 \ /
  Last update: 2021-11-03 15:41    [W:0.042 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site