rpms/kernel/F-8 kernel.spec, 1.370, 1.371 linux-2.6-utrace-tracehook.patch, 1.19, 1.20 linux-2.6-x86-clear-df-for-signals.patch, 1.1, 1.2

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Mon Mar 10 20:31:23 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29880

Modified Files:
	kernel.spec linux-2.6-utrace-tracehook.patch 
	linux-2.6-x86-clear-df-for-signals.patch 
Log Message:
* Mon Mar 10 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.24.3-25
- Use better fix for clearing the direction flag for x86 signal handlers.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.370
retrieving revision 1.371
diff -u -r1.370 -r1.371
--- kernel.spec	10 Mar 2008 18:49:01 -0000	1.370
+++ kernel.spec	10 Mar 2008 20:30:28 -0000	1.371
@@ -1004,10 +1004,6 @@
 # Revert -stable pieces we get from elsewhere here
 ApplyPatch linux-2.6-upstream-reverts.patch -R
 
-# clear DF before calling signal handlers
-# (must be applied before utrace)
-ApplyPatch linux-2.6-x86-clear-df-for-signals.patch
-
 # Roland's utrace ptrace replacement.
 # Main patch includes i386, x86_64, powerpc.
 ApplyPatch linux-2.6-utrace-tracehook.patch
@@ -1067,6 +1063,8 @@
 #ApplyPatch linux-2.6-x86-debug-boot.patch
 # allow i686 kernel to boot on non-mainstream processors
 ApplyPatch linux-2.6-x86-dont-use-p6-nops.patch
+# clear DF before calling signal handlers
+ApplyPatch linux-2.6-x86-clear-df-for-signals.patch
 
 #
 # PowerPC
@@ -1913,6 +1911,9 @@
 
 
 %changelog
+* Mon Mar 10 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.24.3-25
+- Use better fix for clearing the direction flag for x86 signal handlers.
+
 * Mon Mar 10 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.24.3-24
 - ACPI: really disable stray GPEs (#251744)
 - x86: clear direction flag before calling signal handlers

linux-2.6-utrace-tracehook.patch:

Index: linux-2.6-utrace-tracehook.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-utrace-tracehook.patch,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- linux-2.6-utrace-tracehook.patch	10 Mar 2008 18:49:01 -0000	1.19
+++ linux-2.6-utrace-tracehook.patch	10 Mar 2008 20:30:28 -0000	1.20
@@ -875,25 +875,23 @@
  
 --- linux-2.6/arch/x86/ia32/ia32_signal.c
 +++ linux-2.6/arch/x86/ia32/ia32_signal.c
-@@ -492,11 +492,8 @@ int ia32_setup_frame(int sig, struct k_s
+@@ -492,11 +492,7 @@ int ia32_setup_frame(int sig, struct k_s
  
  	regs->cs = __USER32_CS; 
  	regs->ss = __USER32_DS; 
 -
  	set_fs(USER_DS);
--	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
-+	regs->eflags &= ~X86_EFLAGS_DF;
+-	regs->eflags &= ~TF_MASK;
 -	if (test_thread_flag(TIF_SINGLESTEP))
 -		ptrace_notify(SIGTRAP);
  
  #if DEBUG_SIG
  	printk("SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n",
-@@ -600,9 +596,7 @@ int ia32_setup_rt_frame(int sig, struct 
+@@ -600,9 +596,6 @@ int ia32_setup_rt_frame(int sig, struct 
  	regs->ss = __USER32_DS; 
  
  	set_fs(USER_DS);
--	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
-+	regs->eflags &= ~X86_EFLAGS_DF;
+-	regs->eflags &= ~TF_MASK;
 -	if (test_thread_flag(TIF_SINGLESTEP))
 -		ptrace_notify(SIGTRAP);
  
@@ -1002,12 +1000,11 @@
  #include <linux/unistd.h>
  #include <linux/stddef.h>
  #include <linux/personality.h>
-@@ -295,9 +295,7 @@ static int setup_rt_frame(int sig, struc
+@@ -295,9 +295,6 @@ static int setup_rt_frame(int sig, struc
  	   see include/asm-x86_64/uaccess.h for details. */
  	set_fs(USER_DS);
  
--	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
-+	regs->eflags &= ~X86_EFLAGS_DF;
+-	regs->eflags &= ~TF_MASK;
 -	if (test_thread_flag(TIF_SINGLESTEP))
 -		ptrace_notify(SIGTRAP);
  #ifdef DEBUG_SIG
@@ -1433,7 +1430,7 @@
  #include <linux/elf.h>
  #include <linux/binfmts.h>
  #include <asm/processor.h>
-@@ -390,16 +390,7 @@ static int setup_frame(int sig, struct k
+@@ -390,16 +390,6 @@ static int setup_frame(int sig, struct k
  	regs->xss = __USER_DS;
  	regs->xcs = __USER_CS;
  
@@ -1443,15 +1440,14 @@
 -	 * The tracer may want to single-step inside the
 -	 * handler too.
 -	 */
--	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
-+	regs->eflags &= ~X86_EFLAGS_DF;
+-	regs->eflags &= ~TF_MASK;
 -	if (test_thread_flag(TIF_SINGLESTEP))
 -		ptrace_notify(SIGTRAP);
 -
  #if DEBUG_SIG
  	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
  		current->comm, current->pid, frame, regs->eip, frame->pretcode);
-@@ -483,16 +473,7 @@ static int setup_rt_frame(int sig, struc
+@@ -483,16 +473,6 @@ static int setup_rt_frame(int sig, struc
  	regs->xss = __USER_DS;
  	regs->xcs = __USER_CS;
  
@@ -1461,8 +1457,7 @@
 -	 * The tracer may want to single-step inside the
 -	 * handler too.
 -	 */
--	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
-+	regs->eflags &= ~X86_EFLAGS_DF;
+-	regs->eflags &= ~TF_MASK;
 -	if (test_thread_flag(TIF_SINGLESTEP))
 -		ptrace_notify(SIGTRAP);
 -

linux-2.6-x86-clear-df-for-signals.patch:

Index: linux-2.6-x86-clear-df-for-signals.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-x86-clear-df-for-signals.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-x86-clear-df-for-signals.patch	10 Mar 2008 18:49:01 -0000	1.1
+++ linux-2.6-x86-clear-df-for-signals.patch	10 Mar 2008 20:30:28 -0000	1.2
@@ -1,86 +1,29 @@
+Upstream:
+
 Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e40cd10ccff3d9fbffd57b93780bee4b7b9bff51
 Commit:     e40cd10ccff3d9fbffd57b93780bee4b7b9bff51
-Parent:     ce4796d1e16cf3761dc2a02b8d588667d05b3078
-Author:     Aurelien Jarno <aurelien at aurel32.net>
-AuthorDate: Wed Mar 5 19:14:24 2008 +0100
-Committer:  Ingo Molnar <mingo at elte.hu>
-CommitDate: Fri Mar 7 16:39:14 2008 +0100
 
-    x86: clear DF before calling signal handler
-    
-    The Linux kernel currently does not clear the direction flag before
-    calling a signal handler, whereas the x86/x86-64 ABI requires that.
-    
-    Linux had this behavior/bug forever, but this becomes a real problem
-    with gcc version 4.3, which assumes that the direction flag is
-    correctly cleared at the entry of a function.
-    
-    This patches changes the setup_frame() functions to clear the
-    direction before entering the signal handler.
-    
-    Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
-    Signed-off-by: Ingo Molnar <mingo at elte.hu>
-    Acked-by: H. Peter Anvin <hpa at zytor.com>
----
- arch/x86/ia32/ia32_signal.c |    4 ++--
- arch/x86/kernel/signal_32.c |    4 ++--
- arch/x86/kernel/signal_64.c |    2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
+Simplified fix for utrace kernel.
+
 
-diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
-index 1c0503b..5e7771a 100644
---- a/arch/x86/ia32/ia32_signal.c
-+++ b/arch/x86/ia32/ia32_signal.c
-@@ -500,7 +500,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
- 	regs->ss = __USER32_DS;
- 
- 	set_fs(USER_DS);
--	regs->eflags &= ~TF_MASK;
-+	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
- 	if (test_thread_flag(TIF_SINGLESTEP))
- 		ptrace_notify(SIGTRAP);
- 
-@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- 	regs->ss = __USER32_DS;
- 
- 	set_fs(USER_DS);
--	regs->eflags &= ~TF_MASK;
-+	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
- 	if (test_thread_flag(TIF_SINGLESTEP))
- 		ptrace_notify(SIGTRAP);
- 
-diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
-index caee1f0..0157a6f 100644
---- a/arch/x86/kernel/signal_32.c
-+++ b/arch/x86/kernel/signal_32.c
-@@ -407,7 +407,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
- 	 * The tracer may want to single-step inside the
- 	 * handler too.
- 	 */
--	regs->eflags &= ~TF_MASK;
-+	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
- 	if (test_thread_flag(TIF_SINGLESTEP))
- 		ptrace_notify(SIGTRAP);
- 
-@@ -500,7 +500,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- 	 * The tracer may want to single-step inside the
- 	 * handler too.
- 	 */
--	regs->eflags &= ~TF_MASK;
-+	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
- 	if (test_thread_flag(TIF_SINGLESTEP))
- 		ptrace_notify(SIGTRAP);
- 
-diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
-index 7347bb1..56b72fb 100644
 --- a/arch/x86/kernel/signal_64.c
 +++ b/arch/x86/kernel/signal_64.c
-@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- 	   see include/asm-x86_64/uaccess.h for details. */
- 	set_fs(USER_DS);
+@@ -384,7 +384,7 @@ handle_signal(unsigned long sig, siginfo
+ 		 * The tracer may want to single-step inside the
+ 		 * handler too.
+ 		 */
+-		regs->eflags &= ~TF_MASK;
++		regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ 		tracehook_report_handle_signal(sig, ka, oldset, regs);
+ 	}
  
--	regs->eflags &= ~TF_MASK;
-+	regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
- 	if (test_thread_flag(TIF_SINGLESTEP))
- 		ptrace_notify(SIGTRAP);
- #ifdef DEBUG_SIG
+--- a/arch/x86/kernel/signal_32.c
++++ b/arch/x86/kernel/signal_32.c
+@@ -540,7 +540,7 @@ handle_signal(unsigned long sig, siginfo
+ 		 * The tracer may want to single-step inside the
+ 		 * handler too.
+ 		 */
+-		regs->eflags &= ~TF_MASK;
++		regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
+ 		tracehook_report_handle_signal(sig, ka, oldset, regs);
+ 	}




More information about the fedora-extras-commits mailing list