Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool/x86: allow syscall instruction

The syscall instruction is used in Xen PV mode for doing hypercalls.
Allow syscall to be used in the kernel in case it is tagged with an
unwind hint for objtool.

This is part of XSA-466 / CVE-2024-53241.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Co-developed-by: Peter Zijlstra <peterz@infradead.org>

+6 -3
+6 -3
tools/objtool/check.c
··· 3820 3820 break; 3821 3821 3822 3822 case INSN_CONTEXT_SWITCH: 3823 - if (func && (!next_insn || !next_insn->hint)) { 3824 - WARN_INSN(insn, "unsupported instruction in callable function"); 3825 - return 1; 3823 + if (func) { 3824 + if (!next_insn || !next_insn->hint) { 3825 + WARN_INSN(insn, "unsupported instruction in callable function"); 3826 + return 1; 3827 + } 3828 + break; 3826 3829 } 3827 3830 return 0; 3828 3831