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

[Xen-changelog] [xen stable-4.7] x86/emul: Fix the decoding of segment overrides in 64bit mode



commit d02dfea764033a91ab365ffd082a6c3eadda5a39
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Mar 6 16:20:15 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Mar 6 16:20:15 2018 +0100

    x86/emul: Fix the decoding of segment overrides in 64bit mode
    
    Explicit segment overides other than %fs and %gs are documented as ignored 
by
    both Intel and AMD.
    
    In practice, this means that:
    
     * Explicit uses of %ss don't actually yield #SS[0] for non-canonical
       memory references.
     * Explicit uses of %{e,c,d}s don't override %rbp/%rsp-based memory 
references
       to yield #GP[0] for non-canonical memory references.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: b7dce29d9faf3597d009c853ed1fcbed9f7a7f68
    master date: 2018-02-15 11:08:27 +0000
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index 256604c17c..a11f2cdb3a 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1678,6 +1678,10 @@ x86_emulate(
     }
  done_prefixes:
 
+    /* %{e,c,s,d}s overrides are ignored in 64bit mode. */
+    if ( mode_64bit() && override_seg < x86_seg_fs )
+        override_seg = x86_seg_none;
+
     if ( rex_prefix & REX_W )
         op_bytes = 8;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
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®.