[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200521114906.2f38fc04d3600d41f3409bd9@linux-foundation.org>
Date: Thu, 21 May 2020 11:49:06 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Prakash Gupta <guptap@...eaurora.org>
Cc: mhocko@...e.com, joro@...tes.org, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] iommu/dma: limit iova free size to unmmaped iova
On Thu, 21 May 2020 17:00:04 +0530 Prakash Gupta <guptap@...eaurora.org> wrote:
> Limit the iova size while freeing based on unmapped size. In absence of
> this even with unmap failure, invalid iova is pushed to iova rcache and
> subsequently can cause panic while rcache magazine is freed.
>
> Signed-off-by: Prakash Gupta <guptap@...eaurora.org>
>
I think we need a cc:stable here?
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -472,7 +472,8 @@ static void __iommu_dma_unmap(struct device *dev, dma_addr_t dma_addr,
>
> if (!cookie->fq_domain)
> iommu_tlb_sync(domain, &iotlb_gather);
> - iommu_dma_free_iova(cookie, dma_addr, size);
> + if (unmapped)
> + iommu_dma_free_iova(cookie, dma_addr, unmapped);
> }
>
> static dma_addr_t __iommu_dma_map(struct device *dev, phys_addr_t phys,
I'll assume that Joerg will handle this fix?
Powered by blists - more mailing lists