linux/drivers/nvme/host
Keith Busch f3ed399e9a nvme-pci: handle changing device dma map requirements
[ Upstream commit 071be3b0b6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-02-11 13:41:59 +01:00
..
apple.c nvme-apple: add "apple,t8103-nvme-ans2" as compatible 2026-01-23 11:21:12 +01:00
auth.c nvme-auth: use kvfree() for memory allocated with kvcalloc() 2025-12-18 14:03:36 +01: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 nvme: fix admin request_queue lifetime 2025-11-05 12:50:46 -08:00
fabrics.c nvme-fabrics: add ENOKEY to no retry criteria for authentication failures 2026-01-02 12:57:03 +01:00
fabrics.h nvme: spelling fixes 2025-06-04 10:23:28 +02: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-02-11 13:41:51 +01: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 for-6.18/block-20250929 2025-10-02 10:16:56 -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 nvme-multipath: fix lockdep WARN due to partition scan work 2025-11-17 08:08:00 -08:00
nvme.h block: switch ->getgeo() to struct gendisk 2025-08-13 02:59:29 -04:00
pci.c nvme-pci: handle changing device dma map requirements 2026-02-11 13:41:59 +01:00
pr.c nvme: fix command limits status code 2025-06-04 09:51:10 +02:00
rdma.c nvme: fix multiple spelling and grammar issues in host drivers 2025-07-17 13:38:06 +02:00
sysfs.c for-6.16/block-20250523 2025-05-26 11:39:36 -07:00
tcp.c nvme/tcp: handle tls partially sent records in write_space() 2025-10-16 11:32:04 -07: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 nvme: zns: Simplify nvme_zone_parse_entry() 2025-03-20 16:53:55 -07:00