diff options
author | Jean-Philippe Brucker <[email protected]> | 2018-06-19 13:52:24 +0100 |
---|---|---|
committer | Will Deacon <[email protected]> | 2018-07-26 11:34:58 +0100 |
commit | 29859aeb8a6ea17ba207933a81b6b77b4d4df81a (patch) | |
tree | a2a556c2138d72570abb71760f9385464943e201 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | fac83d29d95471ad6a104f8c0d21669a3d59097b (diff) |
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 <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions