]> git.baikalelectronics.ru Git - kernel.git/commit
x86/debug: Fix DR_STEP vs ptrace_get_debugreg(6)
authorPeter Zijlstra <peterz@infradead.org>
Tue, 27 Oct 2020 18:33:30 +0000 (19:33 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 27 Oct 2020 22:15:24 +0000 (23:15 +0100)
commit3db334fb71fb2f7391562e6952e70463913d1749
tree6ef08abfc2e82060af40c487089dc549597949dc
parent6dd26dae92000bdddf95892a91f34550463d555c
x86/debug: Fix DR_STEP vs ptrace_get_debugreg(6)

Commit 86522ad63e8e ("x86/debug: Change thread.debugreg6 to
thread.virtual_dr6") changed the semantics of the variable from random
collection of bits, to exactly only those bits that ptrace() needs.

Unfortunately this lost DR_STEP for PTRACE_{BLOCK,SINGLE}STEP.

Furthermore, it turns out that userspace expects DR_STEP to be
unconditionally available, even for manual TF usage outside of
PTRACE_{BLOCK,SINGLE}_STEP.

Fixes: 86522ad63e8e ("x86/debug: Change thread.debugreg6 to thread.virtual_dr6")
Reported-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Kyle Huey <me@kylehuey.com>
Link: https://lore.kernel.org/r/20201027183330.GM2628@hirez.programming.kicks-ass.net
arch/x86/kernel/traps.c