[xen stable-4.6] x86: two fixes to Spectre v2 backports

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen stable-4.6] x86: two fixes to Spectre v2 backports

patchbot
commit 021009eb633d4b07abda005554c120e59da9820f
Author:     Jan Beulich <[hidden email]>
AuthorDate: Tue Feb 27 14:38:18 2018 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue Feb 27 14:38:18 2018 +0100

    x86: two fixes to Spectre v2 backports
   
    - convert another (importantish) indirect call
    - check the full guest value for PV SPEC_CTRL writes
   
    Signed-off-by: Jan Beulich <[hidden email]>
---
 xen/arch/x86/traps.c        | 2 +-
 xen/arch/x86/x86_64/entry.S | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8e97703ed0..e80f3eae64 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2729,7 +2729,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
              * when STIBP isn't enumerated in hardware.
              */
 
-            if ( eax & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP) )
+            if ( msr_content & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP) )
                 goto fail; /* Rsvd bit set? */
 
             v->arch.spec_ctrl = eax;
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 72170aa900..59d3347d3c 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -239,7 +239,8 @@ UNLIKELY_START(ne, trace)
 UNLIKELY_END(trace)
         leaq  hypercall_table(%rip),%r10
         PERFC_INCR(hypercalls, %rax, %rbx)
-        callq *(%r10,%rax,8)
+        mov   (%r10, %rax, 8), %rax
+        INDIRECT_CALL %rax
 #ifndef NDEBUG
         /* Deliberately corrupt parameter regs used by this hypercall. */
         popq  %r10         # Shadow RIP
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog