]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
iommu/iova: Make rcache limit_pfn handling more robust
authorRobin Murphy <robin.murphy@arm.com>
Tue, 19 Sep 2017 13:48:40 +0000 (14:48 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 28 Sep 2017 12:57:15 +0000 (14:57 +0200)
commitb826ee9a4f1cbf83cadc5a307de8eea27637699a
tree6d847b28d7d22ec08e56d2e14b9bbda1e9fead1f
parent7595dc588a39c37091ddf65f6c0a3cd40f128e7a
iommu/iova: Make rcache limit_pfn handling more robust

When popping a pfn from an rcache, we are currently checking it directly
against limit_pfn for viability. Since this represents iova->pfn_lo, it
is technically possible for the corresponding iova->pfn_hi to be greater
than limit_pfn. Although we generally get away with it in practice since
limit_pfn is typically a power-of-two boundary and the IOVAs are
size-aligned, it's pretty trivial to make the iova_rcache_get() path
take the allocation size into account for complete safety.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iova.c