arm64: fix CONFIG_DEBUG_WX address reporting
authorMark Rutland <mark.rutland@arm.com>
Fri, 20 Apr 2018 22:05:00 +0000 (00:05 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 7 May 2018 11:15:57 +0000 (13:15 +0200)
commitaa420ce74680a109e366f5a7d963b1f4be85ad66
tree40afe40945ee76e80c7a9f38dddb40306d275b02
parent49df9289ceeccb0c9405e0e529cd541d88ddc78a
arm64: fix CONFIG_DEBUG_WX address reporting

BugLink: https://bugs.launchpad.net/bugs/1765850
In ptdump_check_wx(), we pass walk_pgd() a start address of 0 (rather
than VA_START) for the init_mm. This means that any reported W&X
addresses are offset by VA_START, which is clearly wrong and can make
them appear like userspace addresses.

Fix this by telling the ptdump code that we're walking init_mm starting
at VA_START. We don't need to update the addr_markers, since these are
still valid bounds regardless.

Cc: <stable@vger.kernel.org>
Fixes: 1404d6f13e47 ("arm64: dump: Add checking for writable and exectuable pages")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Laura Abbott <labbott@redhat.com>
Reported-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 1d08a044cf12aee37dfd54837558e3295287b343)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/arm64/mm/dump.c