Skip to content

fix(prepare): disable KVM nested virtualization (CVE-2026-53359)#60

Open
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
security/cve-2026-53359-disable-nested-virt
Open

fix(prepare): disable KVM nested virtualization (CVE-2026-53359)#60
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
security/cve-2026-53359-disable-nested-virt

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Disables KVM nested virtualization on generic (non-Talos) Ubuntu/RHEL/SUSE hosts prepared for Cozystack, to mitigate CVE-2026-53359 ("Januscape"), a guest-to-host escape in the Linux KVM/x86 shadow MMU (a use-after-free in kvm_mmu_get_child_sp() from shadow-page role confusion).

The vulnerable code path is only reachable when a guest is allowed to use nested virtualization; disabling it on the host removes the attack surface regardless of the node kernel patch level. Fixed upstream in 81ccda30b4e8 / stable 6.12.95, 6.6.144, 6.1.177, 6.18.38, 7.1.3 (2026-07-04).

Changes

  • Ship an /etc/modprobe.d/cozystack-kvm-nested.conf drop-in (options kvm_intel nested=0 / options kvm_amd nested=0) in examples/{ubuntu,rhel,suse}/prepare-*.yml, written before the kvm_* module is loaded (mirrors the existing DRBD modprobe.d ordering). Both options are set so one drop-in covers Intel and AMD.
  • Gated by a new cozystack_disable_kvm_nested variable (default true); a paired cleanup task removes the drop-in when opted out or when KubeVirt is disabled.
  • On a host where kvm_intel/kvm_amd is already loaded, a reboot (or module reload) is required for the change to take effect.

Part of a coordinated set of PRs (see Related PRs below).

Test plan

  • ansible-lint passes
  • ansible-test sanity passes
  • Tested on a live cluster (describe environment)
  • Idempotency verified (second run: changed=0)

Verified locally: ansible-playbook --syntax-check passes on all three playbooks. ansible-lint / live / idempotency not yet run — left for CI / reviewer.

Related PRs

Coordinated CVE-2026-53359 (Januscape) nested-virtualization mitigation across Cozystack repos:

Ship an /etc/modprobe.d/cozystack-kvm-nested.conf drop-in (options kvm_intel/kvm_amd nested=0) on Ubuntu, RHEL and SUSE host-prep to mitigate CVE-2026-53359 (Januscape), a KVM guest-to-host escape reachable only when nested virtualization is exposed to the guest. Gated by cozystack_disable_kvm_nested (default true); opt out to re-enable nested virt.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Assisted-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kvaps, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41dce35c-c655-4e1e-8e17-4df1dccb361a

📥 Commits

Reviewing files that changed from the base of the PR and between 2aaa9bc and c80481f.

📒 Files selected for processing (3)
  • examples/rhel/prepare-rhel.yml
  • examples/suse/prepare-suse.yml
  • examples/ubuntu/prepare-ubuntu.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/cve-2026-53359-disable-nested-virt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a mitigation for CVE-2026-53359 by disabling KVM nested virtualization across RHEL, SUSE, and Ubuntu environments. It adds Ansible tasks to write a modprobe configuration file (/etc/modprobe.d/cozystack-kvm-nested.conf) that sets nested=0 for both Intel and AMD KVM modules, and includes a cleanup task to remove the file if the mitigation is disabled. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant