Skip to content

vmbus_serial_guest: add tx only option#2404

Merged
tjones60 merged 4 commits intomicrosoft:mainfrom
tjones60:one_way_serial
Feb 3, 2026
Merged

vmbus_serial_guest: add tx only option#2404
tjones60 merged 4 commits intomicrosoft:mainfrom
tjones60:one_way_serial

Conversation

@tjones60
Copy link
Copy Markdown
Contributor

@tjones60 tjones60 commented Nov 13, 2025

Add an option to the VMBUS serial relay that runs in OpenHCL to ignore all rx traffic from the host and only allow tx traffic from the guest. This can be attested to, offering a more secure way to debug a VM using the serial console, since only allowing one-way serial traffic would greatly reduce the possible attack surface. This is useful primarily for CVMs that don't have a framebuffer and are usually configured with serial disabled completely.

Copilot AI review requested due to automatic review settings November 13, 2025 00:14
@tjones60 tjones60 requested a review from a team as a code owner November 13, 2025 00:14
@github-actions github-actions Bot added the unsafe Related to unsafe code label Nov 13, 2025
@github-actions
Copy link
Copy Markdown

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a tx_only option to the VMBUS serial relay running in OpenHCL that drops all RX traffic from the host while allowing TX traffic from the guest. This enables unidirectional (guest-to-host only) serial communication.

  • Added tx_only boolean field throughout the configuration chain from CLI to the VMBUS serial driver
  • Modified VmbusSerialDriver::poll_read() to clear the RX buffer and return Poll::Pending when tx_only is enabled
  • Added test coverage for the tx_only behavior

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vm/devices/serial/vmbus_serial_guest/src/lib.rs Core implementation: adds tx_only field to config/driver, modifies AsyncRead to drop RX data, adds test
vm/devices/get/guest_emulation_transport/src/lib.rs Updates test fixtures to include tx_only field
vm/devices/get/guest_emulation_transport/src/client.rs Parses tx_only from JSON config for both COM ports
vm/devices/get/guest_emulation_transport/src/api.rs Adds tx_only fields to platform settings API
vm/devices/get/guest_emulation_device/src/test_utilities.rs Updates test utilities with serial_tx_only field
vm/devices/get/guest_emulation_device/src/resolver.rs Threads serial_tx_only through resource resolution
vm/devices/get/guest_emulation_device/src/lib.rs Adds serial_tx_only to GuestConfig and propagates to HclUartSettings
vm/devices/get/get_resources/src/lib.rs Adds serial_tx_only field to GED resource definition
vm/devices/get/get_protocol/src/dps_json.rs Adds tx_only field to HclUartSettings protocol struct
petri/src/vm/openvmm/construct.rs Initializes serial_tx_only to false in test VM config
openvmm/openvmm_entry/src/lib.rs Maps CLI serial_tx_only option to guest config
openvmm/openvmm_entry/src/cli_args.rs Adds --serial-tx-only CLI argument
openhcl/underhill_core/src/worker.rs Opens VMBUS serial devices with tx_only setting from DPS config

Comment thread vm/devices/get/guest_emulation_transport/src/client.rs Outdated
Comment thread vm/devices/get/guest_emulation_device/src/lib.rs Outdated
Comment thread vm/devices/serial/vmbus_serial_guest/src/lib.rs Outdated
@github-actions
Copy link
Copy Markdown

@smalis-msft
Copy link
Copy Markdown
Contributor

Why?

@tjones60
Copy link
Copy Markdown
Contributor Author

Why?

This is intended to be an option for CVMs that could be attested to, so you could enable serial output for debugging purposes without allowing interactive login to reduce risk.

@smalis-msft
Copy link
Copy Markdown
Contributor

Put that in the pr description?

@mebersol
Copy link
Copy Markdown
Collaborator

    console_enabled: dps.general.com1_enabled

an additional runtime claim is needed here.

I think we agreed on something like "console-mode:serial|serialbootdiagnosticsonly"


Refers to: openhcl/underhill_core/src/worker.rs:1782 in 3d6d329. [](commit_id = 3d6d329, deletion_comment = False)

smalis-msft
smalis-msft previously approved these changes Nov 13, 2025
@mebersol
Copy link
Copy Markdown
Collaborator

may want to update the definition for ManagementVtlFeatureFlags, too

@mebersol
Copy link
Copy Markdown
Collaborator

need to update AttestationVmConfig as well

Copy link
Copy Markdown
Collaborator

@mebersol mebersol left a comment

Choose a reason for hiding this comment

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

:shipit:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

@tjones60 tjones60 merged commit 51e54b3 into microsoft:main Feb 3, 2026
80 of 82 checks passed
tjones60 added a commit to tjones60/openvmm that referenced this pull request Feb 5, 2026
Add an option to the VMBUS serial relay that runs in OpenHCL to ignore
all rx traffic from the host and only allow tx traffic from the guest.
This can be attested to, offering a more secure way to debug a VM using
the serial console, since only allowing one-way serial traffic would
greatly reduce the possible attack surface. This is useful primarily for
CVMs that don't have a framebuffer and are usually configured with
serial disabled completely.
mattkur pushed a commit that referenced this pull request Feb 6, 2026
Add an option to the VMBUS serial relay that runs in OpenHCL to ignore
all rx traffic from the host and only allow tx traffic from the guest.
This can be attested to, offering a more secure way to debug a VM using
the serial console, since only allowing one-way serial traffic would
greatly reduce the possible attack surface. This is useful primarily for
CVMs that don't have a framebuffer and are usually configured with
serial disabled completely.
@mattkur
Copy link
Copy Markdown
Contributor

mattkur commented Feb 27, 2026

Backported to release/1.7.2511 in #2766

@mattkur mattkur added backported_1.7.2511 PR that has been backported to release/1.7.2511 and removed backport_1.7.2511 labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported_1.7.2511 PR that has been backported to release/1.7.2511 unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants