aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/arm-smmu.c
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>2018-06-19 13:52:24 +0100
committerWill Deacon <will.deacon@arm.com>2018-07-26 11:34:58 +0100
commit29859aeb8a6ea17ba207933a81b6b77b4d4df81a (patch)
treea2a556c2138d72570abb71760f9385464943e201 /drivers/iommu/arm-smmu.c
parentiommu/io-pgtable-arm: Fix pgtable allocation in selftest (diff)
downloadlinux-dev-29859aeb8a6ea17ba207933a81b6b77b4d4df81a.tar.xz
linux-dev-29859aeb8a6ea17ba207933a81b6b77b4d4df81a.zip
iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE
When run on a 64-bit system in selftest, the v7s driver may obtain page table with physical addresses larger than 32-bit. Level-2 tables are 1KB and are are allocated with slab, which doesn't accept the GFP_DMA32 flag. Currently map() truncates the address written in the PTE, causing iova_to_phys() or unmap() to access invalid memory. Kasan reports it as a use-after-free. To avoid any nasty surprise, test if the physical address fits in a PTE before returning a new table. 32-bit systems, which are the main users of this page table format, shouldn't see any difference. Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/arm-smmu.c')
0 files changed, 0 insertions, 0 deletions