| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2022-49568: KVM: Don't null dereference ops->destroy |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| KVM: Don't null dereference ops->destroy |
| |
| A KVM device cleanup happens in either of two callbacks: |
| 1) destroy() which is called when the VM is being destroyed; |
| 2) release() which is called when a device fd is closed. |
| |
| Most KVM devices use 1) but Book3s's interrupt controller KVM devices |
| (XICS, XIVE, XIVE-native) use 2) as they need to close and reopen during |
| the machine execution. The error handling in kvm_ioctl_create_device() |
| assumes destroy() is always defined which leads to NULL dereference as |
| discovered by Syzkaller. |
| |
| This adds a checks for destroy!=NULL and adds a missing release(). |
| |
| This is not changing kvm_destroy_devices() as devices with defined |
| release() should have been removed from the KVM devices list by then. |
| |
| The Linux kernel CVE team has assigned CVE-2022-49568 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Fixed in 5.4.210 with commit 170465715a60cbb7876e6b961b21bd3225469da8 |
| Fixed in 5.10.134 with commit 3616776bc51cd3262bb1be60cc01c72e0a1959cf |
| Fixed in 5.15.58 with commit e91665fbbf3ccb268b268a7d71a6513538d813ac |
| Fixed in 5.18.15 with commit d4a5a79b780891c5cbdfdc6124d46fdf8d13dba1 |
| Fixed in 5.19 with commit e8bc2427018826e02add7b0ed0fc625a60390ae5 |
| |
| 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-49568 |
| 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: |
| virt/kvm/kvm_main.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/170465715a60cbb7876e6b961b21bd3225469da8 |
| https://git.kernel.org/stable/c/3616776bc51cd3262bb1be60cc01c72e0a1959cf |
| https://git.kernel.org/stable/c/e91665fbbf3ccb268b268a7d71a6513538d813ac |
| https://git.kernel.org/stable/c/d4a5a79b780891c5cbdfdc6124d46fdf8d13dba1 |
| https://git.kernel.org/stable/c/e8bc2427018826e02add7b0ed0fc625a60390ae5 |