瀏覽代碼

KVM: x86 emulator: do not perform address calculations on linear addresses

Linear addresses are supposed to already have segment checks performed on them;
if we play with these addresses the checks become invalid.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Avi Kivity 14 年之前
父節點
當前提交
30b31ab682
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      arch/x86/kvm/emulate.c

+ 2 - 1
arch/x86/kvm/emulate.c

@@ -568,7 +568,8 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt,
 			   ctxt->vcpu, NULL);
 	if (rc != X86EMUL_CONTINUE)
 		return rc;
-	rc = ops->read_std(linear(ctxt, addr) + 2, address, op_bytes,
+	addr.ea += 2;
+	rc = ops->read_std(linear(ctxt, addr), address, op_bytes,
 			   ctxt->vcpu, NULL);
 	return rc;
 }