From: Nicholas Krause Date: Wed, 30 Dec 2015 18:08:46 +0000 (-0500) Subject: kvm: x86: Check kvm_write_guest return value in kvm_write_wall_clock X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1dab1345d885819a3a0d5d08ce0b5c2e12c65343;p=openwrt%2Fstaging%2Fblogic.git 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: Nicholas Krause Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b6102c1eb3b1..102c3028513f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1169,7 +1169,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) ++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