Fix 32bit strace for 6 argument system calls Need to put the argument into ebp on the stack frame. Originally noted by Roland McGrath Index: linux/arch/x86_64/ia32/ia32entry.S =================================================================== --- linux.orig/arch/x86_64/ia32/ia32entry.S +++ linux/arch/x86_64/ia32/ia32entry.S @@ -102,20 +102,18 @@ sysenter_do_call: .byte 0xf, 0x35 sysenter_tracesys: + xchgq %r9,%rbp SAVE_REST CLEAR_RREGS movq $-ENOSYS,RAX(%rsp) /* really needed? */ movq %rsp,%rdi /* &pt_regs -> arg1 */ + pushq %r9 call syscall_trace_enter + popq %r9 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */ RESTORE_REST + xchgq %rbp,%r9 movl %ebp, %ebp - /* no need to do an access_ok check here because rbp has been - 32bit zero extended */ -1: movl (%rbp),%r9d - .section __ex_table,"a" - .quad 1b,ia32_badarg - .previous jmp sysenter_do_call CFI_ENDPROC @@ -183,20 +181,18 @@ cstar_do_call: sysretl cstar_tracesys: + xchgq %r9,%rbp SAVE_REST CLEAR_RREGS movq $-ENOSYS,RAX(%rsp) /* really needed? */ movq %rsp,%rdi /* &pt_regs -> arg1 */ + pushq %r9 call syscall_trace_enter + popq %r9 LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */ RESTORE_REST - movl RSP-ARGOFFSET(%rsp), %r8d - /* no need to do an access_ok check here because r8 has been - 32bit zero extended */ -1: movl (%r8),%r9d - .section __ex_table,"a" - .quad 1b,ia32_badarg - .previous + xchgq %r9,%rbp + movl %ebp,%ebp jmp cstar_do_call ia32_badarg: