linux/drivers/nvme/host
Keith Busch 071be3b0b6 nvme-pci: handle changing device dma map requirements
The initial state of dma_needs_unmap may be false, but change to true
while mapping the data iterator. Enabling swiotlb is one such case that
can change the result. The nvme driver needs to save the mapped dma
vectors to be unmapped later, so allocate as needed during iteration
rather than assume it was always allocated at the beginning. This fixes
a NULL dereference from accessing an uninitialized dma_vecs when the
device dma unmapping requirements change mid-iteration.

Fixes: b8b7570a7e ("nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping")
Link: https://lore.kernel.org/linux-nvme/20260202125738.1194899-1-pradeep.pragallapati@oss.qualcomm.com/
Reported-by: Pradeep P V K <pradeep.pragallapati@oss.qualcomm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
History 2026-02-05 07:29:10 -08:00
..
apple.c nvme-apple: add "apple,t8103-nvme-ans2" as compatible 2026-01-09 06:55:09 -08:00
auth.c nvme-auth: use kvfree() for memory allocated with kvcalloc() 2025-12-04 14:46:17 -08:00
constants.c nvme: fix typo in status code constant for self-test in progress 2025-07-17 13:38:07 +02:00
core.c for-6.19/block-20251201 2025-12-03 19:26:18 -08:00
fabrics.c nvme-fabrics: add ENOKEY to no retry criteria for authentication failures 2025-12-04 14:46:17 -08:00
fabrics.h nvme: remove virtual boundary for sgl capable devices 2025-11-06 18:11:58 -07:00
fault_inject.c fault-inject: improve build for CONFIG_FAULT_INJECTION=n 2024-09-01 20:43:33 -07:00
fc.c nvme-fc: release admin tagset if init fails 2026-01-09 06:55:12 -08:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ioctl.c block: use bio_alloc_bioset for passthru IO by default 2025-12-04 07:18:54 -07:00
Kconfig block-6.16-20250606 2025-06-06 13:12:50 -07:00
Makefile nvme: rework NVME_AUTH Kconfig selection 2023-10-12 08:04:49 -07:00
multipath.c for-6.19/block-20251201 2025-12-03 19:26:18 -08:00
nvme.h nvme: remove virtual boundary for sgl capable devices 2025-11-06 18:11:58 -07:00
pci.c nvme-pci: handle changing device dma map requirements 2026-02-05 07:29:10 -08:00
pr.c nvme: reject invalid pr_read_keys() num_keys values 2025-12-04 07:19:26 -07:00
rdma.c nvme: remove virtual boundary for sgl capable devices 2025-11-06 18:11:58 -07:00
sysfs.c for-6.16/block-20250523 2025-05-26 11:39:36 -07:00
tcp.c for-6.19/block-20251201 2025-12-03 19:26:18 -08:00
trace.c nvme: parse reservation commands's action and rtype to string 2024-11-13 08:51:24 -08:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c block: introduce disk_report_zone() 2025-11-05 08:07:21 -07:00