cmpb $USER_RPL, %bl
jb resume_kernel
xorl %edx, %edx
- call do_notify_resume
+ call clear_stack_do_notify_resume
jmp resume_userspace
#ifdef CONFIG_VM86
#endif
END(work_pending)
+ # Clear the stack before handling signals
+ ALIGN
+#define STACK_CLEAR_WORDS 0x80
+ENTRY(clear_stack_do_notify_resume)
+ testl $_TIF_SIGPENDING, %ecx
+ jnz do_notify_resume
+
+ push %eax
+ push %ecx
+ push %edi
+
+ movl %esp, %edi
+ subl $4, %edi
+ movl $STACK_CLEAR_WORDS, %ecx
+ xorl %eax, %eax
+
+ std
+ rep stosl
+ cld
+
+ pop %edi
+ pop %ecx
+ pop %eax
+
+ jmp do_notify_resume
+END(clear_stack_do_notify_resume)
+
# perform syscall exit tracing
ALIGN
syscall_trace_entry:
jz 1f
movq %rsp,%rdi # &ptregs -> arg1
xorl %esi,%esi # oldset -> arg2
- call do_notify_resume
+ call clear_stack_do_notify_resume
1: movl $_TIF_WORK_MASK,%edi
int_restore_rest:
RESTORE_REST
movq $-1,ORIG_RAX(%rsp)
xorl %esi,%esi # oldset
movq %rsp,%rdi # &pt_regs
- call do_notify_resume
+ call clear_stack_do_notify_resume
RESTORE_REST
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
ENABLE_INTERRUPTS(CLBR_NONE)
xorl %esi,%esi /* arg2: oldset */
movq %rsp,%rdi /* arg1: &pt_regs */
- call do_notify_resume
+ call clear_stack_do_notify_resume
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
jmp paranoid_userspace
CFI_ENDPROC
END(ignore_sysret)
+ # Clear the stack before handling signals
+#define STACK_CLEAR_WORDS 0x80
+ENTRY(clear_stack_do_notify_resume)
+ testl $_TIF_SIGPENDING, %edx
+ jnz do_notify_resume
+
+ pushq %rdi
+
+ movq %rsp, %rdi
+ subq $8, %rdi
+ movl $STACK_CLEAR_WORDS, %ecx
+ xorq %rax, %rax
+
+ std
+ rep stosq
+ cld
+
+ popq %rdi
+
+ jmp do_notify_resume
+END(clear_stack_do_notify_resume)
+
/*
* End of kprobes section
*/