提交 1dab1345 编写于 作者: N Nicholas Krause 提交者: Paolo Bonzini

kvm: x86: Check kvm_write_guest return value in kvm_write_wall_clock

This makes sure the wall clock is updated only after an odd version value
is successfully written to guest memory.
Signed-off-by: NNicholas Krause <xerofoify@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 0af2593b
...@@ -1169,7 +1169,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) ...@@ -1169,7 +1169,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
++version; ++version;
kvm_write_guest(kvm, wall_clock, &version, sizeof(version)); if (kvm_write_guest(kvm, wall_clock, &version, sizeof(version)))
return;
/* /*
* The guest calculates current wall clock time by adding * The guest calculates current wall clock time by adding
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册