summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-12-31 00:13:43 +0300
committerSean Christopherson <seanjc@google.com>2026-01-14 04:37:03 +0300
commit405fce694bd1589082a7ffd500b5a4b841c22f0d (patch)
tree419c6e768080e055ca831dd9cdd0b83e95ccaee2 /include/uapi/linux
parent194c17bf5ebadd2fcf52ac641793e3d755a7af55 (diff)
downloadlinux-405fce694bd1589082a7ffd500b5a4b841c22f0d.tar.xz
KVM: SVM: Filter out 64-bit exit codes when invoking exit handlers on bare metal
Explicitly filter out 64-bit exit codes when invoking exit handlers, as svm_exit_handlers[] will never be sized with entries that use bits 63:32. Processing the non-failing exit code as a 32-bit value will allow tracking exit_code as a single 64-bit value (which it is, architecturally). This will also allow hardening KVM against Spectre-like attacks without needing to do silly things to avoid build failures on 32-bit kernels (array_index_nospec() rightly asserts that the index fits in an "unsigned long"). Omit the check when running as a VM, as KVM has historically failed to set bits 63:32 appropriately when synthesizing VM-Exits, i.e. KVM could get false positives when running as a VM on an older, broken KVM/kernel. From a functional perspective, omitting the check is "fine", as any unwanted collision between e.g. VMEXIT_INVALID and a 32-bit exit code will be fatal to KVM-on-KVM regardless of what KVM-as-L1 does. Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev> Link: https://patch.msgid.link/20251230211347.4099600-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions