mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 14:53:11 +01:00
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 commit9a96428557("arm64: vdso: Don't prefix sigreturn trampoline with a BTI C instruction") for a similar issue. Cc: [email protected] Fixes:37f57bd3fa("arch/riscv: compile vdso with landing pad and shadow stack note") Co-authored-by: Joel Stanley <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Link: https://patch.msgid.link/[email protected] [[email protected]: fixed comment style] Signed-off-by: Paul Walmsley <[email protected]>