Files
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 <[email protected]>
Closes: https://lore.kernel.org/linux-iommu/[email protected]/
Fixes: 79636caad3 ("swiotlb: if swiotlb is full, fall back to a transient memory pool")
Cc: [email protected]
Signed-off-by: Petr Tesarik <[email protected]>
Reviewed-by: Halil Pasic <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
2023-11-08 16:27:05 +01:00
..
2022-03-03 14:00:57 +03:00