OSDN Git Service

x86/debug: Allow a single level of #DB recursion
authorAndy Lutomirski <luto@kernel.org>
Wed, 2 Sep 2020 13:25:51 +0000 (15:25 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 4 Sep 2020 13:09:29 +0000 (15:09 +0200)
commitd5c678aed5eddb944b8e7ce451b107b39245962d
tree1e470f1ce30ebd18f5175b586722e4cb18ca4ee0
parent662a0221893a3d58aa72719671844264306f6e4b
x86/debug: Allow a single level of #DB recursion

Trying to clear DR7 around a #DB from usermode malfunctions if the tasks
schedules when delivering SIGTRAP.

Rather than trying to define a special no-recursion region, just allow a
single level of recursion.  The same mechanism is used for NMI, and it
hasn't caused any problems yet.

Fixes: 9f58fdde95c9 ("x86/db: Split out dr6/7 handling")
Reported-by: Kyle Huey <me@kylehuey.com>
Debugged-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/8b9bd05f187231df008d48cf818a6a311cbd5c98.1597882384.git.luto@kernel.org
Link: https://lore.kernel.org/r/20200902133200.726584153@infradead.org
arch/x86/kernel/traps.c