]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/xen: Stop Xen timer before changing IRQ
authorColeman Dietsch <dietschc@csp.edu>
Mon, 8 Aug 2022 19:06:07 +0000 (14:06 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Aug 2022 19:08:25 +0000 (15:08 -0400)
commit71b244c38b0e53abac5ada52c6c9d6eca210568e
treef688e74105ee4732c7c11fac64ce835b95081c4a
parent54f4adbf3aca89e3046fb2078daeefdd1dfff7ac
KVM: x86/xen: Stop Xen timer before changing IRQ

Stop Xen timer (if it's running) prior to changing the IRQ vector and
potentially (re)starting the timer. Changing the IRQ vector while the
timer is still running can result in KVM injecting a garbage event, e.g.
vm_xen_inject_timer_irqs() could see a non-zero xen.timer_pending from
a previous timer but inject the new xen.timer_virq.

Fixes: 2f593423623f ("KVM: x86/xen: handle PV timers oneshot mode")
Cc: stable@vger.kernel.org
Link: https://syzkaller.appspot.com/bug?id=8234a9dfd3aafbf092cc5a7cd9842e3ebc45fc42
Reported-by: syzbot+e54f930ed78eb0f85281@syzkaller.appspotmail.com
Signed-off-by: Coleman Dietsch <dietschc@csp.edu>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Acked-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20220808190607.323899-3-dietschc@csp.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/xen.c