Re: [PATCH] arch/riscv: vdso: remove CFI landing pad from rt_sigreturn
From: Joel Stanley
Date: Mon Jun 29 2026 - 03:50:17 EST
On Fri, 26 Jun 2026 at 03:33, Paul Walmsley <pjw@xxxxxxxxxx> wrote:
>
> Hi Joel,
>
> On Tue, 23 Jun 2026, Aurelien Jarno wrote:
>
> > When CONFIG_RISCV_USER_CFI is enabled, the CFI version of the vDSO, has
> > a CFI landing pad instruction at the start of __vdso_rt_sigreturn. This
> > breaks libgcc's unwinding code which matches on the first two
> > instructions. Other unwinders that rely on similar instruction matching
> > may also be affected.
> >
> > Since __vdso_rt_sigreturn is reached as part of signal-return handling
> > rather than via an indirect call/jump from userspace, it does not need a
> > CFI landing pad. Remove it and restore the instruction sequence expected
> > by existing unwinding code.
> >
> > This matches what was done on arm64 in commit 9a964285572b ("arm64:
> > vdso: Don't prefix sigreturn trampoline with a BTI C instruction") for a
> > similar issue.
> >
> > Fixes: 37f57bd3faea ("arch/riscv: compile vdso with landing pad and shadow stack note")
> > Co-authored-by: Joel Stanley <joel@xxxxxxxxx>
> > Signed-off-by: Aurelien Jarno <aurelien@xxxxxxxxxxx>
>
> I'd like to take this one. But since you're listed as the co-author, I
> probably need your Signed-off-by: as well. Care to reply with it?
Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
Thanks Aurelien for working with me on this one. I saw CFI was
disabled in the debian kernel config and wondered why (failing glibc
backtrace tests with CFI enabled), and we got to the bottom of it.
This one should go to stable IMO.
Cheers,
Joel