Linux: RISC-V: KVM: Serialize IMSIC attributes with vCPU migration
What fixes it
- 6c2bcf6b173d4afed883cceea9d47f2c5194161dLinuxCVE List
- 71acbea44e78665ea90e3c310fca6bbdcc0252dbLinuxCVE List
- 8ae12ccaec6ec74945d8c1ef39f2c1b8df779abcLinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
RISC-V: KVM: Serialize IMSIC attributes with vCPU migration
KVM device ioctls are not serialized against KVM_RUN. As a result, kvm_riscv_aia_imsic_rw_attr() can snapshot the physical CPU and HGEI of an IMSIC VS-file before a concurrent vCPU migration releases it.
The HGEI can then be allocated to another vCPU before imsic_vsfile_rw() uses the stale tuple. A GET or SET attribute may consequently access the new owner's interrupt file.
Serialize the entire IMSIC attribute operation with the target vCPU mutex. This prevents the VS-file from being migrated and recycled until the attribute access completes. Acquire the mutex killably so that the device ioctl remains interruptible while waiting for KVM_RUN to finish.
Text from CVE List
Affected versions 12
- Linuxaffected: db8b7e97d6137a28b2bfc07e591d54da268f0c36 before 6c2bcf6b173d4afed883cceea9d47f2c5194161dCVE List
- Linuxaffected: db8b7e97d6137a28b2bfc07e591d54da268f0c36 before a29c5d2dd2ef9a8617a9a6d5585696d5f149cd98CVE List
- Linuxaffected: db8b7e97d6137a28b2bfc07e591d54da268f0c36 before c525772c304c971b0d3a1f2898dedbae653efe90CVE List
- Linuxaffected: db8b7e97d6137a28b2bfc07e591d54da268f0c36 before 71acbea44e78665ea90e3c310fca6bbdcc0252dbCVE List
- Linuxaffected: db8b7e97d6137a28b2bfc07e591d54da268f0c36 before 8ae12ccaec6ec74945d8c1ef39f2c1b8df779abcCVE List
- Linuxaffected: 6.5CVE List
- Linuxunaffected: all versions before 6.5CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.112 through 6.12.*CVE List
- Linuxunaffected: 6.18.55 through 6.18.*CVE List
- Linuxunaffected: 7.2.9 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/6c2bcf6b173d4afed883cceea9d47f2c5194161dReferencevia CVE List
- git.kernel.org/stable/c/a29c5d2dd2ef9a8617a9a6d5585696d5f149cd98Referencevia CVE List
- git.kernel.org/stable/c/c525772c304c971b0d3a1f2898dedbae653efe90Referencevia CVE List
- git.kernel.org/stable/c/71acbea44e78665ea90e3c310fca6bbdcc0252dbReferencevia CVE List
- git.kernel.org/stable/c/8ae12ccaec6ec74945d8c1ef39f2c1b8df779abcReferencevia CVE List