diff options
author | Roland McGrath <roland@redhat.com> | 2008-03-17 00:57:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:13 -0400 |
commit | 8ab32bb89b5b9bf06147c31947eba65f0f21c3c0 (patch) | |
tree | 2c74e3873400b613b5d717370177cfa4e1d54836 /arch/x86/ia32 | |
parent | ede1389f8ab4f3a1343e567133fa9720a054a3aa (diff) |
x86: ia32 ptrace vs -ENOSYS
When we're stopped at syscall entry tracing, ptrace can change the %eax
value from -ENOSYS to something else. If no system call is actually made
because the syscall number (now in orig_eax) is bad, then the %eax value
set by ptrace should be returned to the user. But, instead it gets reset
to -ENOSYS again. This is a regression from the native 32-bit kernel.
This change fixes it by leaving the return value alone after entry tracing.
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 8022d3c695c0..30f492934f23 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -325,7 +325,7 @@ ENTRY(ia32_syscall) | |||
325 | jnz ia32_tracesys | 325 | jnz ia32_tracesys |
326 | ia32_do_syscall: | 326 | ia32_do_syscall: |
327 | cmpl $(IA32_NR_syscalls-1),%eax | 327 | cmpl $(IA32_NR_syscalls-1),%eax |
328 | ja ia32_badsys | 328 | ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */ |
329 | IA32_ARG_FIXUP | 329 | IA32_ARG_FIXUP |
330 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative | 330 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative |
331 | ia32_sysret: | 331 | ia32_sysret: |
@@ -335,7 +335,7 @@ ia32_sysret: | |||
335 | ia32_tracesys: | 335 | ia32_tracesys: |
336 | SAVE_REST | 336 | SAVE_REST |
337 | CLEAR_RREGS | 337 | CLEAR_RREGS |
338 | movq $-ENOSYS,RAX(%rsp) /* really needed? */ | 338 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ |
339 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | 339 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
340 | call syscall_trace_enter | 340 | call syscall_trace_enter |
341 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | 341 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ |