Descrizione

In the Linux kernel, the following vulnerability has been resolved: KVM: Don't WARN if memory is dirtied without a vCPU when the VM is dying When marking a page dirty, complain about not having a running/loaded vCPU if and only if the VM is still alive, i.e. its refcount is non-zero. This will allow fixing a memory leak for x86 SEV-ES guests without hitting what is effectively a false positive on the WARN. For some SEV-ES VM-Exits, KVM keeps a writable mapping of a guest page across an exit to userspace, and typically unmaps the page on the next KVM_RUN. But if userspace never calls KVM_RUN after such an exit, then KVM needs to unmap the page when the vCPU is destroyed, which in turn triggers the WARN about not having a running vCPU. Alternatively, SEV-ES could temporarily load the vCPU to suppress the WARN, as is done in nested_vmx_free_vcpu() (but for completely unrelated reasons; suppressing WARN from nested_put_vmcs12_pages() is pure happenstance). But loading a vCPU during destruction is gross (ideally nVMX code would be cleaned up), risks complicating the SEV-ES code (KVM would need to ensure the temporarily load()+put() only runs when the vCPU isn't already loaded), and is ultimately pointless. The motivation for the WARN is to guard against KVM dirtying guest memory without pushing the corresponding GFN to the active vCPU's dirty ring, e.g. to ensure userspace doesn't miss a dirty page. But for the VM's refcount to reach zero, there can't be _any_ userspace mappings to the dirty ring, as mapping the dirty ring requires doing mmap() on the vCPU FD. I.e. if userspace had a valid mapping for the dirty ring, then the vCPU file and thus the owning VM would still be alive. And so since userspace can't possibly reach the dirty ring, whether or not KVM technically "misses" a push to the dirty ring is irrelevant.

Testo originale del record CVE (in inglese).

Come correggere

Priorità: Bassa — correggere con la manutenzione ordinaria. Motivazione: CVSS 5.5.

Versioni da aggiornare

  • Linux Linux Kernel: vulnerabili le versioni dalla 5.17 precedenti alla 6.6.143 → aggiornare alla 6.6.143 o successiva.
  • Linux Linux Kernel: vulnerabili le versioni dalla 6.7 precedenti alla 6.12.94 → aggiornare alla 6.12.94 o successiva.
  • Linux Linux Kernel: vulnerabili le versioni dalla 6.13 precedenti alla 6.18.36 → aggiornare alla 6.18.36 o successiva.
  • Linux Linux Kernel: vulnerabili le versioni dalla 6.19 precedenti alla 7.0.13 → aggiornare alla 7.0.13 o successiva.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc1 → installare l'ultima release supportata dal vendor.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc2 → installare l'ultima release supportata dal vendor.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc3 → installare l'ultima release supportata dal vendor.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc4 → installare l'ultima release supportata dal vendor.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc5 → installare l'ultima release supportata dal vendor.
  • Linux Linux Kernel: vulnerabile la versione 7.1 rc6 → installare l'ultima release supportata dal vendor.

Patch e advisory

Mitigazioni temporanee

Da applicare solo se non è possibile aggiornare subito:

  • Ridurre l'esposizione del componente vulnerabile (segmentazione, accesso solo da reti fidate) finché la patch non è applicata.

Verifica

  1. Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
  2. Confrontare la versione installata con quelle indicate sopra.
  3. Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
  4. Ripetere la scansione per confermare la correzione.

Configurazioni interessate

VendorProdottoVersioni vulnerabiliCorretta in
Linux Linux Kernel ≥ 5.17 < 6.6.143 6.6.143
Linux Linux Kernel ≥ 6.7 < 6.12.94 6.12.94
Linux Linux Kernel ≥ 6.13 < 6.18.36 6.18.36
Linux Linux Kernel ≥ 6.19 < 7.0.13 7.0.13
Linux Linux Kernel 7.1 rc1 —
Linux Linux Kernel 7.1 rc2 —
Linux Linux Kernel 7.1 rc3 —
Linux Linux Kernel 7.1 rc4 —
Linux Linux Kernel 7.1 rc5 —
Linux Linux Kernel 7.1 rc6 —

Riferimenti