]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
x86emul: correct 32-bit address handling for AVX2 gathers
authorJan Beulich <jbeulich@suse.com>
Wed, 28 Nov 2018 14:50:26 +0000 (15:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 28 Nov 2018 14:50:26 +0000 (15:50 +0100)
As done for other cases by commit 7869e2bafe ("x86emul/fuzz: add
rudimentary limit checking"), address calculations should also use
truncate_ea() for the AVX2 gather insns.

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 e11183d8d62952c1977657cd12683859d4f8b32c..0ae433538e5954d37823021ec98b7018aa801579 100644 (file)
@@ -8400,7 +8400,8 @@ x86_emulate(
                 signed long idx = b & 1 ? index.qw[i] : index.dw[i];
 
                 rc = ops->read(ea.mem.seg,
-                               ea.mem.off + (idx << state->sib_scale),
+                               truncate_ea(ea.mem.off +
+                                           (idx << state->sib_scale)),
                                (void *)mmvalp + i * op_bytes, op_bytes, ctxt);
                 if ( rc != X86EMUL_OKAY )
                 {