arch/x86/kvm/svm/nested.c in the Linux kernel before 5.11.12 has a use-after-free in which an AMD KVM guest can bypass access control on host OS MSRs when there are nested guests, aka CID-a58d9166a756. This occurs because of a TOCTOU race condition associated with a VMCB12 double fetch in nestedsvmvmrun.
[
{
"target": {
"file": "arch/x86/kvm/svm/nested.c"
},
"id": "CVE-2021-29657-165be2ca",
"deprecated": false,
"digest": {
"line_hashes": [
"35086250896484365186684645626736534727",
"18508595925419676760513210241412287961",
"179165128326979866505133653748939810363",
"92498689222661636639670566509068653005",
"241523807141027969486379174419092182312",
"51198726194448660995742196547714113485",
"208487694584745516729196013170565374578",
"60502154968035708733974546407185594253",
"329053446445379185495466013282148810971",
"290544613970370684600932049803990905439",
"158960812817190347485168093838376982815",
"95590977352561939890400109869512628225",
"86261914558056009256646499954705487031",
"95525048558606245587269969389054988824",
"242787545853493926639179253175071279913",
"252270958487450048999603324997755387472"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git@a58d9166a756a0f4a6618e4f593232593d6df134",
"signature_version": "v1"
},
{
"target": {
"function": "enter_svm_guest_mode",
"file": "arch/x86/kvm/svm/nested.c"
},
"id": "CVE-2021-29657-5163846c",
"deprecated": false,
"digest": {
"length": 347.0,
"function_hash": "88860881953698934951664206420164240936"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git@a58d9166a756a0f4a6618e4f593232593d6df134",
"signature_version": "v1"
},
{
"target": {
"function": "nested_svm_vmrun",
"file": "arch/x86/kvm/svm/nested.c"
},
"id": "CVE-2021-29657-a792d4e6",
"deprecated": false,
"digest": {
"length": 2549.0,
"function_hash": "300255692165757206904712180598480329388"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git@a58d9166a756a0f4a6618e4f593232593d6df134",
"signature_version": "v1"
},
{
"target": {
"function": "nested_vmcb_checks",
"file": "arch/x86/kvm/svm/nested.c"
},
"id": "CVE-2021-29657-bfe89271",
"deprecated": false,
"digest": {
"length": 921.0,
"function_hash": "90664693908558832969913125786565915329"
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git@a58d9166a756a0f4a6618e4f593232593d6df134",
"signature_version": "v1"
}
]
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-29657.json"