kernel/attest: disable default fallback on serial port#1095
Conversation
stefano-garzarella
left a comment
There was a problem hiding this comment.
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-fallbackthat 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 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. |
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>
670ff28 to
6d44b81
Compare
6d44b81 to
8c7b27c
Compare
|
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>
8c7b27c to
00dc70d
Compare
This PR makes vsock the default transport mechanism for attestation and makes the serial fallback as an opt-in feature behind the
attest-serialrust feature.To summarize:
make FEATURES=attest,virtio-driverswill try to use vsock as a transport, if it's not available it will fail.make FEATURES=attest,virtio-drivers,attest-serialwill try to use vsock as a transport first, if it's not available it will fallback using the serial port.