In the Linux kernel, the following vulnerability has been resolved: KVM: Explicitly verify target vCPU is online in kvm_get_vcpu() Explicitly verify the target vCPU is fully online _prior_ to clamping the index in kvm_get_vcpu(). If the index is "bad", the nospec clamping will generate '0', i.e. KVM will return vCPU0 instead of NULL. In practice, the bug is unlikely to cause problems, as it will only come into play if userspace or the guest is buggy or misbehaving, e.g. KVM may send interrupts to vCPU0 instead of dropping them on the floor. However, returning vCPU0 when it shouldn't exist per online_vcpus is problematic now that KVM uses an xarray for the vCPUs array, as KVM needs to insert into the xarray before publishing the vCPU to userspace (see commit c5b077549136 ("KVM: Convert the kvm->vcpus array to a xarray")), i.e. before vCPU creation is guaranteed to succeed. As a result, incorrectly providing access to vCPU0 will trigger a use-after-free if vCPU0 is dereferenced and kvm_vm_ioctl_create_vcpu() bails out of vCPU creation due to an error and frees vCPU0. Commit afb2acb2e3a3 ("KVM: Fix vcpu_array[0] races") papered over that issue, but in doing so introduced an unsolvable teardown conundrum. Preventing accesses to vCPU0 before it's fully online will allow reverting commit afb2acb2e3a3, without re-introducing the vcpu_array[0] UAF race.
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: KVM: verificar explícitamente que la vCPU de destino esté en línea en kvm_get_vcpu() Verifique explícitamente que la vCPU de destino esté completamente en línea _antes_ de fijar el índice en kvm_get_vcpu(). Si el índice es "malo", la fijación nospec generará '0', es decir, KVM devolverá vCPU0 en lugar de NULL. En la práctica, es poco probable que el error cause problemas, ya que solo entrará en juego si el espacio de usuario o el invitado tienen errores o se comportan mal, por ejemplo, KVM puede enviar interrupciones a vCPU0 en lugar de dejarlas en el suelo. Sin embargo, devolver vCPU0 cuando no debería existir según online_vcpus es problemático ahora que KVM usa una matriz x para la matriz vCPUs, ya que KVM necesita insertar en la matriz x antes de publicar la vCPU en el espacio de usuario (consulte el commit c5b077549136 ("KVM: Convertir la matriz kvm->vcpus en una matriz x")), es decir, antes de que se garantice que la creación de la vCPU sea exitosa. Como resultado, proporcionar acceso incorrectamente a vCPU0 activará un uso después de liberación si se desreferencia a vCPU0 y kvm_vm_ioctl_create_vcpu() abandona la creación de la vCPU debido a un error y libera vCPU0. El commit afb2acb2e3a3 ("KVM: Reparar las ejecuciones vcpu_array[0]") disimuló ese problema, pero al hacerlo introdujo un enigma de desmontaje irresoluble. Evitar accesos a vCPU0 antes de que esté completamente en línea permitirá revertir el commit afb2acb2e3a3, sin volver a introducir la ejecución UAF vcpu_array[0].
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Attack Vector | LOCAL |
|---|---|
| Attack Complexity | LOW |
| Privileges Required | LOW |
| User Interaction | NONE |
| Scope | UNCHANGED |
| Confidentiality Impact | HIGH |
| Integrity Impact | HIGH |
| Availability Impact | HIGH |
Source: 134c704f-9b21-4f2e-91b3-4a467353bcc0
Type: Secondary
Exploitability Score: 1.8
Impact Score: 5.9
| Source | Type | Description |
|---|---|---|
| 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary |
en
CWE-416
|
| Vendor | Product | Version | Update | Type |
|---|---|---|---|---|
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd36a1381c0> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd340bbffc0> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd3686e7200> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd369c0d6c0> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd36a13b480> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd36b2e46c0> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd38465b540> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd36bef8c00> | Operating System |
| linux | linux_kernel | * | <built-in method update of dict object at 0x7fd39c4e2240> | Operating System |
| Vulnerable | CPE |
|---|---|
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |
| Yes | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* |