Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643378

Re: [PATCH] iommu/iova: Sort out rbtree limit_pfn handling

From Joerg Roedel <joro@8bytes.org>
Newsgroups linux.kernel
Subject Re: [PATCH] iommu/iova: Sort out rbtree limit_pfn handling
Date 2017-05-17 16:10 +0200
Message-ID <tI7Oi-43z-13@gated-at.bofh.it> (permalink)
References <tHIPT-4Yo-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 16, 2017 at 12:26:48PM +0100, Robin Murphy wrote:
> When walking the rbtree, the fact that iovad->start_pfn and limit_pfn
> are both inclusive limits creates an ambiguity once limit_pfn reaches
> the bottom of the address space and they overlap. Commit 5016bdb796b3
> ("iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range") fixed
> the worst side-effect of this, that of underflow wraparound leading to
> bogus allocations, but the remaining fallout is that any attempt to
> allocate start_pfn itself erroneously fails.
> 
> The cleanest way to resolve the ambiguity is to simply make limit_pfn an
> exclusive limit when inside the guts of the rbtree. Since we're working
> with PFNs, representing one past the top of the address space is always
> possible without fear of overflow, and elsewhere it just makes life a
> little more straightforward.
> 
> Reported-by: Aaron Sierra <asierra@xes-inc.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Applied, thanks.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] iommu/iova: Sort out rbtree limit_pfn handling Robin Murphy <robin.murphy@arm.com> - 2017-05-16 13:30 +0200
  Re: [PATCH] iommu/iova: Sort out rbtree limit_pfn handling Aaron Sierra <asierra@xes-inc.com> - 2017-05-16 15:50 +0200
  Re: [PATCH] iommu/iova: Sort out rbtree limit_pfn handling Joerg Roedel <joro@8bytes.org> - 2017-05-17 16:10 +0200

csiph-web