[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231108160419.00702fd0.pasic@linux.ibm.com>
Date: Wed, 8 Nov 2023 16:04:19 +0100
From: Halil Pasic <pasic@...ux.ibm.com>
To: Petr Tesarik <petrtesarik@...weicloud.com>
Cc: Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Petr Tesarik <petr.tesarik.ext@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
iommu@...ts.linux.dev (open list:DMA MAPPING HELPERS),
linux-kernel@...r.kernel.org (open list),
Wangkefeng <wangkefeng.wang@...wei.com>,
Roberto Sassu <roberto.sassu@...weicloud.com>,
petr@...arici.cz, Petr Tesarik <petr.tesarik1@...wei-partners.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
stable@...r.kernel.org, Halil Pasic <pasic@...ux.ibm.com>
Subject: Re: [PATCH 1/1] swiotlb: fix out-of-bounds TLB allocations with
CONFIG_SWIOTLB_DYNAMIC
On Wed, 8 Nov 2023 12:12:49 +0100
Petr Tesarik <petrtesarik@...weicloud.com> wrote:
> From: Petr Tesarik <petr.tesarik1@...wei-partners.com>
>
> 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@...ux.ibm.com>
> Closes: https://lore.kernel.org/linux-iommu/104a8c8fedffd1ff8a2890983e2ec1c26bff6810.camel@linux.ibm.com/
> Fixes: 79636caad361 ("swiotlb: if swiotlb is full, fall back to a transient memory pool")
> Cc: Halil Pasic <pasic@...ux.ibm.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Petr Tesarik <petr.tesarik1@...wei-partners.com>
Reviewed-by: Halil Pasic <pasic@...ux.ibm.com>
I believe there is at least one stale comment in the code that says
"The number of slot in an area should be a multiple of IO_TLB_SEGSIZE"
but that is probably not stable material, so I do agree with keeping this
patch minimal.
Regards,
Halil
Powered by blists - more mailing lists