linux/arch/riscv/kernel/vdso
Aurelien Jarno e4bf6eb4c7 arch/riscv: vdso: remove CFI landing pad from rt_sigreturn
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 9a96428557 ("arm64:
vdso: Don't prefix sigreturn trampoline with a BTI C instruction") for a
similar issue.

Cc: stable@vger.kernel.org
Fixes: 37f57bd3fa ("arch/riscv: compile vdso with landing pad and shadow stack note")
Co-authored-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://patch.msgid.link/20260623204058.498120-1-aurelien@aurel32.net
[pjw@kernel.org: fixed comment style]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-07-14 19:34:38 -06:00
..
.gitignore RISC-V: Fix the VDSO symbol generaton for binutils-2.35+ 2020-11-06 00:03:48 -08:00
flush_icache.S arch/riscv: compile vdso with landing pad and shadow stack note 2026-01-29 02:38:40 -07:00
gen_vdso_offsets.sh arch/riscv: add dual vdso creation logic and select vdso based on hw 2026-01-29 02:38:40 -07:00
getcpu.S arch/riscv: compile vdso with landing pad and shadow stack note 2026-01-29 02:38:40 -07:00
getrandom.c RISC-V: vDSO: Wire up getrandom() vDSO implementation 2025-06-05 14:03:09 -07:00
hwprobe.c riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot 2025-10-17 22:23:11 -06:00
Makefile riscv: vdso: Do not use LTO for the vDSO 2026-07-13 12:08:27 -06:00
note.S riscv: Add build salt to the vDSO 2026-06-25 12:05:05 -06:00
rt_sigreturn.S arch/riscv: vdso: remove CFI landing pad from rt_sigreturn 2026-07-14 19:34:38 -06:00
sys_hwprobe.S arch/riscv: compile vdso with landing pad and shadow stack note 2026-01-29 02:38:40 -07:00
vdso.lds.S riscv: vdso: Exclude .rodata from the PT_DYNAMIC segment 2025-06-10 13:06:48 -07:00
vdso.S riscv: compat: vdso: Add COMPAT_VDSO base code implementation 2022-04-26 13:36:53 -07:00
vgetrandom-chacha.S arch/riscv: compile vdso with landing pad and shadow stack note 2026-01-29 02:38:40 -07:00
vgettimeofday.c arch: vdso: consolidate gettime prototypes 2023-11-23 11:32:32 +01:00