Repository navigation
feat(fire_vmm): mask VMX and SVM from guests via /cpu-config - #91
Open
markovejnovic wants to merge 1 commit into
Open
markovejnovic wants to merge 1 commit into
markovejnovic wants to merge 1 commit into
Conversation
Firecracker passes VMX and SVM through from KVM_GET_SUPPORTED_CPUID unmasked, so on a host with the default kvm_intel/kvm_amd nested=1 every guest could run its own hypervisor on top of the host's nested-paging code (CVE-2026-53359). Every x86_64 boot now PUTs a /cpu-config that clears CPUID.01H:ECX[5] and CPUID.80000001H:ECX[2]. KVM treats CR4.VMXE as reserved and rejects EFER.SVME when the guest's CPUID lacks the bit, so the mask holds regardless of the host's nested parameter. aarch64 sends nothing.
3 tasks
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Test Results 3 files - 1 204 suites - 23 2m 18s ⏱️ - 1m 5s Results for commit 0c25f09. ± Comparison against base commit 3ac24e1. This pull request removes 191 and adds 2 tests. Note that renamed tests count towards both. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #90. Firecracker 1.16.0 passes VMX and SVM through unmasked, so on a host with the default
nested=1every guest can run a nested hypervisor, which is the precondition for CVE-2026-53359. Every x86_64 boot now PUTs a/cpu-configclearingCPUID.01H:ECX[5]andCPUID.80000001H:ECX[2]; aarch64 sends nothing.GuestCpu.config/1builds the template,BootSpec.resolve/3picks it by the VM's arch, andconfigure_devicesPUTs it right after machine-config.arch/x86/kvm/regs.h,arch/x86/kvm/msrs.c), so the mask holds whatever the host'snestedparam says.guest_cpu_properties_test.exsapplies the modifiers the way Firecracker documents its bitmap and checks VMX/SVM clear with every other host bit kept. Confirmed it fails for an LSB-first bitmap, a wrong bit, and a wrong subleaf.test/e2e/guest_cpu_test.exsasserts a booted guest's/proc/cpuinfoflags carry novmx/svm. It only has teeth if the runner's KVM has nested on; I haven't confirmed that for GitHub's runners.Verified on macOS:
format --check-formatted,credo --strict,compile --warnings-as-errors(bar the stamp-generatedSuidHelper.Expected), andmix test test/hyper/node/fire_vmm(69 passed). Dialyzer and the e2e suite need the Linux build, so those are CI's.Written by Claude Code; review it as AI-authored.