linux/arch/x86/entry
H. Peter Anvin b5ef09a77d x86/entry/vdso32: Work around libgcc unwinder bug
The unwinder code in libgcc has a long standing bug which causes it to
fail to pick up the signal frame CFI flag. This is a generic bug
across all platforms.

It affects the __kernel_sigreturn and __kernel_rt_sigreturn vdso entry
points on i386. The x86-64 kernel doesn't provide a sigreturn stub,
and so there is no kernel-provided code that is affected on x86-64.

libgcc does have a legacy fallback path which happens to work as long
as the bytes immediately before each of the sigreturn functions fall
outside any function. This patch adds a nop before the ALIGN to each
of the sigreturn stubs to ensure that this is, indeed, the case.

The rest of the patch is just a comment which documents the invariants
that need to be maintained for this legacy path to work correctly.

This is a manifest bug: in the current vdso, __kernel_vsyscall is a
multiple of 16 bytes long and thus __kernel_sigreturn does not have
any padding in front of it.

Closes: https://lore.kernel.org/lkml/f3412cc3e8f66d1853cc9d572c0f2fab076872b1.camel@xry111.site
Fixes: 884961618e ("x86/entry/vdso32: Remove open-coded DWARF in sigreturn.S")
Reported-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124050
Link: https://patch.msgid.link/20260227010308.310342-1-hpa@zytor.com
2026-03-04 17:06:08 +01:00
..
syscalls rseq: Implement sys_rseq_slice_yield() 2026-01-22 11:11:17 +01:00
vdso x86/entry/vdso32: Work around libgcc unwinder bug 2026-03-04 17:06:08 +01:00
vsyscall x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
calling.h x86/fred: Play nice with invoking asm_fred_entry_from_kvm() on non-FRED hardware 2025-08-18 14:23:08 +02:00
entry.S * Make MSR-induced taint easier for users to track down 2025-12-02 14:16:42 -08:00
entry_32.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64.S x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
entry_64_compat.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64_fred.S x86: Restrict KVM-induced symbol exports to KVM modules where obvious/possible 2025-11-12 15:29:38 -08:00
entry_fred.c x86/fred: Correct speculative safety in fred_extint() 2026-02-23 11:19:11 +01:00
Makefile x86/syscall: Move sys_ni_syscall() 2025-03-19 11:19:17 +01:00
syscall_32.c x86/entry/vdso: Rename vdso_image_* to vdso*_image 2026-01-13 15:33:20 -08:00
syscall_64.c x86/syscall: Remove stray semicolons 2025-03-19 11:19:18 +01:00
thunk.S x86/entry: Merge thunk_64.S and thunk_32.S into thunk.S 2024-04-09 09:57:56 +02:00