mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
nvme-pci: DMA unmap the correct regions in nvme_free_sgls
commita54afbc8a2upstream. 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:f0887e2a52("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> [nb: drop the attrs parameter added in 6.19 by commit61d43b1731("nvme-pci: migrate to dma_map_phys instead of map_page"), which is not in 6.18.y] Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
40e44eff51
commit
bbf04810b2
@@ -761,8 +761,8 @@ static void nvme_unmap_data(struct request *req)
|
||||
|
||||
if (!blk_rq_dma_unmap(req, dma_dev, &iod->dma_state, iod->total_len)) {
|
||||
if (nvme_pci_cmd_use_sgl(&iod->cmd))
|
||||
nvme_free_sgls(req, iod->descriptors[0],
|
||||
&iod->cmd.common.dptr.sgl);
|
||||
nvme_free_sgls(req, &iod->cmd.common.dptr.sgl,
|
||||
iod->descriptors[0]);
|
||||
else
|
||||
nvme_free_prps(req);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user