{"id":"CVE-2026-46295","aliases":["CVE-2026-46295"],"related":[],"kind":"vulnerability","state":"published","title":"KVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty\n\nFall back to apic_find_highest_vector() when PID.ON is set but PIR\nturns out to be empty, to correctly report the highest pending interrupt\nfrom the existing IRR.\n\nIn a nested VM stress test, the following WARNING fires in\nvmx_check_nested_events() when kvm_cpu_has_interrupt() reports a pending\ninterrupt but the subsequent kvm_apic_has_interrupt() (which invokes\nvmx_sync_pir_to_irr() again) returns -1:\n\n  WARNING: CPU: 99 PID: 57767 at arch/x86/kvm/vmx/nested.c:4449 vmx_check_nested_events+0x6bf/0x6e0 [kvm_intel]\n  Call Trace:\n   kvm_check_and_inject_events\n   vcpu_enter_guest.constprop.0\n   vcpu_run\n   kvm_arch_vcpu_ioctl_run\n   kvm_vcpu_ioctl\n   __x64_sys_ioctl\n   do_syscall_64\n   entry_SYSCALL_64_after_hwframe\n\nThe root cause is a race between vmx_sync_pir_to_irr() on the target vCPU\nand __vmx_deliver_posted_interrupt() on a sender vCPU.  The sender\nperforms two individually-atomic operations that are not a single\ntransaction:\n\n  1. pi_test_and_set_pir(vector)  -- sets the PIR bit\n  2. pi_test_and_set_on()         -- sets PID.ON\n\nThe following interleaving triggers the bug:\n\n  Sender vCPU (IPI):              Target vCPU (1st sync_pir_to_irr):\n  B1: set PIR[vector]\n                                  A1: pi_clear_on()\n                                  A2: pi_harvest_pir() -> sees B1 bit\n                                  A3: xchg() -> consumes bit, PIR=0\n                                      (1st sync returns correct max_irr)\n  B2: set PID.ON = 1\n\n                                  Target vCPU (2nd sync_pir_to_irr):\n                                  C1: pi_test_on() -> TRUE (from B2)\n                                  C2: pi_clear_on() -> ON=0\n                                  C3: pi_harvest_pir() -> PIR empty\n                                  C4: *max_irr = -1, early return\n                                      IRR NOT SCANNED\n\nThe interrupt is not lost (it resides in the IRR from the first sync and\nis recovered on the next vcpu_enter_guest() iteration), but the incorrect\nmax_irr causes a spurious WARNING and a wasted L2 VM-Enter/VM-Exit cycle.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Do IRR scan in __kvm_apic_update_irr even if PIR is empty\n\nFall back to apic_find_highest_vector() when PID.ON is set but PIR\nturns out to be empty, to correctly report the highest pending interrupt\nfrom the existing IRR.\n\nIn a nested VM stress test, the following WARNING fires in\nvmx_check_nested_events() when kvm_cpu_has_interrupt() reports a pending\ninterrupt but the subsequent kvm_apic_has_interrupt() (which invokes\nvmx_sync_pir_to_irr() again) returns -1:\n\n  WARNING: CPU: 99 PID: 57767 at arch/x86/kvm/vmx/nested.c:4449 vmx_check_nested_events+0x6bf/0x6e0 [kvm_intel]\n  Call Trace:\n   kvm_check_and_inject_events\n   vcpu_enter_guest.constprop.0\n   vcpu_run\n   kvm_arch_vcpu_ioctl_run\n   kvm_vcpu_ioctl\n   __x64_sys_ioctl\n   do_syscall_64\n   entry_SYSCALL_64_after_hwframe\n\nThe root cause is a race between vmx_sync_pir_to_irr() on the target vCPU\nand __vmx_deliver_posted_interrupt() on a sender vCPU.  The sender\nperforms two individually-atomic operations that are not a single\ntransaction:\n\n  1. pi_test_and_set_pir(vector)  -- sets the PIR bit\n  2. pi_test_and_set_on()         -- sets PID.ON\n\nThe following interleaving triggers the bug:\n\n  Sender vCPU (IPI):              Target vCPU (1st sync_pir_to_irr):\n  B1: set PIR[vector]\n                                  A1: pi_clear_on()\n                                  A2: pi_harvest_pir() -> sees B1 bit\n                                  A3: xchg() -> consumes bit, PIR=0\n                                      (1st sync returns correct max_irr)\n  B2: set PID.ON = 1\n\n                                  Target vCPU (2nd sync_pir_to_irr):\n                                  C1: pi_test_on() -> TRUE (from B2)\n                                  C2: pi_clear_on() -> ON=0\n                                  C3: pi_harvest_pir() -> PIR empty\n                                  C4: *max_irr = -1, early return\n                                      IRR NOT SCANNED\n\nThe interrupt is not lost (it resides in the IRR from the first sync and\nis recovered on the next vcpu_enter_guest() iteration), but the incorrect\nmax_irr causes a spurious WARNING and a wasted L2 VM-Enter/VM-Exit cycle.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nKVM: x86: Realizar escaneo IRR en __kvm_apic_update_irr incluso si PIR está vacío\n\nRecurrir a apic_find_highest_vector() cuando PID.ON está establecido pero PIR resulta estar vacío, para reportar correctamente la interrupción pendiente más alta del IRR existente.\n\nEn una prueba de estrés de VM anidada, la siguiente ADVERTENCIA se activa en vmx_check_nested_events() cuando kvm_cpu_has_interrupt() reporta una interrupción pendiente pero la subsiguiente kvm_apic_has_interrupt() (que invoca vmx_sync_pir_to_irr() de nuevo) devuelve -1:\n\n  ADVERTENCIA: CPU: 99 PID: 57767 en arch/x86/kvm/vmx/nested.c:4449 vmx_check_nested_events+0x6bf/0x6e0 [kvm_intel]\n  Traza de Llamada:\n   kvm_check_and_inject_events\n   vcpu_enter_guest.constprop.0\n   vcpu_run\n   kvm_arch_vcpu_ioctl_run\n   kvm_vcpu_ioctl\n   __x64_sys_ioctl\n   do_syscall_64\n   entry_SYSCALL_64_after_hwframe\n\nLa causa raíz es una condición de carrera entre vmx_sync_pir_to_irr() en la vCPU objetivo y __vmx_deliver_posted_interrupt() en una vCPU remitente. El remitente realiza dos operaciones individualmente atómicas que no son una única transacción:\n\n  1. pi_test_and_set_pir(vector) -- establece el bit PIR\n  2. pi_test_and_set_on() -- establece PID.ON\n\nEl siguiente entrelazado desencadena el error:\n\n  vCPU remitente (IPI):              vCPU objetivo (1ª sync_pir_to_irr):\n  B1: establecer PIR[vector]\n                                  A1: pi_clear_on()\n                                  A2: pi_harvest_pir() -> ve el bit B1\n                                  A3: xchg() -> consume el bit, PIR=0\n                                      (la 1ª sincronización devuelve el max_irr correcto)\n  B2: establecer PID.ON = 1\n\n                                  vCPU objetivo (2ª sync_pir_to_irr):\n                                  C1: pi_test_on() -> VERDADERO (de B2)\n                                  C2: pi_clear_on() -> ON=0\n                                  C3: pi_harvest_pir() -> PIR vacío\n                                  C4: max_irr = -1, retorno anticipado\n                                      IRR NO ESCANEADO\n\nLa interrupción no se pierde (reside en el IRR de la primera sincronización y se recupera en la siguiente iteración de vcpu_enter_guest()), pero el max_irr incorrecto causa una ADVERTENCIA espuria y un ciclo de VM-Enter/VM-Exit de L2 desperdiciado.","source":"nvd"}],"published":"2026-06-08T15:46:22.494Z","modified":"2026-07-23T08:10:00.137Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"b41f8638b9d30fbe045b4ef83ff4136c56a57397","fixed":"bb1703949dcaa9a49c338dee075f659f4634214d","status":"affected"},{"type":"git","introduced":"b41f8638b9d30fbe045b4ef83ff4136c56a57397","fixed":"4b6b06a8b12bfd95f9015074b1430c1480908073","status":"affected"},{"type":"git","introduced":"b41f8638b9d30fbe045b4ef83ff4136c56a57397","fixed":"33fd0ccd2590b470b65adcca288615ad3b5e3e06","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.18.30","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.7","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.16","fixed":"6.18.30"},{"status":"affected","introduced":"6.19","fixed":"7.0.7"},{"status":"affected","version":"7.1"},{"status":"affected","version":"7.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/bb1703949dcaa9a49c338dee075f659f4634214d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4b6b06a8b12bfd95f9015074b1430c1480908073","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/33fd0ccd2590b470b65adcca288615ad3b5e3e06","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46295","url":"https://www.cve.org/CVERecord?id=CVE-2026-46295","licence":"CVE Terms of Use","modified":"2026-06-14T18:07:10.912Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46295","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46295","licence":"Public domain","modified":"2026-07-23T08:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:24.009Z","epss":{"score":0.00112,"percentile":0.01535,"date":"2026-12-01T12:00:22.000Z"}}