arm64: fix CONFIG_DEBUG_WX address reporting
authorMark Rutland <mark.rutland@arm.com>
Wed, 13 Dec 2017 11:45:42 +0000 (11:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:10:20 +0000 (10:10 +0100)
commit9854611cf5e604773fecfa75bfafc03621df508c
treefc109b6f0b45a48f73a58c1cd8107ff407a3a3d1
parentcdcfd13a66eb53fd96dc480de79c423aa0de9d39
arm64: fix CONFIG_DEBUG_WX address reporting

commit 1d08a044cf12aee37dfd54837558e3295287b343 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/mm/dump.c