]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: ensure __dump_instr() checks addr_limit
authorMark Rutland <mark.rutland@arm.com>
Thu, 2 Nov 2017 16:12:03 +0000 (16:12 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 2 Nov 2017 18:33:08 +0000 (18:33 +0000)
commit2c966e4b33b5a0230f3496224b064ba98eb2abfd
tree8a89f339577c823f3b0e37d0380cdbc792046150
parent22f59aa048992942f3ea633fd1c02b9731a4dcc1
arm64: ensure __dump_instr() checks addr_limit

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: dbd85415f408b4a5 ("arm64: Exception handling")
Cc: stable@vger.kernel.org
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>
arch/arm64/kernel/traps.c