]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arch/riscv: vdso: remove CFI landing pad from rt_sigreturn
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 23 Jun 2026 20:40:57 +0000 (22:40 +0200)
committerPaul Walmsley <pjw@kernel.org>
Wed, 15 Jul 2026 01:34:38 +0000 (19:34 -0600)
commite4bf6eb4c7b61db1cf24487e14e6ae8755e61e3d
treed5d289d1fbc71f52544d7cea6179593f04a8dedf
parentad6dcfa023762e37962f77ee48e752b7570e9440
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 9a964285572b ("arm64:
vdso: Don't prefix sigreturn trampoline with a BTI C instruction") for a
similar issue.

Cc: stable@vger.kernel.org
Fixes: 37f57bd3faea ("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>
arch/riscv/kernel/vdso/rt_sigreturn.S