[PATCH 6.18.y] nvme-pci: DMA unmap the correct regions in nvme_free_sgls

Keith Busch kbusch at kernel.org
Tue Jul 14 14:16:28 PDT 2026


On Tue, Jul 14, 2026 at 10:13:42PM +0200, Nicolai Buchwitz wrote:
> From: Roger Pau Monne <roger.pau at citrix.com>
> 
> commit a54afbc8a2138f8c2490510cf26cde188d480c43 upstream.
> 
> 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: f0887e2a52d4 ("nvme-pci: create common sgl unmapping helper")
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Signed-off-by: Roger Pau Monné <roger.pau at citrix.com>
> Signed-off-by: Keith Busch <kbusch at kernel.org>
> [nb: drop the attrs parameter added in 6.19 by commit 61d43b1731e0
>  ("nvme-pci: migrate to dma_map_phys instead of map_page"), which is
>  not in 6.18.y]
> Signed-off-by: Nicolai Buchwitz <nb at tipi-net.de>

Yes, definitely want this for LTS.

Acked-by: Keith Busch <kbusch at kernel.org>



More information about the Linux-nvme mailing list