fix(servtd_ext): gate per-binding fields on TDX_FEATURES0.SERVTD_REBIND#856
Open
sgrams wants to merge 1 commit into
Open
fix(servtd_ext): gate per-binding fields on TDX_FEATURES0.SERVTD_REBIND#856sgrams wants to merge 1 commit into
sgrams wants to merge 1 commit into
Conversation
The per-binding SERVICE_TD class metadata fields (SERVTD_ATTR, SERVTD_INFO_HASH, INIT_ATTR, etc.) are only available when the TDX module supports the SERVTD_REBIND feature (BIT48 of TDX_FEATURES0). Add is_rebind_supported() that reads TDX_FEATURES0 via TDG.SYS.RD and checks BIT48. Gate verify_servtd_attr, read_servtd_ext, and write_approved_servtd_ext_hash on this check: - If BIT48 is NOT set: skip gracefully (fields unavailable) - If BIT48 IS set: enforce strictly (fail on errors) Update callers in spdm_req.rs (sends zeroed struct when unavailable) and rebinding.rs (fails with Unsupported since rebinding requires BIT48). Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
Comment on lines
+58
to
+61
| log::warn!( | ||
| "Failed to read TDX_FEATURES0: {:?}, assuming rebind not supported", | ||
| e | ||
| ); |
Comment on lines
+209
to
+213
| log::error!( | ||
| "TDG.SERVTD.RD(SERVTD_ATTR) failed: {:?}, binding_handle={binding_handle:#x}, field_id={:#x}", | ||
| e, | ||
| TDCS_FIELD_SERVTD_ATTR | ||
| ); |
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.
The per-binding SERVICE_TD class metadata fields (SERVTD_ATTR, SERVTD_INFO_HASH, INIT_ATTR, etc.) are only available when the TDX module supports the SERVTD_REBIND feature (BIT48 of TDX_FEATURES0).
Add is_rebind_supported() that reads TDX_FEATURES0 via TDG.SYS.RD and checks BIT48. Gate verify_servtd_attr, read_servtd_ext, and write_approved_servtd_ext_hash on this check:
Update callers in spdm_req.rs (sends zeroed struct when unavailable) and rebinding.rs (fails with Unsupported since rebinding requires BIT48).