summaryrefslogtreecommitdiffstats
path: root/debian/patches/fix-kernel-build.patch
blob: 5645d89aaed480932fac06ba376933bc000f9e93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Origin: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/2053024
Author: Xu Zhen (xuzhen666)
Forwarded: irc
diff --git a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
index 7b25b5cec..5cc50bf15 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
@@ -1476,6 +1476,8 @@ SUPR0DECL(int) SUPR0TracerDeregisterImpl(void *hMod, PSUPDRVSESSION pSession)
 SUPR0_EXPORT_SYMBOL(SUPR0TracerDeregisterImpl);
 
 
+#include <asm/nospec-branch.h>
+#include <asm/linkage.h>
 /*
  * The probe function is a bit more fun since we need tail jump optimizating.
  *
@@ -1495,11 +1497,13 @@ SUPR0TracerFireProbe:                                                   \n\
 # if   defined(RT_ARCH_AMD64)
 __asm__("\
             movq    g_pfnSupdrvProbeFireKernel(%rip), %rax              \n\
+            " ANNOTATE_RETPOLINE_SAFE "                                 \n\
             jmp     *%rax \n\
 ");
 # elif defined(RT_ARCH_X86)
 __asm__("\
             movl    g_pfnSupdrvProbeFireKernel, %eax                    \n\
+            " ANNOTATE_RETPOLINE_SAFE "                                 \n\
             jmp     *%eax \n\
 ");
 # else
@@ -1511,7 +1515,7 @@ __asm__("\
         .type supdrvTracerProbeFireStub,@function                       \n\
         .global supdrvTracerProbeFireStub                               \n\
 supdrvTracerProbeFireStub:                                              \n\
-        ret                                                             \n\
+        " ASM_RET "                                                     \n\
         .size supdrvTracerProbeFireStub, . - supdrvTracerProbeFireStub  \n\
                                                                         \n\
         .previous                                                       \n\