@@ -205,7 +205,6 @@ sysexit_from_sys_call:
205
205
movl RDX(%rsp ), %edx /* arg3 */
206
206
movl RSI(%rsp ), %ecx /* arg4 */
207
207
movl RDI(%rsp ), %r8d /* arg5 */
208
- movl %ebp , %r9d /* arg6 */
209
208
.endm
210
209
211
210
.macro auditsys_exit exit
@@ -236,6 +235,7 @@ sysexit_from_sys_call:
236
235
237
236
sysenter_auditsys:
238
237
auditsys_entry_common
238
+ movl %ebp , %r9d /* reload 6th syscall arg */
239
239
jmp sysenter_dispatch
240
240
241
241
sysexit_audit:
@@ -336,7 +336,7 @@ ENTRY(entry_SYSCALL_compat)
336
336
* 32-bit zero extended:
337
337
*/
338
338
ASM_STAC
339
- 1: movl (%r8 ), %ebp
339
+ 1: movl (%r8 ), %r9d
340
340
_ASM_EXTABLE(1b, ia32_badarg)
341
341
ASM_CLAC
342
342
orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp , SIZEOF_PTREGS)
@@ -346,7 +346,7 @@ ENTRY(entry_SYSCALL_compat)
346
346
cstar_do_call:
347
347
/* 32-bit syscall -> 64-bit C ABI argument conversion */
348
348
movl %edi , %r8d /* arg5 */
349
- movl %ebp , %r9d /* arg6 */
349
+ /* r9 already loaded */ /* arg6 */
350
350
xchg %ecx , %esi /* rsi:arg2, rcx:arg4 */
351
351
movl %ebx , %edi /* arg1 */
352
352
movl %edx , %edx /* arg3 (zero extension) */
@@ -358,7 +358,6 @@ cstar_dispatch:
358
358
call *ia32_sys_call_table(, %rax , 8 )
359
359
movq %rax , RAX(%rsp )
360
360
1:
361
- movl RCX(%rsp ), %ebp
362
361
DISABLE_INTERRUPTS(CLBR_NONE)
363
362
TRACE_IRQS_OFF
364
363
testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp , SIZEOF_PTREGS)
@@ -392,7 +391,9 @@ sysretl_from_sys_call:
392
391
393
392
#ifdef CONFIG_AUDITSYSCALL
394
393
cstar_auditsys:
394
+ movl %r9d , R9(%rsp ) /* register to be clobbered by call */
395
395
auditsys_entry_common
396
+ movl R9(%rsp ), %r9d /* reload 6th syscall arg */
396
397
jmp cstar_dispatch
397
398
398
399
sysretl_audit:
@@ -404,14 +405,16 @@ cstar_tracesys:
404
405
testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp , SIZEOF_PTREGS)
405
406
jz cstar_auditsys
406
407
#endif
408
+ xchgl %r9d , %ebp
407
409
SAVE_EXTRA_REGS
408
410
xorl %eax , %eax /* Do not leak kernel information */
409
411
movq %rax , R11(%rsp )
410
412
movq %rax , R10(%rsp )
411
- movq %rax , R9(%rsp )
413
+ movq %r9 , R9(%rsp )
412
414
movq %rax , R8(%rsp )
413
415
movq %rsp , %rdi /* &pt_regs -> arg1 */
414
416
call syscall_trace_enter
417
+ movl R9(%rsp ), %r9d
415
418
416
419
/* Reload arg registers from stack. (see sysenter_tracesys) */
417
420
movl RCX(%rsp ), %ecx
@@ -421,6 +424,7 @@ cstar_tracesys:
421
424
movl %eax , %eax /* zero extension */
422
425
423
426
RESTORE_EXTRA_REGS
427
+ xchgl %ebp , %r9d
424
428
jmp cstar_do_call
425
429
END(entry_SYSCALL_compat)
426
430
0 commit comments