Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs
When the host sends multiple h2cdata PDUs, we keep track on the receive progress and calculate the scatterlist index and offsets. The issue is that sg_offset should only be kept for the first iov entry we map in the iovec as this is the difference between our cursor and the sg entry offset itself. In addition, the sg index was calculated wrong because we should not round up when dividing the command byte offset with PAG_SIZE. Fixes: 872d26a ("nvmet-tcp: add NVMe over TCP target driver") Reported-by: Narayan Ayalasomayajula <[email protected]> Tested-by: Narayan Ayalasomayajula <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
- Loading branch information