Skip to content

Commit 5a1fcce

Browse files
committed
fix
1 parent 42ec8b1 commit 5a1fcce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/kernel/ftrace_64.S

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,18 @@ STACK_FRAME_NON_STANDARD_FP(__fentry__)
353353
SYM_CODE_START(return_to_handler)
354354
UNWIND_HINT_UNDEFINED
355355
ANNOTATE_NOENDBR
356+
push $return_to_handler
357+
UNWIND_HINT_FUNC
356358

357359
/* Save ftrace_regs for function exit context */
358360
subq $(FRAME_SIZE), %rsp
359361

360362
movq %rax, RAX(%rsp)
361363
movq %rdx, RDX(%rsp)
362364
movq %rbp, RBP(%rsp)
365+
movq %rsp, RSP(%rsp)
366+
movq $0, EFLAGS(%rsp)
367+
movq $__KERNEL_CS, CS(%rsp)
363368
movq %rsp, %rdi
364369

365370
call ftrace_return_to_handler
@@ -368,7 +373,8 @@ SYM_CODE_START(return_to_handler)
368373
movq RDX(%rsp), %rdx
369374
movq RAX(%rsp), %rax
370375

371-
addq $(FRAME_SIZE), %rsp
376+
addq $(FRAME_SIZE) + 8, %rsp
377+
372378
/*
373379
* Jump back to the old return address. This cannot be JMP_NOSPEC rdi
374380
* since IBT would demand that contain ENDBR, which simply isn't so for

0 commit comments

Comments
 (0)