virtio/console: backport control validation to governed v1.19.4 - #4
Merged
dills122 merged 4 commits intoAug 5, 2026
Conversation
Guest control messages currently index ports and derived queues without validating the supplied port ID. Reject unknown PORT_READY and PORT_OPEN IDs before any port or queue access so malformed guest input cannot panic the VMM or change console state. Complete driver-to-device control chains with a used length of zero because the device does not write into them. Assisted-by: Codex:gpt-5.6-sol
The control transmit path currently reads an object from the head address without validating descriptor direction, declared length, chained layout, or guest memory ranges. That can read outside the driver-declared buffer and leave unreadable elements stranded. Validate the complete readable chain, accept scatter/gather layouts totaling exactly one control message, reject writable or malformed chains, and parse through the established descriptor Reader. Return every popped chain once with no device-written bytes. Assisted-by: Codex:gpt-5.6-sol
Preserve the original v1.19.4 patch-queue merge under an immutable baseline ref and route later governed updates through fresh versioned targets. Treat fork main as upstream-oriented integration state and require separate backports for Capsule adoption. Update workflow routing, corpus counts, and restoration mutations for the console control validation backport. Assisted-by: Codex:gpt-5.6-sol
Assisted-by: Codex:gpt-5.6-sol
dills122
marked this pull request as ready for review
August 5, 2026 16:05
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.
Summary
Backport the two separately retained virtio-console control-message fixes from the fork's upstream-oriented
mainline to a fresh governed v1.19.4 candidate.PORT_READYandPORT_OPENIDs before port or derived queue access;Reader, accepting valid scatter/gather and rejecting malformed, writable, unreadable, short, or trailing data;The source fixes are fork
maincommitseef8449c7438636139ff7fce553816e49ddc25d7and69e4fa9af5b9f37ffa23ba7bb87929a73ee0daf8from #3. The backport commits are separate because v1.19.4 predates the current console refactor.Governance
This PR also repairs the fork branch model exposed by the earlier merge:
4ea8d1de861ed1c0636fc800b6da8fb71a086aa5under lockedcapsule/baseline-v1.19.4-r1;cf0333cdba478cc34a8570a65b38412da7fd3ecclocked;capsule/upstream-v1.19.4-r3;Fork
mainremains upstream-oriented integration state. A merge there does not adopt bytes into Capsule; future adoption requires a separate governed backport.While
@dills122is the only qualified maintainer, the mutable r3 target requires a pull request, green checks, resolved conversations, administrator enforcement, no force-push, no deletion, evidence/settings readback, and maintainer self-review, but GitHub requires zero approving reviews and does not require most-recent-push or CODEOWNER approval. External approval enforcement may be enabled when a second qualified maintainer is available. This does not waive DCO acceptance, later independent product-admission review, or final upstream-submission authorization.Validation
cargo test -p krun-devices virtio::console::device::tests --locked -- --nocapture— 5 passedgovernance/capsule-v1.19.4/scripts/verify-governed.sh— PASSblktests/opt/homebrew/bin/python3.12 .github/scripts/check-ai-trailers.py cf0333c— PASSPATCH_QUEUE.jsonparse — PASS./run.sh test --test-case multiport-console --keep-all—OK - 1/1 passedon macOS 26.5.2 arm64/HVF; retained at/tmp/libkrun-tests.18jnmpKrYQ3Tgit show --check— PASS;31021879532and push run31021880674— PASS; formatting, AI trailers, code quality, cross-compilation, and Linux x86_64 unit tests also pass;31021879591remains queued for runner capacity, leaving GitHub merge stateUNSTABLEwithout a test failure.The governed library gate itself executed no guest. The separate fixed guest regression is bounded functional evidence only; it does not admit a backend, runtime, profile, release, or product path.
Review holds
Signed-off-bytrailer. A human must review the result and explicitly accept DCO responsibility before merge.