x86_64: fix ia32 AMD syscall audit fast-path
The new code in commit 5cbf1565f2
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>
This commit is contained in:
parent
1ff8419871
commit
024e8ac044
|
@ -201,7 +201,7 @@ sysexit_from_sys_call:
|
||||||
movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
|
movl RDI-ARGOFFSET(%rsp),%r8d /* reload 5th syscall arg */
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro auditsys_exit exit
|
.macro auditsys_exit exit,ebpsave=RBP
|
||||||
testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
|
testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
|
||||||
jnz int_ret_from_sys_call
|
jnz int_ret_from_sys_call
|
||||||
TRACE_IRQS_ON
|
TRACE_IRQS_ON
|
||||||
|
@ -214,7 +214,7 @@ sysexit_from_sys_call:
|
||||||
call audit_syscall_exit
|
call audit_syscall_exit
|
||||||
GET_THREAD_INFO(%r10)
|
GET_THREAD_INFO(%r10)
|
||||||
movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */
|
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
|
movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
|
||||||
cli
|
cli
|
||||||
TRACE_IRQS_OFF
|
TRACE_IRQS_OFF
|
||||||
|
@ -347,7 +347,7 @@ cstar_auditsys:
|
||||||
jmp cstar_dispatch
|
jmp cstar_dispatch
|
||||||
|
|
||||||
sysretl_audit:
|
sysretl_audit:
|
||||||
auditsys_exit sysretl_from_sys_call
|
auditsys_exit sysretl_from_sys_call, RCX /* user %ebp in RCX slot */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cstar_tracesys:
|
cstar_tracesys:
|
||||||
|
|
Loading…
Reference in New Issue