xen/arm: mm: Access a PT entry before the table is unmapped
authorJulien Grall <jgrall@amazon.com>
Sun, 7 Jun 2020 15:51:54 +0000 (16:51 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 8 Jun 2020 17:33:28 +0000 (10:33 -0700)
commit63b4c9bfb788ebfd35d0172f7e8e2e41ef948f70
tree81de30bc08c61480d3aa0639c1fda1e500e38625
parent16c36d27f2644737c34d4a0fc1de525d0ee185ad
xen/arm: mm: Access a PT entry before the table is unmapped

xen_pt_next_level() will retrieve the MFN from the entry right after the
page-table has been unmapped.

After calling xen_unmap_table(), there is no guarantee the mapping will
still be valid. Depending on the implementation, this may result to a
data abort in Xen.

Re-order the code to retrieve the MFN before the table is unmapped.

Fixes: 53abb9a1dcd9 ("xen/arm: mm: Rework Xen page-tables walk during update")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Paul Durrant <paul@xen.org>
xen/arch/arm/mm.c