]> git.baikalelectronics.ru Git - kernel.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)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 6 Nov 2017 12:00:38 +0000 (12:00 +0000)
commit07d2f990e69db030164b8199ec00f643c8973109
tree726645a75aa6e091da0ea05daa1c64f5d619bdf5
parent465dd3ea007b897e19c2204d7d6e240e4f4d33c6
ARM: 8720/1: ensure dump_instr() checks addr_limit

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>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/traps.c