aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-05-01 11:25:42 -0400
committerIngo Molnar <mingo@kernel.org>2013-05-28 02:46:52 -0400
commit24cda10996f5420ab962f91cd03c15869a3a94b1 (patch)
tree2edb4c4d20f3e373abfb07488d60bd54a5f71555 /arch/x86/kernel/signal.c
parent5e219b3c671b34b2d79468fe89c44c0460c0f02b (diff)
x86/signals: Clear RF EFLAGS bit for signal handler
Clearing RF EFLAGS bit for signal handler. The reason is that this flag is set by debug exception code to prevent the recursive exception entry. Leaving it set for signal handler might prevent debug exception of the signal handler itself. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Tested-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com> Originally-Reported-by: Vince Weaver <vincent.weaver@maine.edu> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: Stephane Eranian <eranian@google.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1367421944-19082-3-git-send-email-jolsa@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 9df4c0b5ecac..cb12fc9c0642 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -665,6 +665,12 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
665 */ 665 */
666 regs->flags &= ~X86_EFLAGS_DF; 666 regs->flags &= ~X86_EFLAGS_DF;
667 /* 667 /*
668 * Clear RF when entering the signal handler, because
669 * it might disable possible debug exception from the
670 * signal handler.
671 */
672 regs->flags &= ~X86_EFLAGS_RF;
673 /*
668 * Clear TF when entering the signal handler, but 674 * Clear TF when entering the signal handler, but
669 * notify any tracer that was single-stepping it. 675 * notify any tracer that was single-stepping it.
670 * The tracer may want to single-step inside the 676 * The tracer may want to single-step inside the