Skip to content

Pkvm v6.18 intr fix#80

Open
cxdong wants to merge 6 commits intointel-staging:pkvm-v6.18from
cxdong:pkvm-v6.18-intr-fix
Open

Pkvm v6.18 intr fix#80
cxdong wants to merge 6 commits intointel-staging:pkvm-v6.18from
cxdong:pkvm-v6.18-intr-fix

Conversation

@cxdong
Copy link
Contributor

@cxdong cxdong commented Feb 25, 2026

Disable the software interrupt injection to the pVM, and validate the injected interrupt vector number is not in the range of 0 ~ 31.

Injecting software interrupts will change the guest's RIP. As there is
no usage to require the host to do so for a pVM, disallow the host to
inject software interrupts to a pVM for security reason.

Fixes: 3974ce6 ("pKVM: x86: Add event injection PV interfaces")
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
As the host is not allowed to inject the pVM's software interrupt, and
the pending pVM's software interrupt (exits during delivering a software
interrupt) should be injected by the pKVM, thus the host cannot cancel
such injection.

Fixes: addc9b4 ("pKVM: x86 Add cancel injection PV interface")
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Refactor pkvm_inject_nmi() to return -EBUSY if the NMI is not allowed.
This is aligned with the pkvm_inject_irq().

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
The host is allowed to use __pkvm__inject_irq to inject interrupts to a
pVM. However the injected interrupt number is not limited to be
interrupts only. A malicious host can use this PV interface to inject an
interrupt with the vector number from 0 ~ 31, which are the reserved
number by the Intel 64 and IA-32 architectures for architecture-defined
exceptions. As the pVM's exceptions are emulated and injected by the
pKVM itself, the host is not allowed to inject any exception to a pVM
but is expected to only injects external interrupts, validate the
interrupt vector number to make sure only the number for external
interrupts can be injected.

Fixes: 3974ce6 ("pKVM: x86: Add event injection PV interfaces")
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Validate the passed in max_isr value from the host for the same security
reason with the PV interface __pkvm__inject_irq, to make sure it is not
an exception vector for the pVM as the pVM's exceptions are emulated and
injected by the pKVM itself, and the host is not allowed to inject
exceptions to the pVM.

Fixes: b2743f1 ("pKVM: x86: Add hwapic_isr_update PV interface")
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Validate the passed in pir value from the host for the same security
reason with the PV interface __pkvm__inject_irq, to make sure it is not
an exception vector for the pVM as the pVM's exceptions are emulated and
injected by the pKVM itself, and the host is not allowed to inject
exceptions to the pVM.

Fixes: b7f4d37 ("pKVM: x86: Add sync_pir_to_irr PV interface")
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
@cxdong cxdong force-pushed the pkvm-v6.18-intr-fix branch from f4bd6a9 to aa7ffd0 Compare February 26, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants