Skip to content

fix(talos): bake KVM nested-virt off into boot assets (CVE-2026-53359)#3240

Open
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
mainfrom
security/cve-2026-53359-bake-kvm-nested-uki
Open

fix(talos): bake KVM nested-virt off into boot assets (CVE-2026-53359)#3240
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
mainfrom
security/cve-2026-53359-bake-kvm-nested-uki

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Bakes kvm_intel.nested=0 / kvm_amd.nested=0 into the Talos boot assets at image build (imager profile customization.extraKernelArgs), mitigating CVE-2026-53359 ("Januscape") — the KVM guest-to-host escape that is only reachable when nested virtualization is exposed to guests. Cozystack VMs never need nested virt, so it is disabled on the host.

Why at image build rather than in the machine config: kvm_intel/kvm_amd are built into the Talos kernel, so nested= is only settable on the kernel command line. On UEFI/systemd-boot the command line is embedded in the UKI, so a machine-config install.extraKernelArgs is silently ignored — the args must be baked into the boot assets. Baking covers both GRUB (BIOS) and systemd-boot (UEFI). The imager rejects kernel-arg customization for the bare kernel/initramfs outputs, so only the boot-producing profiles (installer, image, iso) carry it.

hack/gen-profiles.sh is the source of truth; the committed profiles were regenerated pinned to the current Talos version so the only change is the added customization block (kernel/initramfs profiles are untouched).

Part of the coordinated CVE-2026-53359 mitigation across Cozystack repos.

Screenshots

N/A — no UI changes.

Release note

fix(talos): disable KVM nested virtualization in the Talos image to mitigate CVE-2026-53359

Summary by CodeRabbit

  • Bug Fixes
    • Updated Talos-generated profiles and installer/ISO/metal/nocloud outputs to disable nested virtualization by default, helping mitigate a security issue.
    • Ensured the kernel arguments are applied only to bootable profiles, while kernel/initramfs outputs remain unchanged.

kvm_intel/kvm_amd are built into the Talos kernel, so nested= is only
settable on the kernel command line. On UEFI/systemd-boot the cmdline is
baked into the UKI, so a machine-config install.extraKernelArgs is
ignored and the mitigation silently does not apply. Bake the args into
the boot assets at image build via the imager profile customization,
covering both GRUB (BIOS) and systemd-boot (UEFI). The imager rejects
kernel-arg customization for the bare kernel/initramfs outputs, so only
the boot-producing profiles carry it.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e921e815-251b-4c67-be96-3907ebd139c6

📥 Commits

Reviewing files that changed from the base of the PR and between 12c3cd0 and bb72d42.

📒 Files selected for processing (5)
  • packages/core/talos/hack/gen-profiles.sh
  • packages/core/talos/images/talos/profiles/installer.yaml
  • packages/core/talos/images/talos/profiles/iso.yaml
  • packages/core/talos/images/talos/profiles/metal.yaml
  • packages/core/talos/images/talos/profiles/nocloud.yaml

📝 Walkthrough

Walkthrough

The gen-profiles.sh script now conditionally injects extraKernelArgs into generated profile YAMLs based on profile kind, disabling nested virtualization for non-kernel/initramfs profiles. Correspondingly, the installer, iso, metal, and nocloud profile YAMLs each add a customization.extraKernelArgs block with kvm_intel.nested=0 and kvm_amd.nested=0.

Changes

Nested virtualization mitigation

Layer / File(s) Summary
Generator logic for kernel args customization
packages/core/talos/hack/gen-profiles.sh
Adds a case statement keyed by profile kind, leaving kernel/initramfs profiles with empty customization and others with a kvm_intel/kvm_amd nested=0 fragment, inserted before the output field.
Generated profile YAML updates
packages/core/talos/images/talos/profiles/installer.yaml, .../iso.yaml, .../metal.yaml, .../nocloud.yaml
Each profile adds a customization.extraKernelArgs block setting kvm_intel.nested=0 and kvm_amd.nested=0 with a CVE-2026-53359 reference comment.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: kvaps, lllamnyp

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: baking KVM nested-virt disablement into Talos boot assets for the CVE mitigation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/cve-2026-53359-bake-kvm-nested-uki

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.

@github-actions github-actions Bot added size/M This PR changes 30-99 lines, ignoring generated files area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug labels Jul 8, 2026
@lexfrei Aleksei Sviridkin (lexfrei) marked this pull request as ready for review July 8, 2026 08:56
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a security hardening measure for Talos images to address the 'Januscape' vulnerability (CVE-2026-53359). By baking the necessary kernel arguments directly into the boot assets during the image build process, the changes ensure that nested virtualization is disabled on the host, preventing potential guest-to-host escapes. This approach is necessary because standard machine-config overrides are ineffective for kernel command-line arguments in certain boot configurations.

Highlights

  • Security Mitigation: Disabled KVM nested virtualization by baking kvm_intel.nested=0 and kvm_amd.nested=0 into Talos boot assets to mitigate CVE-2026-53359.
  • Build Process Update: Updated hack/gen-profiles.sh to inject these kernel arguments at image build time, ensuring they are correctly applied to UEFI/systemd-boot environments where machine-config arguments are ignored.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot Bot added the security Security-related issues and features label Jul 8, 2026

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

Copy link
Copy Markdown
Contributor

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 updates the Talos profile generation script (hack/gen-profiles.sh) and regenerates the corresponding profile YAML files (installer.yaml, iso.yaml, metal.yaml, and nocloud.yaml) to disable KVM nested virtualization (kvm_intel.nested=0 and kvm_amd.nested=0) as a mitigation for CVE-2026-53359 (Januscape). This customization is applied to all boot-producing profiles while excluding bare kernel and initramfs outputs. There are no review comments, and I have no 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.

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug security Security-related issues and features size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants