]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
objtool/x86: allow syscall instruction
authorJuergen Gross <jgross@suse.com>
Fri, 29 Nov 2024 14:47:49 +0000 (15:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2024 17:07:22 +0000 (18:07 +0100)
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 <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Co-developed-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/objtool/check.c

index fd6714de2260e60f8e00ee97c3f815c966b04e2a..c2596b1e1fb1e30562e19c9c9c07c6b2452a064b 100644 (file)
@@ -3206,10 +3206,13 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
                        break;
 
                case INSN_CONTEXT_SWITCH:
-                       if (func && (!next_insn || !next_insn->hint)) {
-                               WARN_FUNC("unsupported instruction in callable function",
-                                         sec, insn->offset);
-                               return 1;
+                       if (func) {
+                               if (!next_insn || !next_insn->hint) {
+                                       WARN_FUNC("unsupported instruction in callable function",
+                                                 sec, insn->offset);
+                                       return 1;
+                               }
+                               break;
                        }
                        return 0;