xen/arm: Don't use _end in is_xen_fixed_mfn()
authorJulien Grall <julien.grall@arm.com>
Wed, 16 Oct 2019 10:53:03 +0000 (11:53 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 29 Oct 2019 18:39:20 +0000 (11:39 -0700)
commit621b2d015483275cd40e44d9d0f729bd3c9f9da0
tree5b33a319c2535d726910b48b71096e695f5deedc
parent8502a2cdcc61542930b25ea3e4261cf4bf3b1a41
xen/arm: Don't use _end in is_xen_fixed_mfn()

virt_to_maddr() is using the hardware page-table walk instructions to
translate a virtual address to physical address. The function should
only be called on virtual address mapped.

_end points past the end of Xen binary and may not be mapped when the
binary size is page-aligned. This means virt_to_maddr() will not be able
to do the translation and therefore crash Xen.

Note there is also an off-by-one issue in this code, but the panic will
trump that.

Both issues can be fixed by using _end - 1 in the check.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 8dba9a81e7c62b8a7dbe023fffecd2e16cc20486)
xen/include/asm-arm/mm.h