Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Reject non compliant SMCCC function calls in pKVM

Prevent the propagation of a function-id that has the top bits set since
this is not compliant with the SMCCC spec and can overlap with the
already known function-id decoders. (eg. if we invoke an smc with
0xffffffffc4000012 it will be decoded as a PSCI reset call). Instead,
make it clear that we don't support it and return an error.

Signed-off-by: Sebastian Ene <sebastianene@google.com>
Link: https://patch.msgid.link/20260408114118.422604-1-sebastianene@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Sebastian Ene and committed by
Marc Zyngier
480ea48c a0e6ae45

+4
+4
arch/arm64/kvm/hyp/nvhe/hyp-main.c
··· 805 805 } 806 806 807 807 func_id &= ~ARM_SMCCC_CALL_HINTS; 808 + if (upper_32_bits(func_id)) { 809 + cpu_reg(host_ctxt, 0) = SMCCC_RET_NOT_SUPPORTED; 810 + goto exit_skip_instr; 811 + } 808 812 809 813 handled = kvm_host_psci_handler(host_ctxt, func_id); 810 814 if (!handled)