Skip to content

Commit

Permalink
objtool/x86: allow syscall instruction
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Co-developed-by: Peter Zijlstra <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jgross1 authored and gregkh committed Dec 19, 2024
1 parent aac984c commit 8fb54fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -3719,9 +3719,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;

Expand Down

0 comments on commit 8fb54fe

Please sign in to comment.