iommu/io-pgtable: Sanitise map/unmap addresses
authorRobin Murphy <robin.murphy@arm.com>
Mon, 3 Jul 2017 13:52:24 +0000 (14:52 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 20 Jul 2017 09:30:28 +0000 (10:30 +0100)
commit76557391433c77d330cede1a531b358d2f90df66
tree6212242b7429459efba683b66dc8bde8f3f2aa0b
parentc54451a5e2415948274bc71f469e5349469addcc
iommu/io-pgtable: Sanitise map/unmap addresses

It may be an egregious error to attempt to use addresses outside the
range of the pagetable format, but that still doesn't mean we should
merrily wreak havoc by silently mapping/unmapping whatever truncated
portions of them might happen to correspond to real addresses.

Add some up-front checks to sanitise our inputs so that buggy callers
don't invite potential memory corruption.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/io-pgtable-arm-v7s.c
drivers/iommu/io-pgtable-arm.c