[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



commit 021009eb633d4b07abda005554c120e59da9820f
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Feb 27 14:38:18 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
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 <jbeulich@xxxxxxxx>
---
 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
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.