]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86_64: fix ia32 AMD syscall audit fast-path
authorRoland McGrath <roland@redhat.com>
Sat, 26 Jul 2008 03:00:10 +0000 (20:00 -0700)
committerRoland McGrath <roland@redhat.com>
Sat, 26 Jul 2008 03:02:41 +0000 (20:02 -0700)
The new code in commit 5cbf1565f29eb57a86a305b08836613508e294d7
has a bug in the version supporting the AMD 'syscall' instruction.
It clobbers the user's %ecx register value (with the %ebp value).

This change fixes it.

Signed-off-by: Roland McGrath <roland@redhat.com>
arch/x86/ia32/ia32entry.S

index e4bd1793a5e415bc90b5a39a5e77f2182e01be60..ffc1bb4fed7d1ade2ed385597fd05464fea55528 100644 (file)
@@ -201,7 +201,7 @@ sysexit_from_sys_call:
        movl RDI-ARGOFFSET(%rsp),%r8d   /* reload 5th syscall arg */
        .endm
 
-       .macro auditsys_exit exit
+       .macro auditsys_exit exit,ebpsave=RBP
        testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
        jnz int_ret_from_sys_call
        TRACE_IRQS_ON
@@ -214,7 +214,7 @@ sysexit_from_sys_call:
        call audit_syscall_exit
        GET_THREAD_INFO(%r10)
        movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall return value */
-       movl RBP-ARGOFFSET(%rsp),%ebp   /* reload user register value */
+       movl \ebpsave-ARGOFFSET(%rsp),%ebp /* reload user register value */
        movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
        cli
        TRACE_IRQS_OFF
@@ -347,7 +347,7 @@ cstar_auditsys:
        jmp cstar_dispatch
 
 sysretl_audit:
-       auditsys_exit sysretl_from_sys_call
+       auditsys_exit sysretl_from_sys_call, RCX /* user %ebp in RCX slot */
 #endif
 
 cstar_tracesys: