fkie_cve-2021-47092
Vulnerability from fkie_nvd
Published
2024-03-04 18:15
Modified
2025-02-14 14:49
Summary
In the Linux kernel, the following vulnerability has been resolved: KVM: VMX: Always clear vmx->fail on emulation_required Revert a relatively recent change that set vmx->fail if the vCPU is in L2 and emulation_required is true, as that behavior is completely bogus. Setting vmx->fail and synthesizing a VM-Exit is contradictory and wrong: (a) it's impossible to have both a VM-Fail and VM-Exit (b) vmcs.EXIT_REASON is not modified on VM-Fail (c) emulation_required refers to guest state and guest state checks are always VM-Exits, not VM-Fails. For KVM specifically, emulation_required is handled before nested exits in __vmx_handle_exit(), thus setting vmx->fail has no immediate effect, i.e. KVM calls into handle_invalid_guest_state() and vmx->fail is ignored. Setting vmx->fail can ultimately result in a WARN in nested_vmx_vmexit() firing when tearing down the VM as KVM never expects vmx->fail to be set when L2 is active, KVM always reflects those errors into L1. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 21158 at arch/x86/kvm/vmx/nested.c:4548 nested_vmx_vmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 Modules linked in: CPU: 0 PID: 21158 Comm: syz-executor.1 Not tainted 5.16.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:nested_vmx_vmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 Code: <0f> 0b e9 2e f8 ff ff e8 57 b3 5d 00 0f 0b e9 00 f1 ff ff 89 e9 80 Call Trace: vmx_leave_nested arch/x86/kvm/vmx/nested.c:6220 [inline] nested_vmx_free_vcpu+0x83/0xc0 arch/x86/kvm/vmx/nested.c:330 vmx_free_vcpu+0x11f/0x2a0 arch/x86/kvm/vmx/vmx.c:6799 kvm_arch_vcpu_destroy+0x6b/0x240 arch/x86/kvm/x86.c:10989 kvm_vcpu_destroy+0x29/0x90 arch/x86/kvm/../../../virt/kvm/kvm_main.c:441 kvm_free_vcpus arch/x86/kvm/x86.c:11426 [inline] kvm_arch_destroy_vm+0x3ef/0x6b0 arch/x86/kvm/x86.c:11545 kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1189 [inline] kvm_put_kvm+0x751/0xe40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1220 kvm_vcpu_release+0x53/0x60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3489 __fput+0x3fc/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x705/0x24f0 kernel/exit.c:832 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/signal.c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae
Impacted products



{
  "configurations": [
    {
      "nodes": [
        {
          "cpeMatch": [
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "matchCriteriaId": "7CD37FAC-AD9D-4A7B-9014-CF4F7A91800D",
              "versionEndExcluding": "5.15.12",
              "versionStartIncluding": "5.15",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc1:*:*:*:*:*:*",
              "matchCriteriaId": "357AA433-37E8-4323-BFB2-3038D6E4B414",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc2:*:*:*:*:*:*",
              "matchCriteriaId": "A73429BA-C2D9-4D0C-A75F-06A1CA8B3983",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc3:*:*:*:*:*:*",
              "matchCriteriaId": "F621B5E3-E99D-49E7-90B9-EC3B77C95383",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc4:*:*:*:*:*:*",
              "matchCriteriaId": "F7BFDCAA-1650-49AA-8462-407DD593F94F",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc5:*:*:*:*:*:*",
              "matchCriteriaId": "6EC9882F-866D-4ACB-8FBC-213D8D8436C8",
              "vulnerable": true
            },
            {
              "criteria": "cpe:2.3:o:linux:linux_kernel:5.16:rc6:*:*:*:*:*:*",
              "matchCriteriaId": "8A0915FE-A4AA-4C94-B783-CF29D81E7E54",
              "vulnerable": true
            }
          ],
          "negate": false,
          "operator": "OR"
        }
      ]
    }
  ],
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: VMX: Always clear vmx-\u003efail on emulation_required\n\nRevert a relatively recent change that set vmx-\u003efail if the vCPU is in L2\nand emulation_required is true, as that behavior is completely bogus.\nSetting vmx-\u003efail and synthesizing a VM-Exit is contradictory and wrong:\n\n  (a) it\u0027s impossible to have both a VM-Fail and VM-Exit\n  (b) vmcs.EXIT_REASON is not modified on VM-Fail\n  (c) emulation_required refers to guest state and guest state checks are\n      always VM-Exits, not VM-Fails.\n\nFor KVM specifically, emulation_required is handled before nested exits\nin __vmx_handle_exit(), thus setting vmx-\u003efail has no immediate effect,\ni.e. KVM calls into handle_invalid_guest_state() and vmx-\u003efail is ignored.\nSetting vmx-\u003efail can ultimately result in a WARN in nested_vmx_vmexit()\nfiring when tearing down the VM as KVM never expects vmx-\u003efail to be set\nwhen L2 is active, KVM always reflects those errors into L1.\n\n  ------------[ cut here ]------------\n  WARNING: CPU: 0 PID: 21158 at arch/x86/kvm/vmx/nested.c:4548\n                                nested_vmx_vmexit+0x16bd/0x17e0\n                                arch/x86/kvm/vmx/nested.c:4547\n  Modules linked in:\n  CPU: 0 PID: 21158 Comm: syz-executor.1 Not tainted 5.16.0-rc3-syzkaller #0\n  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011\n  RIP: 0010:nested_vmx_vmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547\n  Code: \u003c0f\u003e 0b e9 2e f8 ff ff e8 57 b3 5d 00 0f 0b e9 00 f1 ff ff 89 e9 80\n  Call Trace:\n   vmx_leave_nested arch/x86/kvm/vmx/nested.c:6220 [inline]\n   nested_vmx_free_vcpu+0x83/0xc0 arch/x86/kvm/vmx/nested.c:330\n   vmx_free_vcpu+0x11f/0x2a0 arch/x86/kvm/vmx/vmx.c:6799\n   kvm_arch_vcpu_destroy+0x6b/0x240 arch/x86/kvm/x86.c:10989\n   kvm_vcpu_destroy+0x29/0x90 arch/x86/kvm/../../../virt/kvm/kvm_main.c:441\n   kvm_free_vcpus arch/x86/kvm/x86.c:11426 [inline]\n   kvm_arch_destroy_vm+0x3ef/0x6b0 arch/x86/kvm/x86.c:11545\n   kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1189 [inline]\n   kvm_put_kvm+0x751/0xe40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1220\n   kvm_vcpu_release+0x53/0x60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3489\n   __fput+0x3fc/0x870 fs/file_table.c:280\n   task_work_run+0x146/0x1c0 kernel/task_work.c:164\n   exit_task_work include/linux/task_work.h:32 [inline]\n   do_exit+0x705/0x24f0 kernel/exit.c:832\n   do_group_exit+0x168/0x2d0 kernel/exit.c:929\n   get_signal+0x1740/0x2120 kernel/signal.c:2852\n   arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868\n   handle_signal_work kernel/entry/common.c:148 [inline]\n   exit_to_user_mode_loop kernel/entry/common.c:172 [inline]\n   exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207\n   __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]\n   syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300\n   do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86\n   entry_SYSCALL_64_after_hwframe+0x44/0xae"
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: KVM: VMX: borre siempre vmx-\u0026gt;fail en emulation_required Revierta un cambio relativamente reciente que establece vmx-\u0026gt;fail si la vCPU est\u00e1 en L2 y emulation_required es verdadero, ya que ese comportamiento es completamente falso. Configurar vmx-\u0026gt;fail y sintetizar una VM-Exit es contradictorio y incorrecto: (a) es imposible tener VM-Fail y VM-Exit (b) vmcs.EXIT_REASON no se modifica en VM-Fail (c) emulation_required se refiere al estado invitado y las comprobaciones del estado invitado son siempre salidas de VM, no fallas de VM. Para KVM espec\u00edficamente, emulation_required se maneja antes de las salidas anidadas en __vmx_handle_exit(), por lo que configurar vmx-\u0026gt;fail no tiene un efecto inmediato, es decir, las llamadas de KVM a handle_invalid_guest_state() y vmx-\u0026gt;fail se ignoran. Configurar vmx-\u0026gt;fail puede, en \u00faltima instancia, generar una ADVERTENCIA en nested_vmx_vmexit() al desactivar la VM, ya que KVM nunca espera que vmx-\u0026gt;fail se configure cuando L2 est\u00e1 activo, KVM siempre refleja esos errores en L1. ------------[ cortar aqu\u00ed ]------------ ADVERTENCIA: CPU: 0 PID: 21158 en arch/x86/kvm/vmx/nested.c:4548 nested_vmx_vmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 M\u00f3dulos vinculados en: CPU: 0 PID: 21158 Comm: syz-executor.1 No contaminado 5.16.0-rc3-syzkaller #0 Nombre de hardware: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:nested_vmx_vmexit+0x16bd/0x17e0 arch/x86/kvm/vmx/nested.c:4547 C\u00f3digo: \u0026lt;0f\u0026gt; 0b e9 2e f8 ff ff e8 57 b3 5d 00 0f 0b e9 00 f1 ff ff 89 e9 80 Seguimiento de llamadas: vmx_leave_nested arch/x86/kvm/vmx/nested.c:6220 [en l\u00ednea] nested_vmx_free_vcpu+0x83/0xc0 arch/x86/kvm/vmx/nested.c: 330 vmx_free_vcpu+0x11f/0x2a0 arch/x86/kvm/vmx/vmx.c:6799 kvm_arch_vcpu_destroy+0x6b/0x240 arch/x86/kvm/x86.c:10989 kvm_vcpu_destroy+0x29/0x90 arch/x86/kvm/.. /. ./../virt/kvm/kvm_main.c:441 kvm_free_vcpus arch/x86/kvm/x86.c:11426 [en l\u00ednea] kvm_arch_destroy_vm+0x3ef/0x6b0 arch/x86/kvm/x86.c:11545 kvm_destroy_vm arch/x86/ kvm/../../../virt/kvm/kvm_main.c:1189 [en l\u00ednea] kvm_put_kvm+0x751/0xe40 arch/x86/kvm/../../../virt/kvm/kvm_main.c :1220 kvm_vcpu_release+0x53/0x60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3489 __fput+0x3fc/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/ task_work.c:164 exit_task_work include/linux/task_work.h:32 [en l\u00ednea] do_exit+0x705/0x24f0 kernel/exit.c:832 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/se\u00f1al .c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [en l\u00ednea] exit_to_user_mode_loop kernel/entry/common.c:172 [en l\u00ednea] exit_to_user_mode_prepare+0x191/ 0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [en l\u00ednea] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common. c:86 entrada_SYSCALL_64_after_hwframe+0x44/0xae"
    }
  ],
  "id": "CVE-2021-47092",
  "lastModified": "2025-02-14T14:49:18.660",
  "metrics": {
    "cvssMetricV31": [
      {
        "cvssData": {
          "attackComplexity": "LOW",
          "attackVector": "LOCAL",
          "availabilityImpact": "HIGH",
          "baseScore": 5.5,
          "baseSeverity": "MEDIUM",
          "confidentialityImpact": "NONE",
          "integrityImpact": "NONE",
          "privilegesRequired": "LOW",
          "scope": "UNCHANGED",
          "userInteraction": "NONE",
          "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
          "version": "3.1"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 3.6,
        "source": "nvd@nist.gov",
        "type": "Primary"
      }
    ]
  },
  "published": "2024-03-04T18:15:07.723",
  "references": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Exploit",
        "Mailing List",
        "Patch"
      ],
      "url": "https://git.kernel.org/stable/c/a80dfc025924024d2c61a4c1b8ef62b2fce76a04"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Exploit",
        "Mailing List",
        "Patch"
      ],
      "url": "https://git.kernel.org/stable/c/e4e4e7cb229821cd215031abc47efdab5486a67c"
    },
    {
      "source": "af854a3a-2127-422b-91ae-364da2661108",
      "tags": [
        "Exploit",
        "Mailing List",
        "Patch"
      ],
      "url": "https://git.kernel.org/stable/c/a80dfc025924024d2c61a4c1b8ef62b2fce76a04"
    },
    {
      "source": "af854a3a-2127-422b-91ae-364da2661108",
      "tags": [
        "Exploit",
        "Mailing List",
        "Patch"
      ],
      "url": "https://git.kernel.org/stable/c/e4e4e7cb229821cd215031abc47efdab5486a67c"
    }
  ],
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "vulnStatus": "Analyzed",
  "weaknesses": [
    {
      "description": [
        {
          "lang": "en",
          "value": "NVD-CWE-noinfo"
        }
      ],
      "source": "nvd@nist.gov",
      "type": "Primary"
    }
  ]
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…