]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86emul: properly refuse LOCK on most 0FC7 insns
authorJan Beulich <jbeulich@suse.com>
Thu, 28 Sep 2017 09:04:20 +0000 (11:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Sep 2017 09:04:20 +0000 (11:04 +0200)
When adding support for RDRAND/RDSEED/RDPID I didn't remember to also
update this special early check. Make it (hopefully) future-proof by
also refusing VEX-encodings.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index c1e2300b39adc67f99ba43a9ad27ccb7de974fbd..ff1a401bae3cc368e47502319520297bceb4b63e 100644 (file)
@@ -3087,7 +3087,9 @@ x86_emulate(
          * The only implicit-operands instructions allowed a LOCK prefix are
          * CMPXCHG{8,16}B (MOV CRn is being handled elsewhere).
          */
-        generate_exception_if(lock_prefix && (ext != ext_0f || b != 0xc7),
+        generate_exception_if(lock_prefix &&
+                              (vex.opcx || ext != ext_0f || b != 0xc7 ||
+                               (modrm_reg & 7) != 1 || ea.type != OP_MEM),
                               EXC_UD);
         dst.type = OP_NONE;
         break;