]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/entry/vdso32: Work around libgcc unwinder bug
authorH. Peter Anvin <hpa@zytor.com>
Fri, 27 Feb 2026 01:03:07 +0000 (17:03 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 4 Mar 2026 16:06:08 +0000 (17:06 +0100)
commitb5ef09a77d0b5213268300eedd8a7d28b4e92d47
tree0aece112cb84509af6d345a84de1da8cc1267b50
parent59674fc9d0bfd96ce8a776680ee1cf22c28c9ac7
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: 884961618ee5 ("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
arch/x86/entry/vdso/vdso32/sigreturn.S