CVE-2022-50227: KVM: x86/xen: Initialize Xen timer only once
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
KVM: x86/xen: Initialize Xen timer only once
Add a check for existing xen timers before initializing a new one.
Currently kvm_xen_init_timer() is called on every KVM_XEN_VCPU_ATTR_TYPE_TIMER, which is causing the following ODEBUG crash when vcpu->arch.xen.timer is already set.
ODEBUG: init active (active state 0)
object type: hrtimer hint: xen_timer_callbac0
RIP: 0010:debug_print_object+0x16e/0x250 lib/debugobjects.c:502 Call Trace:
__debug_object_initdebug_hrtimer_initdebug_inithrtimer_initkvm_xen_init_timerkvm_xen_vcpu_set_attrkvm_arch_vcpu_ioctlkvm_vcpu_ioctlvfs_ioctl
The Linux kernel CVE team has assigned CVE-2022-50227 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 536395260582be7443b0b35b0bbb89ffe3947f62 and fixed in 5.19.2 with commit 9a9b5771e930f408c3419799000f76a9abaf2278 Issue introduced in 5.19 with commit 536395260582be7443b0b35b0bbb89ffe3947f62 and fixed in 6.0 with commit af735db31285fa699384c649be72a9f32ecbb665
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-50227
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
arch/x86/kvm/xen.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/9a9b5771e930f408c3419799000f76a9abaf2278 https://git.kernel.org/stable/c/af735db31285fa699384c649be72a9f32ecbb665