+ x86_64-fix-double-syscall-exit-traces.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     x86_64: fix double syscall exit traces

has been added to the -mm tree.  Its filename is

     x86_64-fix-double-syscall-exit-traces.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86_64: fix double syscall exit traces
From: Jeff Dike <jdike@xxxxxxxxxxx>


We are seeing double ptrace notifications of system call returns on recent
x86_64 kernels.  This breaks UML and at least one other app.

The patch below appears to fix the problem.  The bug is caused by both
syscall_trace and int_very_careful both calling syscall_trace_leave, and
the system call tracing path going through int_very_careful.

I would have liked to get rid of one or the other call to
syscall_trace_leave.  However, the syscall_trace path looks like it can
exit to userspace without going through int_very_careful, and
int_very_careful does things other than system call tracing.

So, instead, I took _TIF_SYSCALL_TRACE and _TIF_SYSCALL_AUDIT out of the
flags test on the grounds that they had already been checked in
syscall_trace.  There is possibly a preemption and call to schedule between
syscall_trace and int_very_careful, so if it can be attached at that point,
then the first return will be missed.  However, I think that ptrace
attachment requires a stopped child, not just one that has been preempted.

I don't see signal delivery between syscall_trace and int_very_careful, so
I don't see that there can be a ptrace attach followed by int_very_careful
missing the first return.

This is an RFC - if it turns out to be actually correct, some comments need
fixing before this goes anywhere.

UML works with this applied, and it doesn't seem to break singlestepping,
either on normal instructions or across system calls, which looks like the
next most vulnerable thing.

Cc: Andi Kleen <ak@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/x86_64/kernel/entry.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN arch/x86_64/kernel/entry.S~x86_64-fix-double-syscall-exit-traces arch/x86_64/kernel/entry.S
--- devel/arch/x86_64/kernel/entry.S~x86_64-fix-double-syscall-exit-traces	2006-05-26 10:59:19.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/entry.S	2006-05-26 10:59:19.000000000 -0700
@@ -345,7 +345,7 @@ int_very_careful:
 	sti
 	SAVE_REST
 	/* Check for syscall exit trace */	
-	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edx
+	testl $(_TIF_SINGLESTEP),%edx
 	jz int_signal
 	pushq %rdi
 	CFI_ADJUST_CFA_OFFSET 8
@@ -353,7 +353,7 @@ int_very_careful:
 	call syscall_trace_leave
 	popq %rdi
 	CFI_ADJUST_CFA_OFFSET -8
-	andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi
+	andl $~(_TIF_SINGLESTEP),%edi
 	cli
 	jmp int_restore_rest
 	
_

Patches currently in -mm which might be from jdike@xxxxxxxxxxx are

x86_64-fix-double-syscall-exit-traces.patch
uml-make-copy__user-atomic.patch
uml-fix-not_dead_yet-when-directory-is-in-bad-state.patch
uml-rename-and-improve-actually_do_remove.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux