arm64: ensure __dump_instr() checks addr_limit
authorMark Rutland <mark.rutland@arm.com>
Thu, 2 Nov 2017 16:12:03 +0000 (16:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:06:27 +0000 (10:06 +0100)
commit581ac5f431c9b01a820ee10581b042328d870230
tree05a231b7d648f916d5adaaf7f3c5b648e59b84a9
parent97d64b7f2fdf945c40c5dc2004defec5f260cb6d
arm64: ensure __dump_instr() checks addr_limit

commit 7a7003b1da010d2b0d1dc8bf21c10f5c73b389f1 upstream.

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.

Where we use __dump_instr() on kernel text, we already switch to
KERNEL_DS, so this shouldn't adversely affect those cases.

Fixes: 60ffc30d5652810d ("arm64: Exception handling")
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/traps.c