ia64/linux-2.6.18-xen.hg

changeset 583:3643a33de277

x86/64: Fix syscall return code when ptrace or audit is active

Fix the return value from the 64-bit kernel when you call with a bad
system call number with tracing enabled (for either ptrace or audit).
What should happen is that the user process gets a -ENOSYS return
call from the syscall; what actually happens (only in the 64-bit
kernel) is that you get back the system call number. The 32-bit
kernel does not suffer from this bug.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jun 30 16:14:04 2008 +0100 (2008-06-30)
parents b29a06ba7a5f
children 72786307fa4c
files arch/x86_64/kernel/entry-xen.S
line diff
     1.1 --- a/arch/x86_64/kernel/entry-xen.S	Fri Jun 27 16:07:56 2008 +0100
     1.2 +++ b/arch/x86_64/kernel/entry-xen.S	Mon Jun 30 16:14:04 2008 +0100
     1.3 @@ -334,10 +334,10 @@ tracesys:
     1.4  	LOAD_ARGS ARGOFFSET  /* reload args from stack in case ptrace changed it */
     1.5  	RESTORE_REST
     1.6  	cmpq $__NR_syscall_max,%rax
     1.7 -	ja  1f
     1.8 +	ja  int_ret_from_sys_call
     1.9  	movq %r10,%rcx	/* fixup for C */
    1.10  	call *sys_call_table(,%rax,8)
    1.11 -1:	movq %rax,RAX-ARGOFFSET(%rsp)
    1.12 +	movq %rax,RAX-ARGOFFSET(%rsp)
    1.13  	/* Use IRET because user could have changed frame */
    1.14  	jmp int_ret_from_sys_call
    1.15  	CFI_ENDPROC