linux/kernel/dma
Petr Tesarik 53c87e846e swiotlb: fix out-of-bounds TLB allocations with CONFIG_SWIOTLB_DYNAMIC
Limit the free list length to the size of the IO TLB. Transient pool can be
smaller than IO_TLB_SEGSIZE, but the free list is initialized with the
assumption that the total number of slots is a multiple of IO_TLB_SEGSIZE.
As a result, swiotlb_area_find_slots() may allocate slots past the end of
a transient IO TLB buffer.

Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Closes: https://lore.kernel.org/linux-iommu/104a8c8fedffd1ff8a2890983e2ec1c26bff6810.camel@linux.ibm.com/
Fixes: 79636caad3 ("swiotlb: if swiotlb is full, fall back to a transient memory pool")
Cc: stable@vger.kernel.org
Signed-off-by: Petr Tesarik <petr.tesarik1@huawei-partners.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2023-11-08 16:27:05 +01:00
..
coherent.c
contiguous.c Revert "dma-contiguous: check for memory region overlap" 2023-09-08 05:58:32 -03:00
debug.c dma-debug: Fix a typo in a debugging eye-catcher 2023-10-23 07:52:54 +02:00
debug.h
direct.c dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM 2023-11-06 08:38:16 +01:00
direct.h dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM 2023-11-06 08:38:16 +01:00
dummy.c
Kconfig dma-direct: add a CONFIG_ARCH_HAS_DMA_ALLOC symbol 2023-10-22 16:38:54 +02:00
Makefile
map_benchmark.c
mapping.c dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM 2023-11-06 08:38:16 +01:00
ops_helpers.c
pool.c dma-pool: remove a __maybe_unused label in atomic_pool_expand 2023-08-31 14:12:37 +02:00
remap.c
swiotlb.c swiotlb: fix out-of-bounds TLB allocations with CONFIG_SWIOTLB_DYNAMIC 2023-11-08 16:27:05 +01:00