OSDN Git Service

arm64: debug: Ensure debug handlers check triggering exception level
authorWill Deacon <will.deacon@arm.com>
Fri, 1 Mar 2019 13:28:01 +0000 (13:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:33:47 +0000 (09:33 +0200)
commit20df60004a3a9ce2dbfad4793b4092398afa073e
treefac1f8b74ee9af815001489df8230128b67b78e4
parenta930f8ce20034ca7373eb2a3e91c2b9f6d5bb64c
arm64: debug: Ensure debug handlers check triggering exception level

commit 6bd288569b50bc89fa5513031086746968f585cb upstream.

Debug exception handlers may be called for exceptions generated both by
user and kernel code. In many cases, this is checked explicitly, but
in other cases things either happen to work by happy accident or they
go slightly wrong. For example, executing 'brk #4' from userspace will
enter the kprobes code and be ignored, but the instruction will be
retried forever in userspace instead of delivering a SIGTRAP.

Fix this issue in the most stable-friendly fashion by simply adding
explicit checks of the triggering exception level to all of our debug
exception handlers.

Cc: <stable@vger.kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/kgdb.c