]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: 8720/1: ensure dump_instr() checks addr_limit
authorMark Rutland <mark.rutland@arm.com>
Thu, 2 Nov 2017 17:44:28 +0000 (18:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 09:09:16 +0000 (10:09 +0100)
commit8a10426d660062e1d1753cd48667a7508a931d3f
treec6b1dda32edd3e5f6845fca306a6d3c5fd7ef497
parentdcd2b010f17d64f19ac6a1f7cc77d85faf29196a
ARM: 8720/1: ensure dump_instr() checks addr_limit

commit b9dd05c7002ee0ca8b676428b2268c26399b5e31 upstream.

When CONFIG_DEBUG_USER is enabled, it's possible for a user to
deliberately trigger dump_instr() with a chosen kernel address.

Let's avoid problems resulting from this by using get_user() rather than
__get_user(), ensuring that we don't erroneously access kernel memory.

So that we can use the same code to dump user instructions and kernel
instructions, the common dumping code is factored out to __dump_instr(),
with the fs manipulated appropriately in dump_instr() around calls to
this.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/traps.c