aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ptrace.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-09 05:39:29 -0400
committerRoland McGrath <roland@redhat.com>2008-07-16 15:15:17 -0400
commit380fdd7585a4c2f41b48925eba85c0654b7b858b (patch)
tree3e405cd6cb0be449671ef28c6275fd7ad6b99295 /arch/x86/kernel/ptrace.c
parentd4d67150165df8bf1cc05e532f6efca96f907cab (diff)
x86 ptrace: user-sets-TF nits
This closes some arcane holes in single-step handling that can arise only when user programs set TF directly (via popf or sigreturn) and then use vDSO (syscall/sysenter) system call entry. In those entry paths, the clear_TF_reenable case hits and we must check TIF_SINGLESTEP to be sure our bookkeeping stays correct wrt the user's view of TF. Signed-off-by: Roland McGrath <roland@redhat.com>
Diffstat (limited to 'arch/x86/kernel/ptrace.c')
-rw-r--r--arch/x86/kernel/ptrace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 34e77b16a42a..e37dccce85db 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -1416,6 +1416,16 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs)
1416{ 1416{
1417 long ret = 0; 1417 long ret = 0;
1418 1418
1419 /*
1420 * If we stepped into a sysenter/syscall insn, it trapped in
1421 * kernel mode; do_debug() cleared TF and set TIF_SINGLESTEP.
1422 * If user-mode had set TF itself, then it's still clear from
1423 * do_debug() and we need to set it again to restore the user
1424 * state. If we entered on the slow path, TF was already set.
1425 */
1426 if (test_thread_flag(TIF_SINGLESTEP))
1427 regs->flags |= X86_EFLAGS_TF;
1428
1419 /* do the secure computing check first */ 1429 /* do the secure computing check first */
1420 secure_computing(regs->orig_ax); 1430 secure_computing(regs->orig_ax);
1421 1431