diff -up ./arch/x86/Kconfig.cpu.ssp ./arch/x86/Kconfig.cpu --- ./arch/x86/Kconfig.cpu.ssp 2026-05-29 18:37:41.253961024 +0900 +++ ./arch/x86/Kconfig.cpu 2026-05-29 18:50:49.969150158 +0900 @@ -383,6 +383,18 @@ config GEODE_NOPL If you are not sure, say N. +config IGNORE_SSP_OPCODE + bool "Skip unrecognized SSP (Shadow Stack Pointer) opcodes" + depends on X86_32 && CPU_EMU486 + help + Skips endbr32, incsspd, rdsspd opcode on unsupported CPUs. + glibc unconditionally uses these opcode in __longjmp.S, + which causes illegal opcode exceptions on CPUs not capable of + CET_IBT feature. + Does not affect CPUs which do have CET_IBT feature. + + If you are not sure, say N. + config CPU_EMU486_DEBUG bool "Emulation debug" depends on X86_32 && CPU_EMU486 diff -up ./arch/x86/configs/i386_defconfig.ssp ./arch/x86/configs/i386_defconfig --- ./arch/x86/configs/i386_defconfig.ssp 2026-05-29 18:37:41.305961133 +0900 +++ ./arch/x86/configs/i386_defconfig 2026-05-29 18:50:49.970150160 +0900 @@ -33,6 +33,7 @@ CONFIG_SMP=y # CONFIG_CPU_EMU686 is not set # CONFIG_CPU_EMU486_DEBUG is not set # CONFIG_GEODE_NOPL is not set +# CONFIG_IGNORE_SSP_OPCODE is not set CONFIG_HYPERVISOR_GUEST=y CONFIG_PARAVIRT=y CONFIG_NR_CPUS=8 diff -up ./arch/x86/kernel/traps.c.ssp ./arch/x86/kernel/traps.c --- ./arch/x86/kernel/traps.c.ssp 2026-05-29 18:37:41.380961292 +0900 +++ ./arch/x86/kernel/traps.c 2026-05-29 18:50:49.971150161 +0900 @@ -640,6 +640,30 @@ static void handle_invalid_op(struct pt_ u32 *src, *dst; u8 *eip = (u8 *)regs->ip; +#ifdef CONFIG_IGNORE_SSP_OPCODE + { + u32 op32; + get_user(op32, (u32 *)eip); + /* endbr32: F3 0F 1E FB */ + if (op32 == swab32(0xf30f1efb)) { + regs->ip = (typeof(regs->ip))(eip + 4); + return; + } + /* rdsspd r32: F3 0F 1E /1 (mod=11) */ + if ((op32 & swab32(0xffffff00 | 0b11111000)) == + swab32(0xf30f1e00 | 0b11001000)) { + regs->ip = (typeof(regs->ip))(eip + 4); + return; + } + /* incsspd r32: F3 0F AE /5 */ + if ((op32 & swab32(0xffffff00 | 0b11111000)) == + swab32(0xf30fae00 | 0b11101000)) { + regs->ip = (typeof(regs->ip))(eip + 4); + return; + } + }/*op32*/ +#endif + #ifdef CONFIG_GEODE_NOPL /*do_nopl_emu*/ {