[PATCH] nvme: validate maxcmd before use it

Sagi Grimberg sagi at grimberg.me
Mon Dec 18 00:04:55 PST 2023


>> According to the NVMe specification, if the 'maximum outstanding
>> commands' (maxcmd) field is not utilized, it must be set to 0h.
>> When a host connects to a target that does not employ the maxcmd
>> field, the queue size (sqsize) gets set to an excessively large
>> value due to the calculation (u16)(0 - 1) = 65535.
>> As a result, such a misconfiguration leads to the failure of the
>> connection establishment.
> 
> MAXCMD is mandatory for Fabrics.
> 

Indeed.



More information about the Linux-nvme mailing list