path: root/arch/x86/include/asm/uprobes.h
diff options
authorOleg Nesterov <>2012-09-03 16:05:10 +0200
committerAnton Arapov <>2012-10-29 11:23:46 +0100
commit65f4fb9715827630e63934868e53781ea82ea0e1 (patch)
tree162c51a0a2316fea3cf1a6e33516f427b88e3fa7 /arch/x86/include/asm/uprobes.h
parent8b5e7bd2a7d4aff576d50051d9da139a6cf67de3 (diff)
uprobes/x86: Xol should send SIGTRAP if X86_EFLAGS_TF was set
arch_uprobe_disable_step() correctly preserves X86_EFLAGS_TF and returns to user-mode. But this means the application gets SIGTRAP only after the next insn. This means that UPROBE_CLEAR_TF logic is not really right. _enable should only record the state of X86_EFLAGS_TF, and _disable should check it separately from UPROBE_FIX_SETF. Remove arch_uprobe_task->restore_flags, add ->saved_tf instead, and change enable/disable accordingly. This assumes that the probed insn was not trapped, see the next patch. arch_uprobe_skip_sstep() logic has the same problem, change it to check X86_EFLAGS_TF and send SIGTRAP as well. We will cleanup this all after we fold enable/disable_step into pre/post_hol hooks. Note: send_sig(SIGTRAP) is not actually right, we need send_sigtrap(). But this needs more changes, handle_swbp() does the same and this is equally wrong. Signed-off-by: Oleg Nesterov <> Acked-by: Srikar Dronamraju <>
Diffstat (limited to 'arch/x86/include/asm/uprobes.h')
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h
index cee58624cb3..d561ff5a3d4 100644
--- a/arch/x86/include/asm/uprobes.h
+++ b/arch/x86/include/asm/uprobes.h
@@ -46,8 +46,7 @@ struct arch_uprobe_task {
#ifdef CONFIG_X86_64
unsigned long saved_scratch_register;
-#define UPROBE_CLEAR_TF (1 << 0)
- unsigned int restore_flags;
+ unsigned int saved_tf;
extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr);