From: Andy Whitcroft The vsyscall implementation for ia32 provides two different vsyscall pages; one to use int80 and the other to use sysenter. Each includes a common signal trailer. The kernel requires the alignment of routines in this trailer be consistent in both copies. However this is not enforced at compile time. Failure to maintain this alignment typically leads to an obscure SIGSEGV in init during boot. This critical alignment requirement is not well documented. Below is a patch to better document the alignment requirements and to enforce the requirement. --- 25-akpm/arch/i386/kernel/vsyscall-int80.S | 5 +++++ 25-akpm/arch/i386/kernel/vsyscall-sigreturn.S | 6 +++--- 25-akpm/arch/i386/kernel/vsyscall-sysenter.S | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/vsyscall-int80.S~vsyscall-alignment-fix arch/i386/kernel/vsyscall-int80.S --- 25/arch/i386/kernel/vsyscall-int80.S~vsyscall-alignment-fix 2004-03-14 11:39:14.781338680 -0800 +++ 25-akpm/arch/i386/kernel/vsyscall-int80.S 2004-03-14 11:39:50.224950432 -0800 @@ -1,5 +1,10 @@ /* * Code for the vsyscall page. This version uses the old int $0x80 method. + * + * NOTE: + * 1) __kernel_vsyscall _must_ be first in this page. + * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S + * for details. */ .text diff -puN arch/i386/kernel/vsyscall-sigreturn.S~vsyscall-alignment-fix arch/i386/kernel/vsyscall-sigreturn.S --- 25/arch/i386/kernel/vsyscall-sigreturn.S~vsyscall-alignment-fix 2004-03-14 11:39:14.783338376 -0800 +++ 25-akpm/arch/i386/kernel/vsyscall-sigreturn.S 2004-03-14 11:39:14.787337768 -0800 @@ -2,8 +2,8 @@ * Common code for the sigreturn entry points on the vsyscall page. * So far this code is the same for both int80 and sysenter versions. * This file is #include'd by vsyscall-*.S to define them after the - * vsyscall entry point. The addresses we get for these entry points - * by doing ".balign 32" must match in both versions of the page. + * vsyscall entry point. The kernel assumes that the addresses of these + * routines are constant for all vsyscall implementations. */ #include @@ -15,7 +15,7 @@ */ .text - .balign 32 + .org __kernel_vsyscall+32 .globl __kernel_sigreturn .type __kernel_sigreturn,@function __kernel_sigreturn: diff -puN arch/i386/kernel/vsyscall-sysenter.S~vsyscall-alignment-fix arch/i386/kernel/vsyscall-sysenter.S --- 25/arch/i386/kernel/vsyscall-sysenter.S~vsyscall-alignment-fix 2004-03-14 11:39:14.784338224 -0800 +++ 25-akpm/arch/i386/kernel/vsyscall-sysenter.S 2004-03-14 11:40:14.461265952 -0800 @@ -1,5 +1,10 @@ /* * Code for the vsyscall page. This version uses the sysenter instruction. + * + * NOTE: + * 1) __kernel_vsyscall _must_ be first in this page. + * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S + * for details. */ .text _