[PATCH] arch/riscv: vdso: remove CFI landing pad from rt_sigreturn

Paul Walmsley pjw at kernel.org
Thu Jun 25 11:03:48 PDT 2026


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 at jms.id.au>
> Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>

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?

thanks 

- Paul



More information about the linux-riscv mailing list