Skip to content

kernel/attest: disable default fallback on serial port#1095

Open
luigix25 wants to merge 4 commits into
coconut-svsm:mainfrom
luigix25:disable_fallback
Open

kernel/attest: disable default fallback on serial port#1095
luigix25 wants to merge 4 commits into
coconut-svsm:mainfrom
luigix25:disable_fallback

Conversation

@luigix25

@luigix25 luigix25 commented May 28, 2026

Copy link
Copy Markdown
Collaborator

This PR makes vsock the default transport mechanism for attestation and makes the serial fallback as an opt-in feature behind the attest-serial rust feature.

To summarize:
make FEATURES=attest,virtio-drivers will try to use vsock as a transport, if it's not available it will fail.
make FEATURES=attest,virtio-drivers,attest-serial will try to use vsock as a transport first, if it's not available it will fallback using the serial port.

@stefano-garzarella stefano-garzarella 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.

When compiling SVSM with the vsock support, this becomes the preferred transport for the attestation proxy. If, for any reason, the attestation fails using vsock, it will try again using the serial port.

Add a new feature no-serial-fallback that selectively disables this fallback. In other words:

* `attest` = only transport mechanism is the serial port

* `attest` + `no-serial-fallback` = only transport mechanism is the serial port (no change)

* `attest` + `vsock` = main transport is vsock that falls back on the serial port

* `attest` + `vsock` + `no-serial-fallback` = only transport mechanism is vsock

IMO we can simplify this. Just add a attest-serial to support the serial port or not (disabled by default). And we should mark it deprecated or unsupported. I think we can also consider removing it at all.

Comment thread kernel/Cargo.toml Outdated
@stefano-garzarella stefano-garzarella self-assigned this May 28, 2026
@luigix25

luigix25 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

When compiling SVSM with the vsock support, this becomes the preferred transport for the attestation proxy. If, for any reason, the attestation fails using vsock, it will try again using the serial port.
Add a new feature no-serial-fallback that selectively disables this fallback. In other words:

* `attest` = only transport mechanism is the serial port

* `attest` + `no-serial-fallback` = only transport mechanism is the serial port (no change)

* `attest` + `vsock` = main transport is vsock that falls back on the serial port

* `attest` + `vsock` + `no-serial-fallback` = only transport mechanism is vsock

IMO we can simplify this. Just add a attest-serial to support the serial port or not (disabled by default). And we should mark it deprecated or unsupported. I think we can also consider removing it at all.

Ok, this simplifies the logic a little bit

I have a question though: If attestation on serial port is disabled by default, should attest depend on vsock? otherwise we would have no default transport.

I guess this also implies that serial port would be just a fallback?

@stefano-garzarella stefano-garzarella added the in-review PR is under active review and not yet approved label Jun 3, 2026
@stefano-garzarella stefano-garzarella changed the title kernel/attest: disable fallback on serial port kernel/attest: disable default fallback on serial port Jun 4, 2026
@stefano-garzarella

Copy link
Copy Markdown
Member

I have a question though: If attestation on serial port is disabled by default, should attest depend on vsock? otherwise we would have no default transport.

I guess this also implies that serial port would be just a fallback?

Yep, I'm unsure whether we need to support serial-only attestation (without vsock). I'd lean toward making attest depend on vsock to keep things simple. We can always add serial-only support later if needed.

I think we should also document that serial port is just for testing/debugging for now.

@stefano-garzarella stefano-garzarella added the wait-for-update PR is waiting to be updated to address review comments label Jun 11, 2026
luigix25 added 2 commits July 8, 2026 13:08
The generic lifetime parameter on Transport and AttestationDriver
is unnecessary since the borrowed data is always 'static. Replace
it with 'static directly, simplifying the type signatures.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Make `Transport::new()` and `create_serial_transport()` return Result so
that transport creation failures can be propagated to the caller.

This is preparatory work for an upcoming feature that disables
the fallback on the serial port.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
@luigix25 luigix25 force-pushed the disable_fallback branch from 670ff28 to 6d44b81 Compare July 8, 2026 13:46
@luigix25 luigix25 requested a review from 00xc as a code owner July 8, 2026 13:46
@luigix25 luigix25 removed the wait-for-update PR is waiting to be updated to address review comments label Jul 8, 2026
@luigix25 luigix25 force-pushed the disable_fallback branch from 6d44b81 to 8c7b27c Compare July 8, 2026 13:47
@luigix25

luigix25 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

[@stefano-garzarella]

  • vsock is now the default transport mechanism
  • serial is opt-in fallback when vsock is not available
  • updated doc
  • rebased to latest main

luigix25 added 2 commits July 8, 2026 15:52
Make vsock the default transport mechanism for attestation by adding
it as a hard dependency of the `attest` feature. Serial port support
is demoted to an opt-in fallback behind the new `attest-serial`
feature, as it is only needed for testing.

When `attest-serial` is enabled and the vsock connection fails,
the attestation driver falls back to the serial port transport as
before. When `attest-serial` is not enabled, vsock connection
failures are propagated to the caller as errors.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Vsock is now the default transport for attestation and serial port support
is opt-in via the `attest-serial` feature for testing only. Update the build
instructions and transport method descriptions accordingly.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
@luigix25 luigix25 force-pushed the disable_fallback branch from 8c7b27c to 00dc70d Compare July 8, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-review PR is under active review and not yet approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants