From 23742d305f3477223c7dd3e8c981f097f5e07003 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 13 Mar 2025 13:21:44 +0900 Subject: [PATCH] objtool/x86: allow syscall instruction BugLink: https://bugs.launchpad.net/bugs/2102181 commit dda014ba59331dee4f3b773a020e109932f4bd24 upstream. 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 Signed-off-by: Juergen Gross Co-developed-by: Peter Zijlstra Signed-off-by: Greg Kroah-Hartman Signed-off-by: Koichiro Den Signed-off-by: Mehmet Basaran --- tools/objtool/check.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 1611860148c5..775bacae040a 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3735,9 +3735,12 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, break; case INSN_CONTEXT_SWITCH: - if (func && (!next_insn || !next_insn->hint)) { - WARN_INSN(insn, "unsupported instruction in callable function"); - return 1; + if (func) { + if (!next_insn || !next_insn->hint) { + WARN_INSN(insn, "unsupported instruction in callable function"); + return 1; + } + break; } return 0;