Re: [PATCH] x86/fgraph: Fix the unwind hint at the end of return_to_handler()

From: Steven Rostedt

Date: Thu Nov 19 2026 - 12:54:54 EST


On Wed, 18 Nov 2026 15:50:23 -0800
Yifan Feng <evanfengff@xxxxxxxxx> wrote:

> return_to_handler() reserves 8 bytes of stack for the return address
> and marks that with UNWIND_HINT_FUNC. The hint stays in effect after
> "addq $(FRAME_SIZE) + 8, %rsp" has dropped the slot again, so the ORC
> entry of the following call has CFA = sp+0:
>
> return_to_handler+0x41: sp+0 call .Ldo_rop
> return_to_handler+0x46: (und) int3
> return_to_handler+0x47: sp+8 mov %rdi, (%rsp)
>
> A stack trace taken from an interrupt which hits the call or the mov
> ends up at that entry, the stack pointer does not advance and the
> unwinder prints:
>
> WARNING: stack going in the wrong direction? at return_to_handler+0x46/0x50
>
> The return address is only in %rdi at that point. Mark the code as
> UNWIND_HINT_UNDEFINED again, as it was before the hint was added, so
> that the unwinder stops there without the warning.

Makes sense.

Reviewed-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Peter, can you take this?

-- Steve