2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 09:43:59 +08:00

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:
Roland McGrath 2008-07-25 20:00:10 -07:00
parent 1ff8419871
commit 024e8ac044

View 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: