The NVMe/TCP transport can return data to the controller in two ways.
The slower, more general way that handles arbitrary data buffers is to
send one or more R2T PDUs to the remote host to request H2C DATA PDUs
containing the data. However, for requests that send a "small" amount
of data, the remote host can append the data directly to the command
capsule PDU (referred to as "in-capsule data").
NVMe/TCP PDUs can optionally include a CRC32 digest protecting the
data portion of each PDU (negotiated during connection setup on each
queue). In the R2T case, the function which processes received H2C
DATA PDUs checks for data digest mismatches and reports those back to
nvmft(4) as an EINTEGRITY I/O error. The in-capsule data case however
was failing to check for a mismatched digest and was always returning
the available in-capsule data.
Fix the in-capsule data check to check for a mismatched data digest
and fail the request with an EINTEGRITY I/O error.
Sponsored by: Chelsio Communications