29
29
30
30
.section .entry.text, "ax"
31
31
32
- /* clobbers %rax */
33
- .macro CLEAR_RREGS _r9 = rax
34
- xorl %eax ,%eax
35
- movq %rax ,R11(%rsp )
36
- movq %rax ,R10(%rsp )
37
- movq %\_r9,R9(%rsp )
38
- movq %rax ,R8(%rsp )
39
- .endm
40
-
41
32
/*
42
33
* Reload arg registers from stack in case ptrace changed them.
43
34
* We don't reload %eax because syscall_trace_enter() returned
@@ -243,7 +234,11 @@ sysexit_from_sys_call:
243
234
TRACE_IRQS_OFF
244
235
testl %edi , ASM_THREAD_INFO(TI_flags, %rsp , SIZEOF_PTREGS)
245
236
jz \exit
246
- CLEAR_RREGS
237
+ xorl %eax , %eax /* do not leak kernel information */
238
+ movq %rax , R11(%rsp )
239
+ movq %rax , R10(%rsp )
240
+ movq %rax , R9(%rsp )
241
+ movq %rax , R8(%rsp )
247
242
jmp int_with_check
248
243
.endm
249
244
@@ -267,7 +262,11 @@ sysenter_tracesys:
267
262
jz sysenter_auditsys
268
263
#endif
269
264
SAVE_EXTRA_REGS
270
- CLEAR_RREGS
265
+ xorl %eax , %eax /* do not leak kernel information */
266
+ movq %rax , R11(%rsp )
267
+ movq %rax , R10(%rsp )
268
+ movq %rax , R9(%rsp )
269
+ movq %rax , R8(%rsp )
271
270
movq %rsp ,%rdi /* &pt_regs -> arg1 */
272
271
call syscall_trace_enter
273
272
LOAD_ARGS32 /* reload args from stack in case ptrace changed it */
@@ -407,7 +406,11 @@ cstar_tracesys:
407
406
#endif
408
407
xchgl %r9d ,%ebp
409
408
SAVE_EXTRA_REGS
410
- CLEAR_RREGS r9
409
+ xorl %eax , %eax /* do not leak kernel information */
410
+ movq %rax , R11(%rsp )
411
+ movq %rax , R10(%rsp )
412
+ movq %r9 , R9(%rsp )
413
+ movq %rax , R8(%rsp )
411
414
movq %rsp ,%rdi /* &pt_regs -> arg1 */
412
415
call syscall_trace_enter
413
416
LOAD_ARGS32 1 /* reload args from stack in case ptrace changed it */
@@ -422,7 +425,11 @@ ia32_badarg:
422
425
jmp ia32_sysret
423
426
424
427
ia32_ret_from_sys_call:
425
- CLEAR_RREGS
428
+ xorl %eax , %eax /* do not leak kernel information */
429
+ movq %rax , R11(%rsp )
430
+ movq %rax , R10(%rsp )
431
+ movq %rax , R9(%rsp )
432
+ movq %rax , R8(%rsp )
426
433
jmp int_ret_from_sys_call
427
434
428
435
/*
0 commit comments