Skip to content

Commit a54afbc

Browse files
roygerkeithbusch
authored andcommitted
nvme-pci: DMA unmap the correct regions in nvme_free_sgls
The call to nvme_free_sgls() in nvme_unmap_data() has the sg_list and sge parameters swapped. This wasn't noticed by the compiler because both share the same type. On a Xen PV hardware domain, and possibly any other architectures that takes that path, this leads to corruption of the NVMe contents. Fixes: f0887e2 ("nvme-pci: create common sgl unmapping helper") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 0fcee2c commit a54afbc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/nvme/host/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ static void nvme_unmap_data(struct request *req)
806806
if (!blk_rq_dma_unmap(req, dma_dev, &iod->dma_state, iod->total_len,
807807
map)) {
808808
if (nvme_pci_cmd_use_sgl(&iod->cmd))
809-
nvme_free_sgls(req, iod->descriptors[0],
810-
&iod->cmd.common.dptr.sgl, attrs);
809+
nvme_free_sgls(req, &iod->cmd.common.dptr.sgl,
810+
iod->descriptors[0], attrs);
811811
else
812812
nvme_free_prps(req, attrs);
813813
}

0 commit comments

Comments
 (0)