diff options
author | Petr Tesarik <[email protected]> | 2023-11-08 12:12:49 +0100 |
---|---|---|
committer | Christoph Hellwig <[email protected]> | 2023-11-08 16:27:05 +0100 |
commit | 53c87e846e335e3c18044c397cc35178163d7827 (patch) | |
tree | 7b2f6c380c31187cc3067bc2607d0ef948d6c63e /net/unix/sysctl_net_unix.c | |
parent | a409d9600959f3c4b2a48946304c8e01b8d04072 (diff) |
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: 79636caad361 ("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]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions