Commit 024e8ac0 authored by Roland McGrath's avatar Roland McGrath
Browse files

x86_64: fix ia32 AMD syscall audit fast-path

The new code in commit 5cbf1565


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: default avatarRoland McGrath <roland@redhat.com>
parent 1ff84198
......@@ -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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment