KVM: x86: Improve thread safety in pit
authorAndy Honig <ahonig@google.com>
Wed, 27 Aug 2014 21:42:54 +0000 (14:42 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:47 +0000 (20:27 +0000)
commit30a340f59414f02434e8b7a880241b2bd657cb7b
tree27be63c790716b35c6af1337c97e4f41fe9e7364
parent76715b56c6fcdafae8d47d4fcfe8c940e76f0553
KVM: x86: Improve thread safety in pit

commit 2febc839133280d5a5e8e1179c94ea674489dae2 upstream.

There's a race condition in the PIT emulation code in KVM.  In
__kvm_migrate_pit_timer the pit_timer object is accessed without
synchronization.  If the race condition occurs at the wrong time this
can crash the host kernel.

This fixes CVE-2014-3611.

Signed-off-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/kvm/i8254.c