fix(tee): check the TSM provider before reading outblob - #112
Merged
imran-siddique merged 1 commit intoAug 17, 2026
Merged
Conversation
Reading outblob is what makes the platform generate and sign a report, so checking the provider afterwards meant a mismatched guest signed a report over the caller's binding which was then discarded. Nothing was returned and the entry was removed either way, so this was not a disclosure, but it asked the hardware to sign something no one could use. The provider check now gates the read, and a test asserts outblob is never read on a mismatch so the ordering cannot quietly regress. The fake configfs tree now generates the report on outblob read rather than on inblob write, which is the kernel's actual sequence and is what makes that assertion mean anything. Follow-up requested on review of agentrust-io#86. Signed-off-by: Susan Poudel <susanpdl77@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
imran-siddique
approved these changes
Aug 17, 2026
imran-siddique
left a comment
Member
There was a problem hiding this comment.
Reviewed the provider-before-outblob ordering and the adversarial configfs test. The wrong-provider path now performs zero outblob reads, avoiding unnecessary hardware report generation. Hosted tests, CodeQL, analysis, governance, Windows/Linux matrices, Ruff, mypy, and bandit are green. Approving.
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 non-blocking follow-up from your review of #86.
What was wrong
collect_reportreadoutbloband then checkedprovider:Reading
outblobis what makes the platform generate and sign the report, so on a mismatched provider the hardware signed a report over the caller's binding and it was then thrown away. As you said, nothing is returned and the entry is removed, so this is not a disclosure. It is asking the hardware to sign something no one can use, and the check costs nothing where it belongs.The provider check now gates the read. The two failures also read differently now, since they are different problems: an entry that names no provider cannot be trusted to be the right platform, and a matching provider that returns nothing is a collection failure.
Making it stick
The interesting part was that the old test could not have caught this, because the fake configfs tree wrote
outblobwheninblobwas written. That made the read a plain file read with no observable effect, which is exactly the property that matters here inverted.The fake now generates the report when
outblobis read, which is the kernel's actual sequence, and records which attributes were read.test_collect_report_refuses_the_wrong_platformthen assertsreads == [], so a mismatch means the report was never produced rather than produced and discarded.I checked the test fails against the old ordering rather than passing vacuously: restoring the previous sequence fails two tests, including that one.
Testing
429 passed, 3 skipped. ruff check, ruff format --check, mypy and bandit all clean.