]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit241e588ab9d421f993236a45c12c11b660d110df
tree6212242b7429459efba683b66dc8bde8f3f2aa0b
parent6cdb07bb0da1f1540003b43ec99ad92b80d3d5b8
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