Skip to content

nvme-pci: DMA unmap the correct regions in nvme_free_sgls#7500

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
pelwell:is7496
Jul 14, 2026
Merged

nvme-pci: DMA unmap the correct regions in nvme_free_sgls#7500
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
pelwell:is7496

Conversation

@pelwell

@pelwell pelwell commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

N.B. I had to drop the attrs parameter that nvme_free_sgls has gained in the newer kernels. This presumably explains why it wasn't backported despite the Fixes: tag (it's still disappointing, though).

[ commit a54afbc 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: f0887e2 ("nvme-pci: create common sgl unmapping helper")
Reviewed-by: Christoph Hellwig hch@lst.de

[ commit a54afbc 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: 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>
@pelwell pelwell merged commit d485ddf into raspberrypi:rpi-6.18.y Jul 14, 2026
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 15, 2026
See: raspberrypi/linux#7500

kernel: staging: vchiq_arm: use one DMA device to map and unmap bulk pagelists
See: raspberrypi/linux#7494

kernel: drm/vc4: hdmi: Remove duplicate hotplug helper call
See: raspberrypi/linux#7489

kernel: ASoC: hifiberry_studio: change driver name and add support for new soundcards
See: raspberrypi/linux#7487

kernel: mmc: Fix MMC request issuing race condition to prevent stall
See: raspberrypi/linux#7486

kernel: dmaengine: dw-axi-dmac: Wait for runtime resume before using a channel
See: raspberrypi/linux#7484

kernel: overlays: i2c-fan: add compatible for upstream compatibility
See: raspberrypi/linux#7483
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jul 15, 2026
See: raspberrypi/linux#7500

kernel: staging: vchiq_arm: use one DMA device to map and unmap bulk pagelists
See: raspberrypi/linux#7494

kernel: drm/vc4: hdmi: Remove duplicate hotplug helper call
See: raspberrypi/linux#7489

kernel: ASoC: hifiberry_studio: change driver name and add support for new soundcards
See: raspberrypi/linux#7487

kernel: mmc: Fix MMC request issuing race condition to prevent stall
See: raspberrypi/linux#7486

kernel: dmaengine: dw-axi-dmac: Wait for runtime resume before using a channel
See: raspberrypi/linux#7484

kernel: overlays: i2c-fan: add compatible for upstream compatibility
See: raspberrypi/linux#7483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants