microVM: reconcile the 64-KiB command-line limit with the guest kernel's limit
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- infrastructure
Research direction
Start with section 5.1.2 of the architecture guide in doc/design/, then the limit constant in openvmm/openvmm_defs/src/microvm.rs (around L38-39 and the check near L1453-1456) and the Linux direct loader at vm/loader/src/linux/microvm.rs L288. Also check kernel/config-microvm, kernel/patches/, and scripts/nvx_tools/sandbox.py L22-26. The issue leaves the fix open, so first settle which option to take with maintainers. Done means the guide states the guest limit, the chosen option is implemented, and a boot test confirms the last profile token reaches the guest.
Written by the indexing model from the issue text.
Description
Summary
Section 5.1.2 of the architecture guide in doc/design/ limits the complete NUL-terminated kernel command line to 64 KiB, and OpenVMM enforces exactly that limit. The NVX guest kernel parses less: x86 Linux's COMMAND_LINE_SIZE is 2,048 bytes, as scripts/nvx_tools/sandbox.py also assumes, and neither kernel/config-microvm nor kernel/patches/ changes it. The VMM cannot read the kernel's limit from the uncompressed ELF image either.
OpenVMM can therefore accept a command line between 2 KiB and 64 KiB that the guest kernel truncates, and it reports no error. The machine profile appends its own tokens last (device discovery, nvx_control_tty=hvc2, and the network and host filesystem bootstrap tokens), so they are the first to be lost. This contradicts the rule that invalid configurations are rejected, never silently adjusted (section 1.4.1).
This is a gap in the architecture guide rather than an implementation deviation. Found while auditing the implementation against the guide.
Where it applies
- OpenVMM, at the gitlink nanvix/openvmm@c6d97c5:
MICROVM_COMMAND_LINE_MAX_SIZEis 64 KiB, checked in the profile (for example at L1453-L1456) and in the Linux direct loader. - The NVX launchers guard themselves.
nvx.py sandboxreserves 1,024 of the kernel's 2,048 bytes for OpenVMM (sandbox.pyL22-L26), andnvx-rslimits caller tokens to 1,024 bytes (COMMAND_LINE_BUDGET). Callers of OpenVMM itself have no such guard.
Options
- State the guest kernel's limit in section 5.1.2, and have OpenVMM reject an effective command line that exceeds it.
- Raise the guest kernel's command-line size with a kernel patch, so that the 64-KiB contract holds end to end.
Tasks
- Choose an option and update section 5.1.2 of the architecture guide.
- Implement it in nanvix/openvmm, and promote the pin, or in
kernel/patches/. - Add a boot test with a command line near the limit that checks that the last machine-profile token reaches the guest.
- If the guest kernel's limit rises above 4 KiB, make the managed agent read
/proc/cmdlineto its end within the new limit. The C agent and its Rust port in #531 (mappings::prepare) read at most 4,095 bytes, so the agent would miss a laternvx_maps=token and refuseMAPS(#531 review).
- Dominant language
- Python
- Stars
- 408
- Forks
- 28
- Avg merge
- 15h 20m
- Merged PRs (30d)
- 301
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 36/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
Similar issues
-
[Bug] Unit tests reach real Bedrock call paths without patching the modelPossibly taken @proton0210 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
aws-samples/sample-aws-genai-db-modernizer#1318 · 1 comment ·
Maintainers usually reply within 1 day
-
pyarrow-25.0.1-cp310-cp310-manylinux_2_28_x86_64.whl: 1 vulnerabilities (highest severity is: 5.3)OpenMend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
capitalone/locopy#394 ·
-
[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colonsOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
sdk-typescript: unquoted COPY globs in shell form are silently dropped from the image build contextOpenbug javascript
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ietf-tools/datatracker#11922 · 1 comment ·
Maintainers usually reply within 1 day