]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
objtool/x86: allow syscall instruction
authorJuergen Gross <jgross@suse.com>
Fri, 29 Nov 2024 14:47:49 +0000 (15:47 +0100)
committerJuergen Gross <jgross@suse.com>
Fri, 13 Dec 2024 08:28:21 +0000 (09:28 +0100)
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>
tools/objtool/check.c

index 4ce176ad411fb12a10101bbedbb6180275941b4b..76060da755b5c51cda3a669d8245d7d004e25f22 100644 (file)
@@ -3820,9 +3820,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;