[parisc-linux-cvs] linux-2.6 tausq

Randolph Chung randolph at tausq.org
Mon Apr 26 09:58:36 MDT 2004


> 2.6.6-rc1-pa3
> We were not checking the ptrace flags correctly in the syscall return paths, so some ptrace requests (e.g. PT_SINGLESTEP) were not returning via
> syscall_restore_rfi and the R/T bits are not being set.

Index: arch/parisc/kernel/entry.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/entry.S,v
retrieving revision 1.8
diff -u -p -r1.8 entry.S
--- a/arch/parisc/kernel/entry.S	25 Apr 2004 14:50:51 -0000	1.8
+++ b/arch/parisc/kernel/entry.S	26 Apr 2004 15:55:39 -0000
@@ -2288,9 +2288,13 @@ syscall_check_sig:
 	bb,<,n	%r19, 31-TIF_SIGPENDING, syscall_do_signal /* forward */
 
 syscall_restore:
-	LDREG	TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19    /* get ti flags */
-	bb,<	%r19, 31-TIF_SYSCALL_TRACE,syscall_restore_rfi
-	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1	/* delay slot! */
+	/* Are we being ptraced? */
+	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
+
+	LDREG	TASK_PTRACE(%r1), %r19
+	bb,<	%r19,31,syscall_restore_rfi
+	nop
+
 	ldo	TASK_PT_FR31(%r1),%r19		   /* reload fpregs */
 	rest_fp	%r19
 
@@ -2340,7 +2344,6 @@ syscall_restore:
 	 * the most efficient way of doing things, but it works.
 	 */
 syscall_restore_rfi:
-	LDREG	TASK_PTRACE(%r1), %r19
 	ldo	-1(%r0),%r2			   /* Set recovery cntr to -1 */
 	mtctl	%r2,%cr0			   /*   for immediate trap */
 	LDREG	TASK_PT_PSW(%r1),%r2		   /* Get old PSW */
Index: arch/parisc/kernel/syscall.S
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/syscall.S,v
retrieving revision 1.11
diff -u -p -r1.11 syscall.S
--- a/arch/parisc/kernel/syscall.S	21 Sep 2003 14:33:58 -0000	1.11
+++ b/arch/parisc/kernel/syscall.S	26 Apr 2004 15:55:39 -0000
@@ -155,9 +155,10 @@ linux_gateway_entry:
 	stw     %r21, -56(%r30)                 /* 6th argument */
 #endif
 
+	/* Are we being ptraced? */
 	mfctl	%cr30, %r1
-	LDREG	TI_FLAGS(%r1), %r19
-	bb,<,n	%r19,31-TIF_SYSCALL_TRACE,.Ltracesys
+	LDREG	TASK_PTRACE(%r1), %r1
+	bb,<,n	%r1,31,.Ltracesys
 	
 	/* Note!  We cannot use the syscall table that is mapped
 	nearby since the gateway page is mapped execute-only. */


More information about the parisc-linux-cvs mailing list