Re: [PATCH -next] [SCSI] Fix NULL pointer dereference in handling for passthrough commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux